Index: trunk/admin/install.php =================================================================== diff -u -r105 -r116 --- trunk/admin/install.php (.../install.php) (revision 105) +++ trunk/admin/install.php (.../install.php) (revision 116) @@ -353,7 +353,7 @@ } else { - $rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['UserName'])."&password=".md5($_POST['UserPass'])."&license_code=".base64_encode($g_LicenseCode)."&domain=".base64_encode($_SERVER['SERVER_NAME']), "r"); + $rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['UserName'])."&password=".md5($_POST['UserPass'])."&action=check&license_code=".base64_encode($g_LicenseCode)."&version=".str_replace('.', '', GetMaxPortalVersion($pathtoroot.$admin))."&domain=".base64_encode($_SERVER['SERVER_NAME']), "r"); if (!$rfile) { $LoggedIn = false; } @@ -436,74 +436,80 @@ $ado = inst_GetADODBConnection(); $Modules = array(); - $Texts = array(); - - $sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules"; - - $rs = $ado->Execute($sql); - //echo '
'.print_r($rs->GetRows(), true).'
'; - - $i = 0; - - while ($rs && !$rs->EOF) { - $p = strtolower($rs->fields['Name']); -// $modules .= strtolower($rs->fields['Name']).','; -// $rs->MoveNext(); -// } - -// $mod_arr = explode(",", substr($modules, 0, strlen($modules) - 1)); - -// foreach($mod_arr as $p) -// { + $Texts = array(); - if ($p == 'in-portal') { - $p = ''; - } - - $dir_name = $pathtoroot.$p."/admin/install/upgrades/"; - - $dir = @dir($dir_name); - //echo "
"; print_r($dir); echo "
"; - - while ($file = $dir->read()) { - if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) - { - $file = str_replace("inportal_upgrade_v", "", $file); - $file = str_replace(".sql", "", $file); - - if ($file != '') { - $sql = "SELECT count(*) AS count FROM ".$g_TablePrefix."Modules WHERE Name = '".$rs->fields['Name']."' AND Version = '$file'"; - $rs1 = $ado->Execute($sql); - - 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); - 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(); + if (str_replace('.', '', GetMaxPortalVersion($pathtoroot.$admin)) >= 105 && $g_LicenseCode == '') { + $state = 'reinstall'; + $inst_error = "Please upgrade your license before upgrade!"; } - - $include_file = $pathtoroot.$admin."/install/upgrade.php"; + else { + $sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules"; + + $rs = $ado->Execute($sql); + //echo '
'.print_r($rs->GetRows(), true).'
'; + + $i = 0; + + while ($rs && !$rs->EOF) { + $p = strtolower($rs->fields['Name']); + // $modules .= strtolower($rs->fields['Name']).','; + // $rs->MoveNext(); + // } + + // $mod_arr = explode(",", substr($modules, 0, strlen($modules) - 1)); + + // foreach($mod_arr as $p) + // { + + if ($p == 'in-portal') { + $p = ''; + } + + $dir_name = $pathtoroot.$p."/admin/install/upgrades/"; + + $dir = @dir($dir_name); + //echo "
"; print_r($dir); echo "
"; + + while ($file = $dir->read()) { + if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) + { + $file = str_replace("inportal_upgrade_v", "", $file); + $file = str_replace(".sql", "", $file); + + if ($file != '' && !strstr($file, 'changelog')) { + $sql = "SELECT count(*) AS count FROM ".$g_TablePrefix."Modules WHERE Name = '".$rs->fields['Name']."' AND Version = '$file'"; + $rs1 = $ado->Execute($sql); + + 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); + 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(); + } + + $include_file = $pathtoroot.$admin."/install/upgrade.php"; + } } if ($state == "upgrade_process") { $ado = inst_GetADODBConnection(); $mod_arr = $_POST['modules']; - + foreach($mod_arr as $p) { $mod_name = strtolower($p); @@ -529,7 +535,7 @@ $file = str_replace("inportal_upgrade_v", "", $file); $file = str_replace(".sql", "", $file); - if ($file != '') { + if ($file != '' && !strstr($file, 'changelog')) { $tmp1 = str_replace(".", "", $file); if ($tmp1 > $tmp2) { $new_version = $file; @@ -714,7 +720,7 @@ if ($_POST['login'] != '' && $_POST['password'] != '') { // Here we determine weather login is ok & check available licenses - $rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['login'])."&password=".md5($_POST['password'])."&domain=".base64_encode($_SERVER['SERVER_NAME']), "r"); + $rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['login'])."&password=".md5($_POST['password'])."&version=".str_replace('.', '', GetMaxPortalVersion($pathtoroot.$admin))."&domain=".base64_encode($_SERVER['SERVER_NAME']), "r"); if (!$rfile) { $get_license_error = "Unable to connect to the Intechnic server! Please try again later!"; $state = "get_license"; @@ -773,7 +779,7 @@ } else { // Here we download license - $rfile = @fopen(GET_LICENSE_URL."?license_id=".md5($_POST['licenses'])."&dlog=".md5($_POST['dlog'])."&dpass=".md5($_POST['dpass'])."&domain=".base64_encode($_POST['domain']), "r"); + $rfile = @fopen(GET_LICENSE_URL."?license_id=".md5($_POST['licenses'])."&dlog=".md5($_POST['dlog'])."&dpass=".md5($_POST['dpass'])."&version=".str_replace('.', '', 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!"; $state = "get_license"; @@ -794,7 +800,7 @@ } else { $tmp_data = explode('Code==:', $rcontents); - + $data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $tmp_data[0])); inst_ParseLicense($data); $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0)); @@ -1441,7 +1447,7 @@ $file = str_replace("inportal_upgrade_v", "", $file); $file = str_replace(".sql", "", $file); - if ($file != '') { + if ($file != '' && !strstr($file, 'changelog')) { $tmp1 = str_replace(".", "", $file); if ($tmp1 > $tmp2) { $new_version = $file; @@ -1527,7 +1533,7 @@ } $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)."&license_code=".base64_encode($g_LicenseCode)."&domain=".md5($_SERVER['SERVER_NAME']), "r"); + $rfile = @fopen(GET_LICENSE_URL."?url=".base64_encode($_SERVER['SERVER_NAME'].$_POST['Site_Path'])."&modules=".base64_encode($modules_str)."&license_code=".base64_encode($g_LicenseCode)."&version=".str_replace('.', '', GetMaxPortalVersion($pathtoroot.$admin))."&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"; Index: trunk/admin/install/install_lib.php =================================================================== diff -u -r105 -r116 --- trunk/admin/install/install_lib.php (.../install_lib.php) (revision 105) +++ trunk/admin/install/install_lib.php (.../install_lib.php) (revision 116) @@ -24,7 +24,7 @@ $file = str_replace("inportal_upgrade_v", "", $file); $file = str_replace(".sql", "", $file); - if ($file != '') { + if ($file != '' && !strstr($file, 'changelog')) { if (str_replace('.', '', $file) > str_replace('.', '', $version)) { $version = $file; } Index: trunk/admin/install/upgrades/inportal_upgrade_v1.0.5.sql =================================================================== diff -u -r93 -r116 --- trunk/admin/install/upgrades/inportal_upgrade_v1.0.5.sql (.../inportal_upgrade_v1.0.5.sql) (revision 93) +++ trunk/admin/install/upgrades/inportal_upgrade_v1.0.5.sql (.../inportal_upgrade_v1.0.5.sql) (revision 116) @@ -1,2 +1,4 @@ +UPDATE ConfigurationValues SET VariableValue = '' WHERE VariableValue = 'Hohlov'; +UPDATE ConfigurationValues SET VariableValue = '' WHERE VariableValue = 'Zhenya'; INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('SYSTEM_ACCESS.READONLY', 'la_PermName_SystemAccess.ReadOnly_desc', 'la_PermName_SystemAccess.ReadOnly_error', 'Admin'); UPDATE Modules SET Version = '1.0.5' WHERE Name = 'In-Portal'; \ No newline at end of file