Index: trunk/admin/install.php
===================================================================
diff -u -r1510 -r1566
--- trunk/admin/install.php (.../install.php) (revision 1510)
+++ trunk/admin/install.php (.../install.php) (revision 1566)
@@ -464,30 +464,30 @@
$inst_error = "Your license must be updated before you can upgrade. Please don't use 'Existing License' option, instead either Download from Intechnic or Upload a new license file!";
}
else {
- $sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules ORDER BY LoadOrder asc";
+ $sql = "SELECT Name, Version, Path FROM ".$g_TablePrefix."Modules ORDER BY LoadOrder asc";
$rs = $ado->Execute($sql);
$i = 0;
while ($rs && !$rs->EOF) {
- $p = strtolower($rs->fields['Name']);
+ $p = $rs->fields['Path'];
- if ($p == 'in-portal') {
+ if ($rs->fields['Name'] == 'In-Portal') {
$p = '';
}
- $dir_name = $pathtoroot.$p."/admin";///install/upgrades/";
+ $dir_name = $pathtoroot.$p."admin";///install/upgrades/";
- if($rs->fields['Version']!=$newver=GetMaxPortalVersion($dir_name))
+ if($rs->fields['Version'] != $newver = GetMaxPortalVersion($dir_name))
{
////////////////////
- $mod_name = strtolower($rs->fields['Name']);
+ $mod_path = $rs->fields['Path'];
$current_version = $rs->fields['Version'];
- if ($mod_name == 'in-portal')$mod_name = '';
+ if ($rs->fields['Name'] == 'In-Portal') $mod_path = '';
- $dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/";
+ $dir_name = $pathtoroot.$mod_path."/admin/install/upgrades/";
$dir = @dir($dir_name);
$upgrades_arr = Array();
@@ -513,7 +513,7 @@
$file_tmp = str_replace(".php", "", $file_tmp);
if (ConvertVersion($file_tmp) > ConvertVersion($current_version)) {
- $filename = $pathtoroot.$mod_name."/admin/install/upgrades/$file";
+ $filename = $pathtoroot.$mod_path."/admin/install/upgrades/$file";
if(file_exists($filename))
{
include($filename);
@@ -586,16 +586,19 @@
{
$mod_name = strtolower($p);
- $sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '$p'";
+ $sql = "SELECT Version, Path FROM ".$g_TablePrefix."Modules WHERE Name = '$p'";
$rs = $ado->Execute($sql);
$current_version = $rs->fields['Version'];
if ($mod_name == 'in-portal') {
- $mod_name = '';
+ $mod_path = '';
}
+ else {
+ $mod_path = $rs->fields['Path'];
+ }
- $dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/";
+ $dir_name = $pathtoroot.$mod_path."/admin/install/upgrades/";
$dir = @dir($dir_name);
$upgrades_arr = Array();
@@ -616,7 +619,7 @@
$file_tmp = str_replace(".sql", "", $file_tmp);
if (ConvertVersion($file_tmp) > ConvertVersion($current_version)) {
- $filename = $pathtoroot.$mod_name."/admin/install/upgrades/$file";
+ $filename = $pathtoroot.$mod_path."/admin/install/upgrades/$file";
//echo "Running: $filename
";
if(file_exists($filename))
{
@@ -625,7 +628,7 @@
}
}
- set_ini_value("Module Versions", $p, GetMaxPortalVersion($pathtoroot.$mod_name."/admin/"));
+ set_ini_value("Module Versions", $p, GetMaxPortalVersion($pathtoroot.$mod_path."/admin/"));
save_values();
}
@@ -1028,6 +1031,8 @@
$dir = @dir($dir_name);
//echo "
"; print_r($dir); echo ""; + if ($dir === false) continue; + while ($file = $dir->read()) { if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) {