Page MenuHomeIn-Portal Phabricator

upgrade_errors.php
No OneTemporary

File Metadata

Created
Wed, Nov 18, 12:29 PM

upgrade_errors.php

<?php
// new path detection without K4 init: begin
define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
define('BASE_PATH', rtrim(preg_replace('#/admin/install$#', '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))), '/'));
$rootURL = 'http://'.$_SERVER['HTTP_HOST'].rtrim(BASE_PATH, '/').'/admin/';
// new path detection without K4 init: end
$pathtoroot = FULL_PATH.'/';
$admin = 'admin';
$mod_name = '/'.strtolower($_GET['module']);
if ($mod_name == '/in-portal') $mod_name = '';
require_once $pathtoroot.'/admin/install/install_lib.php';
require_once($pathtoroot."/kernel/include/adodb/adodb.inc.php");
include($pathtoroot."/admin/install/inst_ado.php");
$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';
$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($mod_ver)) {
$filename = $pathtoroot.$mod_name."/admin/install/upgrades/$file";
if(file_exists($filename))
{
include($filename);
if($result&2)break;
}
}
}
}
?>
<html>
<head>
<title>In-Portal - Module Errors</title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta http-equiv="Pragma" content="no-cache">
<link rel="stylesheet" type="text/css" href="<?php echo $rootURL; ?>include/style.css">
</head>
<body topmargin="0" leftmargin="8" marginheight="8" marginwidth="8" bgcolor="#FFFFFF">
<DIV style='position:relative; z-Index: 1; background-color: #ffffff; padding-top:1px;'>
<div style='position:absolute; width:100%;top:0px;' align='right'>
<img src='<?php echo $rootURL; ?>images/logo_bg.gif'>
</div>
<img src="<?php echo $rootURL; ?>images/spacer.gif" width="1" height="7"><br>
<div style='z-Index:1; position:relative'>
<!-- ADMIN TITLE -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td valign="top" class="admintitle" align="left">
<img alt="" width="46" height="46" src="<?php echo $rootURL; ?>install/ic_install.gif" align="absmiddle">&nbsp;Module Errors<br>
<img src='<?php echo $rootURL; ?>images/spacer.gif' width=1 height=4><br>
</td></tr></table>
<!-- SECTION NAVIGATOR -->
<table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30"><tr>
<TD class="header_left_bg" width="100%">
<span class="tablenav_link">Install</span>
</td>
<td align="right" class="tablenav" background="<?php echo $rootURL; ?>inst_bg.jpg" width="10">
</td>
</tr>
</table>
<!-- END SECTION NAVIGATOR -->
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<tr>
<td bgcolor="F6F6F6">
<div class="help_box">
<?php
foreach ($CheckErrors as $error) {
echo '<b><font color="#FF0000">'.$error.'</font></b><br />';
}
?>
</h3> </div>
</td>
</tr>
</table>
</body>
</html>

Event Timeline