Index: trunk/admin/install.php =================================================================== diff -u -r26 -r31 --- trunk/admin/install.php (.../install.php) (revision 26) +++ trunk/admin/install.php (.../install.php) (revision 31) @@ -3,8 +3,6 @@ //$new_version = '1.0.2'; -//echo '
'.print_r($_REQUEST, true).''; - define("GET_LICENSE_URL", "http://www.in-portal.net/licensing/license.php"); define('BACKUP_NAME', 'dump(.*).txt'); // how backup dump files are named $general_error = ''; @@ -16,8 +14,6 @@ $install_type = $_GET['install_type']; } -$force_finish = isset($_REQUEST['ff']) ? true : false; - $pathtoroot = ""; if(!strlen($pathtoroot)) { @@ -425,9 +421,9 @@ $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) { -// $sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '".$p."'"; -// $rs2 = $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); $Texts[] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")"; $Modules[] = $rs->fields['Name']; } @@ -441,13 +437,18 @@ } if ($state == "upgrade_process") { - + $ado = inst_GetADODBConnection(); $mod_arr = $_POST['modules']; foreach($mod_arr as $p) { $mod_name = strtolower($p); + $sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '$p'"; + $rs = $ado->Execute($sql); + + $current_version = $rs->fields['Version']; + if ($mod_name == 'in-portal') { $mod_name = ''; } @@ -481,32 +482,26 @@ for ($j = 0; $j < $version_nrs[1] + 1; $j++) { for ($k = 0; $k < $version_nrs[2] + 1; $k++) { $try_version = "$i.$j.$k"; - - $filename = $pathtoroot.$mod_name."/admin/install/upgrades/inportal_upgrade_v$try_version.sql"; - - if(file_exists($filename)) - { - RunSQLFile($ado, $filename); - set_ini_value("Module Versions", $p, $try_version); - save_values(); + + if (str_replace('.', '', $try_version) > str_replace('.', '', $current_version)) { + $filename = $pathtoroot.$mod_name."/admin/install/upgrades/inportal_upgrade_v$try_version.sql"; + echo "Trying Version: $try_version