Index: trunk/admin/install.php =================================================================== diff -u -r66 -r67 --- trunk/admin/install.php (.../install.php) (revision 66) +++ trunk/admin/install.php (.../install.php) (revision 67) @@ -3,8 +3,7 @@ //$new_version = '1.0.2'; -//define("GET_LICENSE_URL", "http://www.in-portal.net/licensing/license.php"); -define("GET_LICENSE_URL", "http://maris.prod.intechnic.lv/in-business/license.php"); +define("GET_LICENSE_URL", "http://www.intechnic.com/myaccount/license.php"); define('BACKUP_NAME', 'dump(.*).txt'); // how backup dump files are named $general_error = ''; @@ -15,6 +14,8 @@ $install_type = $_GET['install_type']; } +$force_finish = isset($_REQUEST['ff']) ? true : false; + $pathtoroot = ""; if(!strlen($pathtoroot)) { @@ -130,6 +131,16 @@ $configs[3] = "in-portal:configure_categories"; $mods[3] = "In-Portal"; + +// simulate rootURL variable: begin + $rootURL = 'http://'.dirname($_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']); + $tmp = explode('/', $rootURL); + if( $tmp[ count($tmp) - 1 ] == $admin) unset( $tmp[ count($tmp) - 1 ] ); + $rootURL = implode('/', $tmp).'/'; + unset($tmp); + //echo "RU: $rootURL
"; +// simulate rootURL variable: end + if(strlen($g_DBType)>0 && strlen($state)>0 && $state !="dbinfo" && $state !="db_config_save") { require_once($pathtoroot."kernel/startup.php"); @@ -160,7 +171,7 @@ } require_once($pathtoroot.$admin."/install/inst_ado.php"); - +$helpURL = $rootURL.$admin.'/help/install_help.php?destform=popup&help_usage=install'; ?> @@ -184,10 +195,34 @@ function Continue() { document.iform1.submit(); } + + function CreatePopup(window_name, url, width, height) + { + // creates a popup window & returns it + if(url == null && typeof(url) == 'undefined' ) url = ''; + if(width == null && typeof(width) == 'undefined' ) width = 750; + if(height == null && typeof(height) == 'undefined' ) height = 400; + + + return window.open(url,window_name,'width='+width+',height='+height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no'); + } + + function ShowHelp(section) + { + var frm = document.getElementById('help_form'); + + frm.section.value = section; + frm.method = 'POST'; + CreatePopup('HelpPopup','/help/blank.html'); // , null, 600); + frm.target = 'HelpPopup'; + frm.submit(); + } + +
"> @@ -394,6 +429,7 @@ $sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules"; $rs = $ado->Execute($sql); + $i = 0; while ($rs && !$rs->EOF) { $p = strtolower($rs->fields['Name']); // $modules .= strtolower($rs->fields['Name']).','; @@ -425,12 +461,22 @@ if ($rs1->fields['count'] == 0 && str_replace('.', '', $file) > str_replace('.', '', $rs->fields['Version'])) { //$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '".$p."'"; //$rs2 = $ado->Execute($sql); - $Texts[] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")"; - $Modules[] = $rs->fields['Name']; - } + if ($Modules[$i-1] == $rs->fields['Name']) { + $Texts[$i-1] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")"; + //$Modules[] = $rs->fields['Name']; + $i--; + } + else { + $Texts[$i] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")"; + $Modules[$i] = $rs->fields['Name']; + } + + $i++; + } } - } + } } + $rs->MoveNext(); } @@ -497,10 +543,17 @@ } } } - } - $state = "finish"; - $include_file = "install/install_finish.php"; + $state = 'languagepack_upgrade'; + } +} + +// upgrade language pack +if($state=='languagepack_upgrade') +{ + $state = 'lang_install_init'; + $_POST['lang'][] = 'english.lang'; + $force_finish = true; } if($state=="db_reconfig_save") @@ -1256,7 +1309,7 @@ if($Status==0) { - $Offset = $objLanguages->ReadImportTable($PhraseTable, 1,"0,1,2",TRUE,200,$Offset); + $Offset = $objLanguages->ReadImportTable($PhraseTable, 1,"0,1,2", $force_finish ? false : true, 200,$Offset); if($Offset>=$Total) { $Offset=0; @@ -1270,7 +1323,9 @@ $next_step = $_GET['next_step']; } + 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'; $include_file = "install/lang_run.php"; } else @@ -1279,7 +1334,7 @@ $objMessageList = new clsEmailMessageList(); - $Offset = $objMessageList->ReadImportTable($EventTable,TRUE,100,$Offset); + $Offset = $objMessageList->ReadImportTable($EventTable, $force_finish ? false : true,100,$Offset); if($Offset>$Total) { @@ -1289,14 +1344,30 @@ else if ($_GET['next_step']) { $next_step = $_GET['next_step']; } + 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'; $include_file = "install/lang_run.php"; } else - $state="lang_default"; + { + if( !$force_finish ) + { + $state = 'lang_default'; + } + else + { + $_POST['next_step'] = 4; + $state = 'finish'; + $include_file = "install/install_finish.php"; + } + } } } + + + if($state=="lang_default_set") { // phpinfo(INFO_VARIABLES); @@ -1440,24 +1511,21 @@ if(substr($state,0,10)=="postconfig") { - $ado = GetADODBConnection(); - $p = explode("_",$state); $step = $p[1]; if ($_POST['Site_Path'] != '') { - $sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules"; - $rs = $ado->Execute($sql); + $sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules"; + $rs = $ado->Execute($sql); - $modules_str = ''; - while ($rs && !$rs->EOF) { - $modules_str .= $rs->fields['Name'].' ('.$rs->fields['Version'].'),'; - $rs->MoveNext(); - } - - $modules_str = substr($modules_str, 0, strlen($modules_str) - 1); - - $rfile = @fopen(GET_LICENSE_URL."?url=".base64_encode($_SERVER['SERVER_NAME'].$_POST['Site_Path'])."&modules=".base64_encode($modules_str)."&domain=".md5($_SERVER['SERVER_NAME']), "r"); + $modules_str = ''; + while ($rs && !$rs->EOF) { + $modules_str .= $rs->fields['Name'].' ('.$rs->fields['Version'].'),'; + $rs->MoveNext(); + } + + $modules_str = substr($modules_str, 0, strlen($modules_str) - 1); + $rfile = @fopen(GET_LICENSE_URL."?url=".base64_encode($_SERVER['SERVER_NAME'].$_POST['Site_Path'])."&modules=".base64_encode($modules_str)."&domain=".md5($_SERVER['SERVER_NAME']), "r"); if (!$rfile) { $get_license_error = "Unable to connect to the Intechnic server! Please try again later!"; $state = "postconfig_1"; @@ -1802,7 +1870,8 @@
  1. class="current">License Verification
  2. class="current">Select Modules to Upgrade -
  3. class="current">Finish +
  4. class="current">Language Pack Upgrade +
  5. class="current">Finish