Index: branches/unlabeled/unlabeled-1.110.2/admin/install.php =================================================================== diff -u -r6942 -r6988 --- branches/unlabeled/unlabeled-1.110.2/admin/install.php (.../install.php) (revision 6942) +++ branches/unlabeled/unlabeled-1.110.2/admin/install.php (.../install.php) (revision 6988) @@ -7,76 +7,20 @@ define('BACKUP_NAME', 'dump(.*).txt'); // how backup dump files are named $general_error = ''; -$pathtoroot = ""; -if( !(isset($pathtoroot) && $pathtoroot) ) -{ - $path=dirname(realpath(__FILE__)); - //$path=dirname(realpath(__FILE__)); - if(strlen($path)) - { - /* determine the OS type for path parsing */ - $pos = strpos($path,":"); - if ($pos === false) - { - $gOS_TYPE="unix"; - $pathchar = "/"; - } - else - { - $gOS_TYPE="win"; - $pathchar="\\"; - } - $p = $path.$pathchar; - /*Start looking for the root flag file */ - if( !isset($pathtoroot) ) $pathtoroot = ''; - while(!strlen($pathtoroot) && strlen($p)) - { - $sub = substr($p,strlen($pathchar)*-1); - if($sub==$pathchar) - { - $filename = $p."root.flg"; - } - else - $filename = $p.$pathchar."root.flg"; - if(file_exists($filename)) - { - $pathtoroot = $p; - } - else - { - $parent = realpath($p.$pathchar."..".$pathchar); - if($parent!=$p) - { - $p = $parent; - } - else - $p = ""; - } - } - if( !(isset($pathtoroot) && $pathtoroot) ) - $pathtoroot = ".".$pathchar; - } - else - { - $pathtoroot = ".".$pathchar; - } -} +// new path detection without K4 init: begin +define('FULL_PATH', realpath(dirname(__FILE__).'/..') ); +define('BASE_PATH', rtrim(preg_replace('#/admin$#', '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))), '/')); +$rootURL = 'http://'.$_SERVER['HTTP_HOST'].rtrim(BASE_PATH, '/').'/admin/'; +// new path detection without K4 init: end -$path_char = GetPathChar(); -//phpinfo(INFO_VARIABLES); +$pathtoroot = FULL_PATH.'/'; +$admin = 'admin'; -$sub = substr($pathtoroot,strlen($pathchar)*-1); -if($sub!=$pathchar) -{ - $pathtoroot = $pathtoroot.$pathchar; -} - ini_set('include_path', '.'); if (!defined('IS_INSTALL')) define('IS_INSTALL',1); if( file_exists($pathtoroot.'debug.php') && !(defined('DEBUG_MODE') && DEBUG_MODE) ) include_once($pathtoroot.'debug.php'); -$admin = substr($path,strlen($pathtoroot)); $state = isset($_GET["state"]) ? $_GET["state"] : ''; if(!strlen($state)) { Index: branches/unlabeled/unlabeled-1.1.2/kernel/include/globals.php =================================================================== diff -u -r6983 -r6988 --- branches/unlabeled/unlabeled-1.1.2/kernel/include/globals.php (.../globals.php) (revision 6983) +++ branches/unlabeled/unlabeled-1.1.2/kernel/include/globals.php (.../globals.php) (revision 6988) @@ -1810,31 +1810,6 @@ } } -function pr_bracket_comp($elem1, $elem2) -{ - - if ($elem1['MinQty']!="" && $elem1['MaxQty']=="" && $elem2['MinQty']!="" && $elem2['MaxQty']!="") return 1; - if ($elem1['MinQty']!="" && $elem1['MaxQty']=="" && $elem2['MinQty']=="" && $elem2['MaxQty']=="") return -1; - - - if ($elem1['MaxQty']=="" && $elem2['MaxQty']!="") return 1; - if ($elem1['MaxQty']!="" && $elem2['MaxQty']=="") return -1; - - - if( ($elem1['MaxQty']>$elem2['MaxQty'] && $elem2['MaxQty']!=-1) || ($elem1['MaxQty'] == -1 && $elem2['MaxQty'] != -1 )) - { - return 1; - } - elseif ( ($elem1['MaxQty']<$elem2['MaxQty']) || ($elem2['MaxQty'] == -1 && $elem1['MaxQty'] != -1 )) - { - return -1; - } - else - { - return 0; - } -} - function ap_bracket_comp($elem1, $elem2) { @@ -1860,38 +1835,6 @@ } } -function pr_bracket_id_sort($first_id, $second_id) -{ - $first_abs = abs($first_id); - $second_abs = abs($second_id); - $first_sign = ($first_id == 0) ? 0 : $first_id / $first_abs; - $second_sign = ($second_id == 0) ? 0 : $second_id / $second_abs; - if($first_sign != $second_sign) - { - if($first_id > $second_id) { - $bigger =& $first_abs; - $smaller =& $second_abs; - } - else { - $bigger =& $second_abs; - $smaller =& $first_abs; - } - $smaller = $bigger + $smaller; - } - - if($first_abs > $second_abs) { - return 1; - } - elseif ($first_abs < $second_abs) - { - return -1; - } - else - { - return 0; - } -} - function inp_htmlize($var, $strip = 0) { if( is_array($var) ) Index: branches/unlabeled/unlabeled-1.4.34/admin/install/upgrade_errors.php =================================================================== diff -u -r2793 -r6988 --- branches/unlabeled/unlabeled-1.4.34/admin/install/upgrade_errors.php (.../upgrade_errors.php) (revision 2793) +++ branches/unlabeled/unlabeled-1.4.34/admin/install/upgrade_errors.php (.../upgrade_errors.php) (revision 6988) @@ -1,103 +1,35 @@ $section) - { - foreach($section as $key => $value) - { - $key = "g_".str_replace('-', '', $key); - global $$key; - $$key = $value; - } - } +$ini_file = $pathtoroot.'config.php'; +if (file_exists($ini_file)) { + $write_access = is_writable($ini_file); + $ini_vars = inst_parse_portal_ini($ini_file,TRUE); + foreach ($ini_vars as $secname => $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'; @@ -115,10 +47,9 @@ $dir_name = $pathtoroot.$p."/admin";///install/upgrades/"; -$newver=GetMaxPortalVersion($dir_name); +$newver = GetMaxPortalVersion($dir_name); -if($mod_ver!=$newver) -{ +if ($mod_ver != $newver) { $dir_name = $pathtoroot.$p."/admin/install/upgrades/"; $dir = @dir($dir_name); @@ -143,7 +74,7 @@ $file_tmp = str_replace("inportal_check_v", "", $file); $file_tmp = str_replace(".php", "", $file_tmp); - if (ConvertVersion($file_tmp) > ConvertVersion($current_version)) { + if (ConvertVersion($file_tmp) > ConvertVersion($mod_ver)) { $filename = $pathtoroot.$mod_name."/admin/install/upgrades/$file"; if(file_exists($filename)) { @@ -155,11 +86,6 @@ } -function print_pre($s) -{ - echo '
'.print_r($s, true).'
'; -} - ?> Index: branches/unlabeled/unlabeled-1.8.34/admin/help/install_help.php =================================================================== diff -u -r2570 -r6988 --- branches/unlabeled/unlabeled-1.8.34/admin/help/install_help.php (.../install_help.php) (revision 2570) +++ branches/unlabeled/unlabeled-1.8.34/admin/help/install_help.php (.../install_help.php) (revision 6988) @@ -1,93 +1,21 @@ '.print_r($s, true).''; -} - -$section = $_REQUEST['section']; -$section = explode(':', $section); -if($section[0] == 'in-portal') $section[0] = 'kernel'; - -$topic_path = str_replace(THIS_FILE, '', $_SERVER['PATH_TRANSLATED']).$section[0].'/admin/include/help/'.$section[1].'.txt'; - -//echo "TP: $topic_path
"; + $topic_path = FULL_PATH.'/'.$section[0].'/admin/include/help/'.$section[1].'.txt'; + + //echo "TP: $topic_path
"; + ?> @@ -122,23 +50,14 @@ - +
+ +
+
-
- -
- -