Index: trunk/admin/install.php =================================================================== diff -u -r773 -r891 --- trunk/admin/install.php (.../install.php) (revision 773) +++ trunk/admin/install.php (.../install.php) (revision 891) @@ -473,10 +473,56 @@ } $dir_name = $pathtoroot.$p."/admin";///install/upgrades/"; - - $Modules[] = $rs->fields['Name']; - $Texts[] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".GetMaxPortalVersion($dir_name).")"; - + + if($rs->fields['Version']!=$newver=GetMaxPortalVersion($dir_name)) + { + +//////////////////// + + $mod_name = strtolower($rs->fields['Name']); + $current_version = $rs->fields['Version']; + if ($mod_name == 'in-portal')$mod_name = ''; + + $dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/"; + $dir = @dir($dir_name); + + $upgrades_arr = Array(); + + $new_version = ''; + while ($file = $dir->read()) { + if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) { + if (strstr($file, 'inportal_check_v')) { + $upgrades_arr[] = $file; + } + } + } + + usort($upgrades_arr, "VersionSort"); + $result=0; + $failCheck=1; + $stopCheck=2; + $CheckErrors = Array(); + + foreach($upgrades_arr as $file) + { + $file_tmp = str_replace("inportal_check_v", "", $file); + $file_tmp = str_replace(".php", "", $file_tmp); + + if (ConvertVersion($file_tmp) > ConvertVersion($current_version)) { + $filename = $pathtoroot.$mod_name."/admin/install/upgrades/$file"; + if(file_exists($filename)) + { + include($filename); + if($result&2)break; + } + } + } + +//////////////////// + + $Modules[] = Array('module'=>$rs->fields['Name'],'curver'=>$rs->fields['Version'],'newver'=>$newver,'error'=>$result!='pass'); +// $Texts[] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".GetMaxPortalVersion($dir_name).")"; + } /*$dir = @dir($dir_name); while ($file = $dir->read()) { Index: trunk/admin/install/upgrade_errors.php =================================================================== diff -u --- trunk/admin/install/upgrade_errors.php (revision 0) +++ trunk/admin/install/upgrade_errors.php (revision 891) @@ -0,0 +1,209 @@ + $section) + { + foreach($section as $key => $value) + { + $key = "g_".str_replace('-', '', $key); + global $$key; + $$key = $value; + } + } +} +$module_path = $pathtoroot.$mod_name.'/admin/install/'; +$ado =&inst_GetADODBConnection(); +$sql = 'SELECT Version FROM '.$g_TablePrefix.'Modules WHERE Name="'.addslashes($_GET['module']).'" ORDER BY LoadOrder'; +$rs = $ado->Execute($sql); + +$mod_ver = 0; +while ($rs && !$rs->EOF) { + $mod_ver = $rs->fields['Version']; + $rs->MoveNext(); +} + +$p = strtolower($_GET['module']); + +if ($p == 'in-portal')$p = ''; + +$dir_name = $pathtoroot.$p."/admin";///install/upgrades/"; + +$newver=GetMaxPortalVersion($dir_name); + +if($mod_ver!=$newver) +{ + $dir_name = $pathtoroot.$p."/admin/install/upgrades/"; + $dir = @dir($dir_name); + + $upgrades_arr = Array(); + + $new_version = ''; + while ($file = $dir->read()) { + if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) { + if (strstr($file, 'inportal_check_v')) { + $upgrades_arr[] = $file; + } + } + } + usort($upgrades_arr, "VersionSort"); + $result=0; + $failCheck=1; + $stopCheck=2; + $CheckErrors = Array(); + + foreach($upgrades_arr as $file) + { + $file_tmp = str_replace("inportal_check_v", "", $file); + $file_tmp = str_replace(".php", "", $file_tmp); + + if (ConvertVersion($file_tmp) > ConvertVersion($current_version)) { + $filename = $pathtoroot.$mod_name."/admin/install/upgrades/$file"; + if(file_exists($filename)) + { + include($filename); + if($result&2)break; + } + } + } + +} + +function print_pre($s) +{ + echo '
'.print_r($s, true).''; +} + +?> + + +
+ ![]() + ![]() + |
+ Install + | ++ | +
+
+'.$error.'
+
+ '; + } +?> + |
+
+