Index: trunk/kernel/include/config.php
===================================================================
diff -u -r289 -r315
--- trunk/kernel/include/config.php (.../config.php) (revision 289)
+++ trunk/kernel/include/config.php (.../config.php) (revision 315)
@@ -435,7 +435,7 @@
$i->prompt = $data["prompt"];
$i->ElementType = $data["element_type"];
$i->ValueList = $data["ValueList"];
- $i->ValidationRules = $data["validaton"];
+ $i->ValidationRules = isset($data['validaton']) ? $data['validaton'] : '';
$i->Section = $data["Section"];
if(strlen($last)>0)
Index: trunk/admin/install.php
===================================================================
diff -u -r311 -r315
--- trunk/admin/install.php (.../install.php) (revision 311)
+++ trunk/admin/install.php (.../install.php) (revision 315)
@@ -7,15 +7,6 @@
define('BACKUP_NAME', 'dump(.*).txt'); // how backup dump files are named
$general_error = '';
-if ($_POST['install_type'] != '') {
- $install_type = $_POST['install_type'];
-}
-else if ($_GET['install_type'] != '') {
- $install_type = $_GET['install_type'];
-}
-
-$force_finish = isset($_REQUEST['ff']) ? true : false;
-
$pathtoroot = "";
if(!strlen($pathtoroot))
{
@@ -86,11 +77,14 @@
$state = isset($_GET["state"]) ? $_GET["state"] : '';
if(!strlen($state))
{
- $state = $_POST["state"];
+ $state = isset($_POST['state']) ? $_POST['state'] : '';
}
include($pathtoroot.$admin."/install/install_lib.php");
+$install_type = GetVar('install_type', true);
+$force_finish = isset($_REQUEST['ff']) ? true : false;
+
$ini_file = $pathtoroot."config.php";
if(file_exists($ini_file))
{
@@ -145,7 +139,7 @@
// simulate rootURL variable: end
$db_savings = Array('dbinfo', 'db_config_save', 'db_reconfig_save'); //, 'reinstall_process'
-if(strlen($g_DBType)>0 && strlen($state)>0 && !in_array($state, $db_savings) )
+if( isset($g_DBType) && $g_DBType && strlen($state)>0 && !in_array($state, $db_savings) )
{
require_once($pathtoroot."kernel/startup.php");
$localURL=$rootURL."kernel/";
@@ -255,10 +249,7 @@
if(strlen($state)==0)
{
$ado = inst_GetADODBConnection();
- if($ado)
- {
- $installed = TableExists($ado,"ConfigurationAdmin,Category,Permissions");
- }
+ $installed = $ado ? TableExists($ado,"ConfigurationAdmin,Category,Permissions") : false;
if(!minimum_php_version("4.1.2"))
{
@@ -323,6 +314,8 @@
if($state=="reinstall_process")
{
+ $login_err_mesg = ''; // always init vars before use
+ if( !isset($g_License) ) $g_License = '';
$lic = base64_decode($g_License);
if(strlen($lic))
{
@@ -691,7 +684,11 @@
if ($state == "download_license") {
$ValidLicense = FALSE;
- if ($_POST['login'] != '' && $_POST['password'] != '') {
+
+ $lic_login = isset($_POST['login']) ? $_POST['login'] : '';
+ $lic_password = isset($_POST['password']) ? $_POST['password'] : '';
+
+ if ($lic_login != '' && $lic_password != '') {
// Here we determine weather login is ok & check available licenses
$rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['login'])."&password=".md5($_POST['password'])."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_SERVER['SERVER_NAME']), "r");
@@ -753,6 +750,12 @@
}
else {
// Here we download license
+ echo "LICENSE_ID: ".md5($_POST['licenses'])."
";
+ echo "DLOG: ".md5($_POST['dlog'])."
";
+ echo "DPASS: ".md5($_POST['dpass'])."
";
+ echo "VERSION: ".GetMaxPortalVersion($pathtoroot.$admin)."
";
+ echo "DOMAIN: ".base64_encode($_POST['domain'])."
";
+
$rfile = @fopen(GET_LICENSE_URL."?license_id=".md5($_POST['licenses'])."&dlog=".md5($_POST['dlog'])."&dpass=".md5($_POST['dpass'])."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_POST['domain']), "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
@@ -781,7 +784,8 @@
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
- set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
+ // old licensing script doen't return 2nd parameter (licanse code)
+ if( isset($tmp_data[1]) ) set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
save_values();
$state="domain_select";
}
@@ -800,7 +804,8 @@
if($state=="license_process")
{
$ValidLicense = FALSE;
- switch($_POST["lic_opt"])
+ $tmp_lic_opt = GetVar('lic_opt', true);
+ switch($tmp_lic_opt)
{
case 1: /* download from intechnic */
$include_file = $pathtoroot.$admin."/install/get_license.php";
@@ -935,7 +940,7 @@
}
}
- if ($install_type == '') {
+ if ( !isset($install_type) || $install_type == '') {
$install_type = 2;
}
@@ -976,7 +981,7 @@
if($state=="set_domain")
{
- if(!is_array($i_Keys))
+ if( !is_array($i_Keys) || !count($i_Keys) )
{
$lic = base64_decode($g_License);
if(strlen($lic))
@@ -1196,13 +1201,14 @@
if(is_object($l))
{
$LangId = $l->Get("LanguageId");
+ $NewLang = false;
}
else
{
$l = new clsLanguage();
$l->Set("Enabled",1);
$l->Create();
- $NewLang = TRUE;
+ $NewLang = true;
$LangId = $l->Get("LanguageId");
}
foreach($LangRoot->children as $tag)
@@ -1300,12 +1306,7 @@
$Status=1;
}
- if ($_POST['next_step']) {
- $next_step = $_POST['next_step'];
- }
- else if ($_GET['next_step']) {
- $next_step = $_GET['next_step'];
- }
+ $next_step = GetVar('next_step', true);
if($force_finish == true) $next_step = 3;
$NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&state=lang_install&next_step=$next_step&install_type=$install_type";
@@ -1322,12 +1323,8 @@
if($Offset>$Total)
{
- if ($_POST['next_step']) {
- $next_step = $_POST['next_step'];
- }
- else if ($_GET['next_step']) {
- $next_step = $_GET['next_step'];
- }
+ $next_step = GetVar('next_step', true);
+
if($force_finish == true) $next_step = 3;
$NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&State=lang_install&next_step=$next_step&install_type=$install_type";
if($force_finish == true) $NextUrl .= '&ff=1';
@@ -1389,7 +1386,7 @@
{
$ado = inst_GetADODBConnection();
require_once $pathtoroot.'kernel/include/tag-class.php';
- if( !is_object($objTagList) ) $objTagList = new clsTagList();
+ if( !isset($objTagList) || !is_object($objTagList) ) $objTagList = new clsTagList();
foreach($doms as $p)
{
$filename = $pathtoroot.$p."/admin/install.php";
@@ -1588,6 +1585,10 @@
echo "";
}
+// init variables
+$vars = Array('db_error','restore_error','PassError','DomainError','login_error','inst_error');
+foreach($vars as $var_name) ReSetVar($var_name);
+
switch($state)
{
case "modselect":
@@ -1713,18 +1714,13 @@
break;
}
-if ($_POST['next_step']) {
- $tmp_step = $_POST['next_step'];
-}
-else if ($_GET['next_step']) {
- $tmp_step = $_GET['next_step'];
-}
+$tmp_step = GetVar('next_step', true);
if (!$tmp_step) {
$tmp_step = 1;
}
-if ($got_license == 1) {
+if ( isset($got_license) && $got_license == 1) {
$tmp_step++;
}
@@ -1787,12 +1783,15 @@
+ | |
+ |
Login / E-mail: | -+ | ||
Password: | @@ -22,7 +22,7 @@Forgot password | ||
Index: trunk/kernel/include/emailmessage.php =================================================================== diff -u -r313 -r315 --- trunk/kernel/include/emailmessage.php (.../emailmessage.php) (revision 313) +++ trunk/kernel/include/emailmessage.php (.../emailmessage.php) (revision 315) @@ -576,7 +576,7 @@ return $e; } - function ReadImportTable($TableName,$Overwite=FALSE, $MaxInserts=100,$Offset=0) + function ReadImportTable($TableName,$Overwrite=FALSE, $MaxInserts=100,$Offset=0) { $eml = new clsEmailMessageList(); $this->Clear(); Index: trunk/admin/install/download_license.php =================================================================== diff -u -r43 -r315 --- trunk/admin/install/download_license.php (.../download_license.php) (revision 43) +++ trunk/admin/install/download_license.php (.../download_license.php) (revision 315) @@ -23,7 +23,7 @@ | |||
Index: trunk/admin/install/sel_license.php =================================================================== diff -u -r69 -r315 --- trunk/admin/install/sel_license.php (.../sel_license.php) (revision 69) +++ trunk/admin/install/sel_license.php (.../sel_license.php) (revision 315) @@ -16,12 +16,13 @@ | |||
- + | |||
Index: trunk/admin/install/modselect.php =================================================================== diff -u -r41 -r315 --- trunk/admin/install/modselect.php (.../modselect.php) (revision 41) +++ trunk/admin/install/modselect.php (.../modselect.php) (revision 315) @@ -22,7 +22,7 @@ } ?> | |||
Index: trunk/admin/install/dbinfo.php =================================================================== diff -u -r41 -r315 --- trunk/admin/install/dbinfo.php (.../dbinfo.php) (revision 41) +++ trunk/admin/install/dbinfo.php (.../dbinfo.php) (revision 315) @@ -48,14 +48,14 @@ | |||
Table Name Prefix: | - + | ||
Index: trunk/admin/install/theme_select.php =================================================================== diff -u -r41 -r315 --- trunk/admin/install/theme_select.php (.../theme_select.php) (revision 41) +++ trunk/admin/install/theme_select.php (.../theme_select.php) (revision 315) @@ -28,7 +28,7 @@ |
|||
Index: trunk/admin/install/reinstall.php =================================================================== diff -u -r78 -r315 --- trunk/admin/install/reinstall.php (.../reinstall.php) (revision 78) +++ trunk/admin/install/reinstall.php (.../reinstall.php) (revision 315) @@ -20,13 +20,13 @@ | |||
Username: | -+ | ||
Password: | |||
- + > |
|||
- + > | |||
+ | > | ||
+ | > | ||
+ | > | ||
Index: trunk/admin/install/lang_run.php =================================================================== diff -u -r69 -r315 --- trunk/admin/install/lang_run.php (.../lang_run.php) (revision 69) +++ trunk/admin/install/lang_run.php (.../lang_run.php) (revision 315) @@ -12,7 +12,7 @@ else $pct = 100; - $o .=' | + $o =' |
![]() '.section_header('Step '.$step_num.' - '.$caption.' - '.$pct.'%',true).' Index: trunk/kernel/include/modules.php =================================================================== diff -u -r310 -r315 --- trunk/kernel/include/modules.php (.../modules.php) (revision 310) +++ trunk/kernel/include/modules.php (.../modules.php) (revision 315) @@ -5,6 +5,9 @@ setcookie("CookiesTest", "1"); +// if branches that uses if($mod_prefix) or like that will never be executed +// due global variable $mod_prefix is never defined + $ExtraVars = array(); function ParseEnv() @@ -169,7 +172,7 @@ } else { - $t = $var_list["t"]; + $t = isset($var_list['t']) ? $var_list['t'] : ''; if(!is_numeric($t)) { if(!is_object($theme)) @@ -521,18 +524,14 @@ global $i_Keys, $objConfig, $pathtoroot; $vars = parse_portal_ini($pathtoroot."config.php"); + // globalize vars from config while($key = key($vars)) { - $key = "g_".$key; - global $$key; - $$key = current($vars); //variable variables - if(strlen($$key)>80) - { - $lic = base64_decode($$key); - } + $GLOBALS["g_".$key] = current($vars); next($vars); } - //$lic = base64_decode($g_License); + $lic = base64_decode($GLOBALS['g_License']); // this works in all cases + _ParseLicense($lic); $modules = array(); if(!_IsLocalSite(_GetDomain())) @@ -839,7 +838,7 @@ } } -if(is_numeric($var_list["t"])) +if( isset($var_list['t']) && is_numeric($var_list['t'])) { if( !isset($CurrentTheme) ) $CurrentTheme = null; if(!is_object($CurrentTheme)) @@ -857,7 +856,7 @@ LogEntry("Loading Module action scripts\n"); ## Global Referer Template -$_local_t = $var_list["t"]; +$_local_t = isset($var_list['t']) ? $var_list['t'] : ''; if(is_array($mod_prefix)) { @@ -870,6 +869,7 @@ if( !strlen($admin) ) $admin = "admin"; $adminURL = $rootURL.$admin; $imagesURL = $adminURL."/images"; + if(_ModuleLicensed($modules_loaded[$key])) { $mod = $pathtoroot.$folder_name."module_init.php"; @@ -880,7 +880,9 @@ $mod = $pathtoroot.$folder_name."searchaction.php"; if( file_exists($mod) ) require_once($mod); + } + } if($FrontEnd==1 || $FrontEnd==2) { Index: trunk/admin/install/lang_select.php =================================================================== diff -u -r41 -r315 --- trunk/admin/install/lang_select.php (.../lang_select.php) (revision 41) +++ trunk/admin/install/lang_select.php (.../lang_select.php) (revision 315) @@ -22,7 +22,7 @@ } ?> | |
Index: trunk/kernel/include/theme.php =================================================================== diff -u -r271 -r315 --- trunk/kernel/include/theme.php (.../theme.php) (revision 271) +++ trunk/kernel/include/theme.php (.../theme.php) (revision 315) @@ -246,8 +246,8 @@ $f->Set(array("FilePath","FileName","ThemeId","FileType","Description"), array($Path,$Name,$ThemeId,$Type,$Description)); $f->Create(); - if($Contents!=NULL) - $f->SaveFileContents($Contents); + if($contents!=NULL) + $f->SaveFileContents($contents); //echo $f->Get("FilePath")."/".$f->Get("FileName")." \n"; return $f; } |