Index: trunk/core/kernel/startup.php
===================================================================
diff -u -N -r2600 -r2604
--- trunk/core/kernel/startup.php (.../startup.php) (revision 2600)
+++ trunk/core/kernel/startup.php (.../startup.php) (revision 2604)
@@ -10,16 +10,15 @@
# New path detection method
-echo "FULL_PATH: ".FULL_PATH.' A Configuration file has been detected on your system and it appears In-Portal is correctly installed. ";
$help .="In order to work with the maintenance functions provided to the left you must provide the Intechnic ";
$help .="Username and Password you used when obtaining the license file residing on the server, or your admin Root password. ";
- $help .=" (Use Username 'root' if using your root password)
';
+//echo "FULL_PATH: ".FULL_PATH.'
';
-$fp = str_replace('\\', '/', dirname(FULL_PATH));
+//$fp = str_replace('\\', '/', dirname(FULL_PATH));
$ps = preg_replace("/\/admin$/", '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])));
-echo "fp: $fp
";
-echo "ps: $ps
";
+//echo "fp: $fp
";
+//echo "ps: $ps
";
-$_SERVER['DOCUMENT_ROOT'] = $fp;
-define('DOC_ROOT', $fp);
+//$_SERVER['DOCUMENT_ROOT'] = $fp;
define('BASE_PATH', $ps);
# /New method
@@ -54,10 +53,8 @@
ini_set('memory_limit', '50M');
-echo "FULL_PATH: ".FULL_PATH.'
';
-echo "DOC_ROOT: ".DOC_ROOT.'
';
-echo "BASE_PATH: ".BASE_PATH.'
';
-echo "MODULES_PATH: ".DOC_ROOT.'
';
+/*echo "FULL_PATH: ".FULL_PATH.'
';
+echo "BASE_PATH: ".BASE_PATH.'
';*/
define('MODULES_PATH', FULL_PATH);
define('EXPORT_PATH', FULL_PATH.'/admin/export');
Index: trunk/admin/install.php
===================================================================
diff -u -N -r2569 -r2604
--- trunk/admin/install.php (.../install.php) (revision 2569)
+++ trunk/admin/install.php (.../install.php) (revision 2604)
@@ -100,18 +100,18 @@
{
foreach($section as $key => $value)
{
- $key = "g_".str_replace('-', '', $key);
+ $key = "g_".str_replace('-', '', $key);
global $$key;
$$key = $value;
}
- }
+ }
}
else
{
- $state="";
+ $state="";
$write_access = is_writable($pathtoroot);
if($write_access)
- {
+ {
set_ini_value("Database", "DBType", "");
set_ini_value("Database", "DBHost", "");
set_ini_value("Database", "DBUser", "");
@@ -191,39 +191,39 @@
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i
';
}
$general_error .= "In-portal's Image Upload directory must be writable (".$pathtoroot."kernel/images/).";
//die();
- }
-
+ }
+
if(!is_writable($pathtoroot."kernel/images/pending"))
{
if ($general_error != '') {
$general_error .= '
';
}
$general_error .= "In-portal's Pending Image Upload directory must be writable (".$pathtoroot."kernel/images/pending).";
//die();
- }
-
+ }
+
if(!is_writable($pathtoroot."admin/backupdata/"))
{
if ($general_error != '') {
$general_error .= '
';
}
$general_error .= "In-portal's Backup directory must be writable (".$pathtoroot."admin/backupdata/).";
//die();
- }
-
+ }
+
if(!is_writable($pathtoroot."admin/export/"))
{
if ($general_error != '') {
$general_error .= '
';
}
$general_error .= "In-portal's Export directory must be writable (".$pathtoroot."admin/export/).";
//die();
- }
-
+ }
+
if(!is_writable($pathtoroot."kernel/stylesheets/"))
{
if ($general_error != '') {
@@ -326,7 +326,7 @@
$general_error .= "In-portal's stylesheets directory must be writable (".$pathtoroot."kernel/stylesheets/).";
//die();
}
-
+
if(!is_writable($pathtoroot."kernel/user_files/"))
{
if ($general_error != '') {
@@ -335,7 +335,7 @@
$general_error .= "In-portal's CMS images directory must be writable (".$pathtoroot."kernel/user_files/).";
//die();
}
-
+
if(!is_writable($pathtoroot."kernel/cache/"))
{
if ($general_error != '') {
@@ -344,9 +344,9 @@
$general_error .= "In-portal's templates cache directory must be writable (".$pathtoroot."kernel/cache/).";
//die();
}
-
+
if($installed)
- {
+ {
$state="reinstall";
}
else {
@@ -363,20 +363,20 @@
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
- $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
+ $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
$LoggedIn = FALSE;
- if($_POST["UserName"]=="root")
+ if($_POST["UserName"]=="root")
{
$ado =& inst_GetADODBConnection();
$sql = "SELECT * FROM ".$g_TablePrefix."ConfigurationValues WHERE VariableName='RootPass'";
-
+
$rs = $ado->Execute($sql);
if($rs && !$rs->EOF)
- {
+ {
$RootPass = $rs->fields["VariableValue"];
-
+
if(strlen($RootPass)>0)
$LoggedIn = ($RootPass==md5($_POST["UserPass"]));
}
@@ -390,7 +390,7 @@
$rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['UserName'])."&password=".md5($_POST['UserPass'])."&action=$act&license_code=".base64_encode($g_LicenseCode)."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_SERVER['HTTP_HOST']), "r");
if (!$rfile) {
$login_err_mesg = "Unable to connect to the Intechnic server!";
- $LoggedIn = false;
+ $LoggedIn = false;
}
else {
$rcontents = '';
@@ -399,25 +399,25 @@
$rcontents .= $line;
}
@fclose($rfile);
-
+
if (substr($rcontents, 0, 5) == 'Error') {
$login_err_mesg = substr($rcontents, 6);
- $LoggedIn = false;
+ $LoggedIn = false;
}
else {
$LoggedIn = true;
}
}
//$LoggedIn = ($i_User == $_POST["UserName"] && ($i_Pswd == $_POST["UserPass"]) && strlen($i_User)>0) || strlen($i_User)==0;
}
-
+
if($LoggedIn)
{
if (!(int)$_POST["inp_opt"]) {
$state="reinstall";
$inst_error = "Please select one of the options above!";
}
- else {
+ else {
switch((int)$_POST["inp_opt"])
{
case 0:
@@ -427,25 +427,25 @@
/* clean out all tables */
$install_type = 4;
$ado =& inst_GetADODBConnection();
- $filename = $pathtoroot.$admin."/install/inportal_remove.sql";
+ $filename = $pathtoroot.$admin."/install/inportal_remove.sql";
RunSchemaFile($ado,$filename);
-
+
// removing other tables
$tables = $ado->MetaTables();
-
+
foreach($tables as $tab_name) {
if (stristr($tab_name, $g_TablePrefix."ses_")) {
$sql = "DROP TABLE IF EXISTS $tab_name";
$ado->Execute($sql);
}
}
-
+
/* run install again */
$state="license";
break;
case 2:
$install_type = 3;
- $state="dbinfo";
+ $state="dbinfo";
break;
case 3:
$install_type = 5;
@@ -455,10 +455,10 @@
$install_type = 6;
/* clean out all tables */
$ado =& inst_GetADODBConnection();
- //$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
+ //$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
//RunSchemaFile($ado,$filename);
/* run install again */
- $state="restore_select";
+ $state="restore_select";
break;
case 5:
$install_type = 7;
@@ -472,40 +472,40 @@
case 7:
$install_type = 9;
$state = "fix_paths";
- break;
+ break;
}
}
}
else
- {
+ {
$state="reinstall";
$login_error = $login_err_mesg;//"Invalid Username or Password - Try Again";
}
}
if ($state == "upgrade") {
$ado =& inst_GetADODBConnection();
-
+
$Modules = array();
- $Texts = array();
-
- if (ConvertVersion(GetMaxPortalVersion($pathtoroot.$admin)) >= ConvertVersion("1.0.5") && ($g_LicenseCode == '' && $g_License != '')) {
+ $Texts = array();
+
+ if (ConvertVersion(GetMaxPortalVersion($pathtoroot.$admin)) >= ConvertVersion("1.0.5") && ($g_LicenseCode == '' && $g_License != '')) {
$state = 'reinstall';
$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, Path FROM ".$g_TablePrefix."Modules ORDER BY LoadOrder asc";
-
+
$rs = $ado->Execute($sql);
-
- $i = 0;
+
+ $i = 0;
while ($rs && !$rs->EOF) {
- $p = $rs->fields['Path'];
-
+ $p = $rs->fields['Path'];
+
if ($rs->fields['Name'] == 'In-Portal') {
$p = '';
- }
-
+ }
+
$dir_name = $pathtoroot.$p."admin";///install/upgrades/";
if($rs->fields['Version'] != $newver = GetMaxPortalVersion($dir_name))
@@ -518,21 +518,21 @@
if ($rs->fields['Name'] == 'In-Portal') $mod_path = '';
$dir_name = $pathtoroot.$mod_path."/admin/install/upgrades/";
- $dir = @dir($dir_name);
-
+ $dir = @dir($dir_name);
+
$upgrades_arr = Array();
-
+
$new_version = '';
while ($file = $dir->read()) {
- if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) {
+ if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) {
if (strstr($file, 'inportal_check_v')) {
- $upgrades_arr[] = $file;
+ $upgrades_arr[] = $file;
}
}
}
-
+
usort($upgrades_arr, "VersionSort");
-
+
$result=0;
$failCheck=1;
$stopCheck=2;
@@ -541,36 +541,36 @@
foreach($upgrades_arr as $file)
{
$file_tmp = str_replace("inportal_check_v", "", $file);
- $file_tmp = str_replace(".php", "", $file_tmp);
-
+ $file_tmp = str_replace(".php", "", $file_tmp);
+
if (ConvertVersion($file_tmp) > ConvertVersion($current_version)) {
$filename = $pathtoroot.$mod_path."/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);
-
+ }
+
+ /*$dir = @dir($dir_name);
+
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
- {
+ {
if (strstr($file, 'inportal_upgrade_v')) {
$file = str_replace("inportal_upgrade_v", "", $file);
- $file = str_replace(".sql", "", $file);
-
+ $file = str_replace(".sql", "", $file);
+
//$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 && ConvertVersion($file) > ConvertVersion($rs->fields['Version'])) {
if ($Modules[$i-1] == $rs->fields['Name']) {
$Texts[$i-1] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")";
@@ -580,78 +580,78 @@
$Texts[$i] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")";
$Modules[$i] = $rs->fields['Name'];
}
-
+
$i++;
- }
+ }
}
- }
+ }
}*/
-
- $rs->MoveNext();
+
+ $rs->MoveNext();
}
-
+
$include_file = $pathtoroot.$admin."/install/upgrade.php";
}
}
if ($state == "upgrade_process") {
- $ado =& inst_GetADODBConnection();
+ $ado =& inst_GetADODBConnection();
$mod_arr = $_POST['modules'];
-
+
$mod_str = '';
foreach ($mod_arr as $tmp_mod) {
$mod_str .= "'$tmp_mod',";
}
-
+
$mod_str = substr($mod_str, 0, strlen($mod_str) - 1);
-
+
$sql = "SELECT Name FROM ".$g_TablePrefix."Modules WHERE Name IN ($mod_str) ORDER BY LoadOrder";
$rs = $ado->Execute($sql);
-
+
$mod_arr = array();
while ($rs && !$rs->EOF) {
$mod_arr[] = $rs->fields['Name'];
$rs->MoveNext();
}
-
+
foreach($mod_arr as $p)
{
$mod_name = strtolower($p);
-
+
$sql = "SELECT Version, Path FROM ".$g_TablePrefix."Modules WHERE Name = '$p'";
- $rs = $ado->Execute($sql);
-
+ $rs = $ado->Execute($sql);
+
$current_version = $rs->fields['Version'];
-
+
if ($mod_name == 'in-portal') {
$mod_path = '';
}
else {
$mod_path = $rs->fields['Path'];
}
-
+
$dir_name = $pathtoroot.$mod_path."/admin/install/upgrades/";
- $dir = @dir($dir_name);
-
+ $dir = @dir($dir_name);
+
$upgrades_arr = Array();
-
+
$new_version = '';
while ($file = $dir->read()) {
- if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) {
+ if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) {
if (strstr($file, 'inportal_upgrade_v')) {
- $upgrades_arr[] = $file;
+ $upgrades_arr[] = $file;
}
}
}
-
+
usort($upgrades_arr, "VersionSort");
-
+
foreach($upgrades_arr as $file)
{
preg_match('/inportal_upgrade_v(.*).(php|sql)$/', $file, $rets);
$tmp_version = $rets[1];
$tmp_extension = $rets[2];
-
+
if (ConvertVersion($tmp_version) > ConvertVersion($current_version) )
{
$filename = $pathtoroot.$mod_path."/admin/install/upgrades/$file";
@@ -667,30 +667,30 @@
include_once $filename;
}
}
- }
+ }
}
-
+
set_ini_value("Module Versions", $p, GetMaxPortalVersion($pathtoroot.$mod_path."/admin/"));
- save_values();
+ save_values();
}
-
+
// compile stylesheets: begin
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
define('APPLICATION_CLASS', 'MyApplication');
include_once(FULL_PATH.'/kernel/kernel4/startup.php');
$application =& kApplication::Instance();
$application->Init();
-
-
+
+
$css_hash = $application->DB->GetCol('SELECT LOWER(Name) AS Name, StylesheetId FROM '.TABLE_PREFIX.'Stylesheets', 'StylesheetId');
-
+
$application->setUnitOption('css', 'AutoLoad', false);
$css_table = $application->getUnitOption('css','TableName');
$css_idfield = $application->getUnitOption('css','IDField');
$theme_table = $application->getUnitOption('theme', 'TableName');
$theme_idfield = $application->getUnitOption('theme', 'IDField');
-
+
$theme_update_sql = 'UPDATE '.$theme_table.' SET '.$css_idfield.' = %s WHERE LOWER(Name) = %s';
foreach($css_hash as $stylesheet_id => $theme_name)
{
@@ -701,10 +701,10 @@
}
$application->Done();
// compile stylesheets: end
-
- $state = 'languagepack_upgrade';
-}
+ $state = 'languagepack_upgrade';
+}
+
// upgrade language pack
if($state=='languagepack_upgrade')
{
@@ -728,7 +728,7 @@
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '".$value."' WHERE VariableName = '".$key."'";
$ado->Execute($sql);
}
-
+
$state = "finish";
}
@@ -740,7 +740,7 @@
{
foreach($section as $key => $value)
{
- $key = "g_".str_replace("-", "", $key);
+ $key = "g_".str_replace("-", "", $key);
global $$key;
$$key = $value;
}
@@ -752,7 +752,7 @@
if($state=="db_reconfig")
{
- $include_file = $pathtoroot.$admin."/install/db_reconfig.php";
+ $include_file = $pathtoroot.$admin."/install/db_reconfig.php";
}
if($state=="restore_file")
@@ -763,26 +763,26 @@
$state="restore_select";
}
else
- {
+ {
$filepath = stripslashes($_POST['backupdir']);
$backupfile = $filepath.$path_char.str_replace('(.*)', $_POST['backupdate'], BACKUP_NAME);
-
+
if(file_exists($backupfile) && is_readable($backupfile))
{
$ado =& inst_GetADODBConnection();
- $show_warning = false;
-
+ $show_warning = false;
+
if (!$_POST['warning_ok']) {
// Here we comapre versions between backup and config
$file_contents = file_get_contents($backupfile);
-
+
$file_tmp_cont = explode("#------------------------------------------", $file_contents);
$tmp_vers = $file_tmp_cont[0];
-
- $vers_arr = explode(";", $tmp_vers);
+
+ $vers_arr = explode(";", $tmp_vers);
$ini_values = inst_parse_portal_ini($ini_file);
-
+
foreach ($ini_values as $key => $value) {
foreach ($vers_arr as $k) {
if (strstr($k, $key)) {
@@ -794,10 +794,10 @@
}
//$show_warning = true;
}
-
+
if (!$show_warning) {
- $filename = $pathtoroot.$admin.$path_char.'install'.$path_char.'inportal_remove.sql';
- RunSchemaFile($ado,$filename);
+ $filename = $pathtoroot.$admin.$path_char.'install'.$path_char.'inportal_remove.sql';
+ RunSchemaFile($ado,$filename);
$state="restore_run";
}
else {
@@ -808,12 +808,12 @@
else {
if ($_POST['backupdate'] != '') {
$include_file = $pathtoroot.$admin."/install/restore_select.php";
- $restore_error = "$backupfile not found or could not be read";
+ $restore_error = "$backupfile not found or could not be read";
}
else {
$include_file = $pathtoroot.$admin."/install/restore_select.php";
- $restore_error = "No backup selected!!!";
- }
+ $restore_error = "No backup selected!!!";
+ }
}
}
//echo $restore_error;
@@ -822,7 +822,7 @@
if($state=="restore_select")
{
if( isset($_POST['backupdir']) ) $filepath = stripslashes($_POST['backupdir']);
- $include_file = $pathtoroot.$admin."/install/restore_select.php";
+ $include_file = $pathtoroot.$admin."/install/restore_select.php";
}
if($state=="restore_run")
@@ -831,8 +831,8 @@
$FileOffset = (int)$_GET["Offset"];
if(!strlen($backupfile))
$backupfile = SuperStrip($_GET['File'], true);
-
- $include_file = $pathtoroot.$admin."/install/restore_run.php";
+
+ $include_file = $pathtoroot.$admin."/install/restore_run.php";
}
if($state=="db_config_save")
@@ -842,7 +842,7 @@
set_ini_value("Database", "DBName",$_POST["ServerDB"]);
set_ini_value("Database", "DBUser",$_POST["ServerUser"]);
set_ini_value("Database", "DBUserPassword",$_POST["ServerPass"]);
- set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]);
+ set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]);
save_values();
$ini_vars = inst_parse_portal_ini($ini_file,TRUE);
@@ -851,7 +851,7 @@
{
foreach($section as $key => $value)
{
- $key = "g_".str_replace("-", "", $key);
+ $key = "g_".str_replace("-", "", $key);
global $$key;
$$key = $value;
}
@@ -870,18 +870,18 @@
if ($state == "download_license") {
$ValidLicense = FALSE;
-
+
$lic_login = isset($_POST['login']) ? $_POST['login'] : '';
$lic_password = isset($_POST['password']) ? $_POST['password'] : '';
-
+
if ($lic_login != '' && $lic_password != '') {
// Here we determine weather login is ok & check available licenses
-
+
$rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['login'])."&password=".md5($_POST['password'])."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_SERVER['HTTP_HOST']), "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
$state = "get_license";
- $include_file = $pathtoroot.$admin."/install/get_license.php";
+ $include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
$rcontents = '';
@@ -890,11 +890,11 @@
$rcontents .= $line;
}
@fclose($rfile);
-
+
if (substr($rcontents, 0, 5) == 'Error') {
$get_license_error = substr($rcontents, 6);
$state = "get_license";
- $include_file = $pathtoroot.$admin."/install/get_license.php";
+ $include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
if (substr($rcontents, 0, 3) == "SEL") {
@@ -905,42 +905,42 @@
else {
// Here we get one license
$tmp_data = explode('Code==:', $rcontents);
-
- $data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $tmp_data[0]));
+
+ $data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $tmp_data[0]));
a83570933e44bc66b31dd7127cf3f23a($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
- set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
+ set_ini_value("Intechnic","LicenseCode",$tmp_data[1]);
save_values();
$state="domain_select";
$got_license = 1;
}
else {
- $license_error="Invalid License File";
+ $license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
- }
- }
+ }
+ }
}
}
-
+
}
else if ($_POST['licenses'] == '') {
$state = "get_license";
$get_license_error = "Username and / or password not specified!!!";
$include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
- // Here we download license
+ // Here we download license
$rfile = @fopen(GET_LICENSE_URL."?license_id=".md5($_POST['licenses'])."&dlog=".md5($_POST['dlog'])."&dpass=".md5($_POST['dpass'])."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".base64_encode($_POST['domain']), "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
$state = "get_license";
- $include_file = $pathtoroot.$admin."/install/get_license.php";
+ $include_file = $pathtoroot.$admin."/install/get_license.php";
}
else {
$rcontents = '';
@@ -949,16 +949,16 @@
$rcontents .= $line;
}
@fclose($rfile);
-
+
if (substr($rcontents, 0, 5) == 'Error') {
$download_license_error = substr($rcontents, 6);
$state = "download_license";
- $include_file = $pathtoroot.$admin."/install/download_license.php";
+ $include_file = $pathtoroot.$admin."/install/download_license.php";
}
else {
$tmp_data = explode('Code==:', $rcontents);
-
- $data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $tmp_data[0]));
+
+ $data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $tmp_data[0]));
a83570933e44bc66b31dd7127cf3f23a($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
@@ -970,20 +970,20 @@
$state="domain_select";
}
else {
- $license_error="Invalid License File";
+ $license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
- }
- }
+ }
+ }
}
}
}
if($state=="license_process")
{
- $ValidLicense = FALSE;
+ $ValidLicense = FALSE;
$tmp_lic_opt = GetVar('lic_opt', true);
switch($tmp_lic_opt)
{
@@ -995,7 +995,7 @@
// $state="license";
//}
break;
- case 2: /* upload file */
+ case 2: /* upload file */
$file = $_FILES["licfile"];
if(is_array($file))
{
@@ -1007,11 +1007,11 @@
{
$lic = fread($fp,filesize($pathtoroot."themes/tmp.lic"));
fclose($fp);
- }
-
- $tmp_data = ae666b1b8279502f4c4b570f133d513e(FALSE,$pathtoroot."themes/tmp.lic");
+ }
+
+ $tmp_data = ae666b1b8279502f4c4b570f133d513e(FALSE,$pathtoroot."themes/tmp.lic");
$data = $tmp_data[0];
-
+
@unlink($pathtoroot."themes/tmp.lic");
a83570933e44bc66b31dd7127cf3f23a($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
@@ -1037,7 +1037,7 @@
a83570933e44bc66b31dd7127cf3f23a($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
- {
+ {
$state="domain_select";
}
else
@@ -1048,7 +1048,7 @@
}
else
{
- $state="license";
+ $state="license";
$license_error="Missing License File";
}
if(!$ValidLicense)
@@ -1059,7 +1059,7 @@
case 4:
//set_ini_value("Intechnic","License",base64_encode("local"));
//set_ini_value("Intechnic","LicenseCode",base64_encode("local"));
- //save_values();
+ //save_values();
$state="domain_select";
break;
}
@@ -1069,75 +1069,75 @@
if($state=="license")
{
- $include_file = $pathtoroot.$admin."/install/sel_license.php";
+ $include_file = $pathtoroot.$admin."/install/sel_license.php";
}
if($state=="reinstall")
{
$ado =& inst_GetADODBConnection();
-
+
$show_upgrade = false;
$sql = "SELECT Name FROM ".$g_TablePrefix."Modules";
$rs = $ado->Execute($sql);
-
+
$modules = '';
while ($rs && !$rs->EOF) {
$modules .= strtolower($rs->fields['Name']).',';
$rs->MoveNext();
}
-
+
$mod_arr = explode(",", substr($modules, 0, strlen($modules) - 1));
-
+
foreach($mod_arr as $p)
- {
+ {
if ($p == 'in-portal') {
$p = '';
- }
-
+ }
+
$dir_name = $pathtoroot.$p."/admin/install/upgrades/";
-
- $dir = @dir($dir_name);
+
+ $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))
- {
-
+ {
+
if (strstr($file, 'inportal_upgrade_v')) {
$file = str_replace("inportal_upgrade_v", "", $file);
- $file = str_replace(".sql", "", $file);
+ $file = str_replace(".sql", "", $file);
if ($p == '') {
$p = 'in-portal';
}
$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '".$p."'";
$rs = $ado->Execute($sql);
-
+
if (ConvertVersion($rs->fields['Version']) < ConvertVersion($file)) {
$show_upgrade = true;
}
}
}
- }
+ }
}
-
+
if ( !isset($install_type) || $install_type == '') {
$install_type = 2;
- }
-
+ }
+
$include_file = $pathtoroot.$admin."/install/reinstall.php";
}
if($state=="login")
-{
+{
$lic = base64_decode($g_License);
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
- $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
+ $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
if(!$ValidLicense)
@@ -1150,11 +1150,11 @@
$state = "domain_select";
}
else
- {
+ {
$state="getuser";
$login_error = "Invalid User Name or Password. If you don't know your username or password, contact Intechnic Support";
}
-
+
//die();
}
@@ -1171,14 +1171,14 @@
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
- $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
+ $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
}
-
+
if($_POST["domain"]==1)
{
$domain = $_SERVER['HTTP_HOST'];
-
+
if (strstr($domain, $i_Keys[0]['domain']) || de3ec1b7a142cccd0d51f03d24280744($domain)) {
set_ini_value("Intechnic","Domain",$domain);
save_values();
@@ -1187,7 +1187,7 @@
else {
$DomainError = 'Domain name selected does not match domain name in the license!';
$state = "domain_select";
- }
+ }
}
else
{
@@ -1201,7 +1201,7 @@
else {
$DomainError = 'Domain name entered does not match domain name in the license!';
$state = "domain_select";
- }
+ }
}
else {
$DomainError = 'Please enter valid domain!';
@@ -1218,43 +1218,43 @@
if(strlen($lic))
{
a83570933e44bc66b31dd7127cf3f23a($lic);
- $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
+ $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
}
-
+
$include_file = $pathtoroot.$admin."/install/domain.php";
}
if($state=="runsql")
-{
+{
$ado =& inst_GetADODBConnection();
$installed = TableExists($ado,"ConfigurationAdmin,Category,Permissions");
if(!$installed)
- {
+ {
// create tables
$filename = $pathtoroot.$admin."/install/inportal_schema.sql";
RunSchemaFile($ado,$filename);
-
+
// insert default info
$filename = $pathtoroot.$admin."/install/inportal_data.sql";
RunSQLFile($ado,$filename);
-
+
$sql = 'UPDATE '.$g_TablePrefix.'ConfigurationValues SET VariableValue = %s WHERE VariableName = %s';
$ado->Execute( sprintf($sql, $ado->qstr('portal@'.$ini_vars['Intechnic']['Domain']), $ado->qstr('Smtp_AdminMailFrom') ) );
-
+
$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = 'In-Portal'";
$rs = $ado->Execute($sql);
-
+
set_ini_value("Module Versions", "In-Portal", $rs->fields['Version']);
save_values();
-
+
require_once $pathtoroot.'kernel/include/tag-class.php';
if( !is_object($objTagList) ) $objTagList = new clsTagList();
-
+
// install kernel specific tags
$objTagList->DeleteTags(); // delete all existing tags in db
-
+
// create 3 predifined tags (because there no functions with such names
$t = new clsTagFunction();
$t->Set("name","include");
@@ -1263,23 +1263,23 @@
$t->AddAttribute("_template","tpl","Template to insert","",TRUE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
- $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
+ $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
unset($t);
-
+
$t = new clsTagFunction();
$t->Set("name","perm_include");
$t->Set("description","insert template output into the current template if permissions are set");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert","",TRUE);
$t->AddAttribute("_noaccess","tpl","Template to insert if access is denied","",FALSE);
$t->AddAttribute("_permission","","Comma-separated list of permissions, any of which will grant access","",FALSE);
- $t->AddAttribute("_module","","Used in place of the _permission attribute, this attribute verifies the module listed is enabled","",FALSE);
- $t->AddAttribute("_system","bool","Must be set to true if any permissions in _permission list is a system permission","",FALSE);
+ $t->AddAttribute("_module","","Used in place of the _permission attribute, this attribute verifies the module listed is enabled","",FALSE);
+ $t->AddAttribute("_system","bool","Must be set to true if any permissions in _permission list is a system permission","",FALSE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
- $t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
- $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
+ $t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
+ $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
unset($t);
-
+
$t = new clsTagFunction();
$t->Set("name","mod_include");
$t->Set("description","insert templates from all enabled modules. No error occurs if the template does not exist.");
@@ -1288,14 +1288,14 @@
$t->AddAttribute("_modules","","Comma-separated list of modules. Defaults to all enabled modules if not set","",FALSE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
- $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
-
+ $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
+
$objTagList->ParseFile($pathtoroot.'kernel/parser.php'); // insert module tags
-
+
if( is_array($ItemTagFiles) )
foreach($ItemTagFiles as $file)
$objTagList->ParseItemFile($pathtoroot.$file);
-
+
$state="RootPass";
}
else {
@@ -1307,10 +1307,10 @@
if ($state == "finish") {
$ado =& inst_GetADODBConnection();
$PhraseTable = $g_TablePrefix."ImportPhrases";
- $EventTable = $g_TablePrefix."ImportEvents";
+ $EventTable = $g_TablePrefix."ImportEvents";
$ado->Execute("DROP TABLE IF EXISTS $PhraseTable");
- $ado->Execute("DROP TABLE IF EXISTS $EventTable");
-
+ $ado->Execute("DROP TABLE IF EXISTS $EventTable");
+
$include_file = $pathtoroot.$admin."/install/install_finish.php";
}
@@ -1327,7 +1327,7 @@
$PassError = "Passwords does not match";
$state = "RootPass";
}
- else
+ else
{
$pass = md5($pass);
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$pass' WHERE VariableName='RootPass' OR VariableName='RootPassVerify'";
@@ -1344,54 +1344,54 @@
if($state=="lang_install_init")
{
-
+
$ado =& inst_GetADODBConnection();
-
+
if( TableExists($ado, 'Language,Phrase') )
{
// KERNEL 4 INIT: BEGIN
define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
define('APPLICATION_CLASS', 'MyApplication');
define('ADMINS_LIST','/in-portal/users/users.php');
include_once(FULL_PATH.'/kernel/kernel4/startup.php');
-
+
$application =& kApplication::Instance();
$application->Init();
// KERNEL 4 INIT: END
-
+
$lang_xml =& $application->recallObject('LangXML');
-
+
$lang_xml->renameTable('phrases', TABLE_PREFIX.'ImportPhrases');
$lang_xml->renameTable('emailmessages', TABLE_PREFIX.'ImportEvents');
-
+
$lang_xml->lang_object->TableName = $application->getUnitOption('lang','TableName');
-
+
$languages = $application->GetVar('lang');
if($languages)
{
$kernel_db =& $application->GetADODBConnection();
$modules_table = $application->getUnitOption('mod','TableName');
-
+
$modules = $kernel_db->GetCol('SELECT Path, Name FROM '.$modules_table, 'Name');
$modules['In-Portal'] = '';
-
+
foreach($languages as $lang_file)
{
foreach($modules as $module_name => $module_folder)
{
- $lang_path = DOC_ROOT.BASE_PATH.'/'.$module_folder.ADMIN_DIR.'/install/langpacks';
+ $lang_path = MODULES_PATH.'/'.$module_folder.ADMIN_DIR.'/install/langpacks';
$lang_xml->Parse($lang_path.'/'.$lang_file, Array(0,1,2), '');
if($force_finish) $lang_xml->lang_object->Update();
}
}
-
+
$state = 'lang_install';
}
else
{
$state = 'lang_select';
}
-
+
$application->Done();
}
else
@@ -1410,7 +1410,7 @@
$EventTable = $g_TablePrefix."ImportEvents";
$Total = TableCount($Status == 0 ? $PhraseTable : $EventTable, '', 0);
-
+
if($Status == 0)
{
$Offset = $objLanguages->ReadImportTable($PhraseTable, 1,"0,1,2", $force_finish ? false : true, 200,$Offset);
@@ -1449,7 +1449,7 @@
$prefix = $g_TablePrefix;
$db->Execute('DROP TABLE IF EXISTS '.$PhraseTable);
$db->Execute('DROP TABLE IF EXISTS '.$EventTable);
-
+
if(!$force_finish)
{
$state = 'lang_default';
@@ -1469,27 +1469,27 @@
// phpinfo(INFO_VARIABLES);
/*$ado =& inst_GetADODBConnection();
$PhraseTable = GetTablePrefix()."ImportPhrases";
- $EventTable = GetTablePrefix()."ImportEvents";
+ $EventTable = GetTablePrefix()."ImportEvents";
$ado->Execute("DROP TABLE IF EXISTS $PhraseTable");
$ado->Execute("DROP TABLE IF EXISTS $EventTable");*/
-
+
$Id = $_POST["lang"];
-
+
$objLanguages->SetPrimary($Id);
- $state="postconfig_1";
+ $state="postconfig_1";
}
if($state=="lang_default")
{
$Packs = Array();
$objLanguages->Clear();
-
+
$objLanguages->LoadAllLanguages();
foreach($objLanguages->Items as $l)
{
$Packs[$l->Get("LanguageId")] = $l->Get("PackName");
}
- $include_file = $pathtoroot.$admin."/install/lang_default.php";
+ $include_file = $pathtoroot.$admin."/install/lang_default.php";
}
@@ -1510,53 +1510,53 @@
include($filename);
}
}
-
+
}
-
+
/* $sql = "SELECT Name FROM ".GetTablePrefix()."Modules";
$rs = $ado->Execute($sql);
-
+
while($rs && !$rs->EOF)
{
$p = $rs->fields['Name'];
$mod_name = strtolower($p);
-
+
if ($mod_name == 'in-portal') {
$mod_name = '';
}
-
+
$dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/";
- $dir = @dir($dir_name);
-
+ $dir = @dir($dir_name);
+
$new_version = '';
$tmp1 = 0;
$tmp2 = 0;
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
- {
+ {
$file = str_replace("inportal_upgrade_v", "", $file);
$file = str_replace(".sql", "", $file);
-
+
if ($file != '' && !strstr($file, 'changelog') && !strstr($file, 'readme')) {
- $tmp1 = str_replace(".", "", $file);
+ $tmp1 = str_replace(".", "", $file);
if ($tmp1 > $tmp2) {
$new_version = $file;
}
}
}
$tmp2 = $tmp1;
}
-
-
+
+
$version_nrs = explode(".", $new_version);
-
+
for ($i = 0; $i < $version_nrs[0] + 1; $i++) {
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);
@@ -1566,10 +1566,10 @@
}
}
}
-
+
$rs->MoveNext();
- }
-*/
+ }
+*/
$state="lang_select";
}
@@ -1598,8 +1598,8 @@
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '".$_SERVER['DOCUMENT_ROOT'].$sitepath."admin/backupdata' WHERE VariableName='Backup_Path'";
$ado->Execute($sql);
$Modules = a48d819089308a9aeb447e7248b2587f();
-
- if (count($Modules) > 0) {
+
+ if (count($Modules) > 0) {
$include_file = $pathtoroot.$admin."/install/modselect.php";
}
else {
@@ -1618,41 +1618,41 @@
{
$p = explode("_",$state);
$step = $p[1];
-
+
if ($_POST['Site_Path'] != '') {
- $sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules";
- $rs = $ado->Execute($sql);
-
- $modules_str = '';
- while ($rs && !$rs->EOF) {
- $modules_str .= $rs->fields['Name'].' ('.$rs->fields['Version'].'),';
- $rs->MoveNext();
- }
+ $sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules";
+ $rs = $ado->Execute($sql);
- $modules_str = substr($modules_str, 0, strlen($modules_str) - 1);
+ $modules_str = '';
+ while ($rs && !$rs->EOF) {
+ $modules_str .= $rs->fields['Name'].' ('.$rs->fields['Version'].'),';
+ $rs->MoveNext();
+ }
+
+ $modules_str = substr($modules_str, 0, strlen($modules_str) - 1);
$rfile = @fopen(GET_LICENSE_URL."?url=".base64_encode($_SERVER['HTTP_HOST'].$_POST['Site_Path'])."&modules=".base64_encode($modules_str)."&license_code=".base64_encode($g_LicenseCode)."&version=".GetMaxPortalVersion($pathtoroot.$admin)."&domain=".md5($_SERVER['HTTP_HOST']), "r");
if (!$rfile) {
//$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
//$state = "postconfig_1";
- //$include_file = $pathtoroot.$admin."/install/postconfig.php";
+ //$include_file = $pathtoroot.$admin."/install/postconfig.php";
}
- else {
+ else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
}
-
- }
+ }
+
if(strlen($_POST["oldstate"])>0)
{
$s = explode("_",$_POST["oldstate"]);
$oldstep = $s[1];
if($oldstep
To removing your existing database and start with a fresh installation, select the first option "; $help .= "provided. Note that this operation cannot be undone and no backups are made! Use at your own risk.
"; $help .="If you wish to scrap your current installation and install to a new location, choose the second option. "; @@ -1760,7 +1760,7 @@ $title="Select Licensed Domain"; $help ="
Select the domain you wish to configure In-Portal for. The Other option "; $help.=" can be used to configure In-Portal for use on a local domain.
"; - $help.="For local domains, enter the hostname or LAN IP Address of the machine running In-Portal.
"; + $help.="For local domains, enter the hostname or LAN IP Address of the machine running In-Portal.
"; break; case "db_reconfig": case "dbinfo": @@ -1865,7 +1865,7 @@ $title = ''; $help = ''; $filename = $pathtoroot.$admin."/install/inportal_remove.sql"; - RunSQLFile($ado,$filename); + RunSQLFile($ado,$filename); $general_error = 'Unexpected installation error!"; Index: trunk/kernel/units/languages/languages_tag_processor.php =================================================================== diff -u -N -r1845 -r2604 --- trunk/kernel/units/languages/languages_tag_processor.php (.../languages_tag_processor.php) (revision 1845) +++ trunk/kernel/units/languages/languages_tag_processor.php (.../languages_tag_processor.php) (revision 2604) @@ -47,11 +47,11 @@ { $admin_folder = $this->Application->ConfigValue('AdminDirectory'); if(!$admin_folder) $admin_folder = 'admin'; - $ret = DOC_ROOT.BASE_PATH.'/'.$admin_folder.'/export/'; + $ret = FULL_PATH.'/'.$admin_folder.'/export/'; if( getArrayValue($params,'as_url') ) { - $ret = str_replace( DOC_ROOT.BASE_PATH.'/', $this->Application->BaseURL(), $ret); + $ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret); } return $ret; } Index: trunk/core/kernel/application.php =================================================================== diff -u -N -r2600 -r2604 --- trunk/core/kernel/application.php (.../application.php) (revision 2600) +++ trunk/core/kernel/application.php (.../application.php) (revision 2604) @@ -290,7 +290,7 @@ $this->registerClass('kCurrencyRates',MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php'); } - $this->registerClass('FCKeditor', DOC_ROOT.BASE_PATH.'/admin/editor/cmseditor/fckeditor.php'); // need this? + $this->registerClass('FCKeditor', FULL_PATH.'/admin/editor/cmseditor/fckeditor.php'); // need this? } /** @@ -318,7 +318,7 @@ $unit_config_reader =& $this->recallObject('kUnitConfigReader'); foreach($unit_config_reader->modules_installed as $module_path) { - $contants_file = DOC_ROOT.BASE_PATH.$module_path.'constants.php'; + $contants_file = FULL_PATH.$module_path.'constants.php'; if( file_exists($contants_file) ) k4_include_once($contants_file); } } @@ -1168,7 +1168,7 @@ { if( defined('SILENT_LOG') && SILENT_LOG ) { - $fp = fopen(DOC_ROOT.BASE_PATH.'/silent_log.txt','a'); + $fp = fopen(FULL_PATH.'/silent_log.txt','a'); $time = date('d/m/Y H:i:s'); fwrite($fp, '['.$time.'] #'.$errno.': '.strip_tags($errstr).' in ['.$errfile.'] on line '.$errline."\n"); fclose($fp); Index: trunk/core/kernel/globals.php =================================================================== diff -u -N -r2592 -r2604 --- trunk/core/kernel/globals.php (.../globals.php) (revision 2592) +++ trunk/core/kernel/globals.php (.../globals.php) (revision 2604) @@ -198,7 +198,7 @@ $used_mem = memory_get_usage() - $before_mem; $debugger->IncludeLevel--; - $debugger->IncludesData['file'][] = str_replace(DOC_ROOT.BASE_PATH, '', $file); + $debugger->IncludesData['file'][] = str_replace(FULL_PATH, '', $file); $debugger->IncludesData['mem'][] = $used_mem; $debugger->IncludesData['time'][] = $used_time; $debugger->IncludesData['level'][] = $debugger->IncludeLevel; Index: trunk/core/units/languages/languages_tag_processor.php =================================================================== diff -u -N -r1845 -r2604 --- trunk/core/units/languages/languages_tag_processor.php (.../languages_tag_processor.php) (revision 1845) +++ trunk/core/units/languages/languages_tag_processor.php (.../languages_tag_processor.php) (revision 2604) @@ -47,11 +47,11 @@ { $admin_folder = $this->Application->ConfigValue('AdminDirectory'); if(!$admin_folder) $admin_folder = 'admin'; - $ret = DOC_ROOT.BASE_PATH.'/'.$admin_folder.'/export/'; + $ret = FULL_PATH.'/'.$admin_folder.'/export/'; if( getArrayValue($params,'as_url') ) { - $ret = str_replace( DOC_ROOT.BASE_PATH.'/', $this->Application->BaseURL(), $ret); + $ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret); } return $ret; } Index: trunk/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -N -r2600 -r2604 --- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 2600) +++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 2604) @@ -92,11 +92,11 @@ $debugger->IncludeLevel++; $before_time = getmicrotime(); $before_mem = memory_get_usage(); - include_once(DOC_ROOT.BASE_PATH.$file); + include_once(FULL_PATH.$file); $used_time = getmicrotime() - $before_time; $used_mem = memory_get_usage() - $before_mem; $debugger->IncludeLevel--; - $debugger->IncludesData['file'][] = str_replace(DOC_ROOT.BASE_PATH, '', $file); + $debugger->IncludesData['file'][] = str_replace(FULL_PATH, '', $file); $debugger->IncludesData['mem'][] = $used_mem; $debugger->IncludesData['time'][] = $used_time; $debugger->IncludesData['level'][] = -1; @@ -123,14 +123,14 @@ function findConfigFiles($folderPath) { - $folderPath = str_replace(DOC_ROOT.BASE_PATH, '', $folderPath); - $fh=opendir(DOC_ROOT.BASE_PATH.$folderPath); + $folderPath = str_replace(FULL_PATH, '', $folderPath); // this make sense, since $folderPath may NOT contain FULL_PATH + $fh=opendir(FULL_PATH.$folderPath); while(($sub_folder=readdir($fh))) { - $full_path=DOC_ROOT.BASE_PATH.$folderPath.'/'.$sub_folder; + $full_path=FULL_PATH.$folderPath.'/'.$sub_folder; if( $this->isDir($full_path)) { - if ( file_exists(DOC_ROOT.BASE_PATH.$this->getConfigName($folderPath.'/'.$sub_folder)) ) { + if ( file_exists(FULL_PATH.$this->getConfigName($folderPath.'/'.$sub_folder)) ) { $this->configFiles[] = $this->getConfigName($folderPath.'/'.$sub_folder); } $this->findConfigFiles($full_path); @@ -155,11 +155,11 @@ $debugger->IncludeLevel++; $before_time = getmicrotime(); $before_mem = memory_get_usage(); - if($config_found) include_once(DOC_ROOT.BASE_PATH.$filename); + if($config_found) include_once(FULL_PATH.$filename); $used_time = getmicrotime() - $before_time; $used_mem = memory_get_usage() - $before_mem; $debugger->IncludeLevel--; - $debugger->IncludesData['file'][] = str_replace(DOC_ROOT.BASE_PATH, '', $filename); + $debugger->IncludesData['file'][] = str_replace(FULL_PATH, '', $filename); $debugger->IncludesData['mem'][] = $used_mem; $debugger->IncludesData['time'][] = $used_time; $debugger->IncludesData['level'][] = -1; Index: trunk/kernel/units/help/help_tag_processor.php =================================================================== diff -u -N -r1938 -r2604 --- trunk/kernel/units/help/help_tag_processor.php (.../help_tag_processor.php) (revision 1938) +++ trunk/kernel/units/help/help_tag_processor.php (.../help_tag_processor.php) (revision 2604) @@ -61,7 +61,7 @@ $oFCKeditor->Value = $help_data; $oFCKeditor->Config = Array( - 'UserFilesPath' => DOC_ROOT.BASE_PATH.'kernel/user_files', + 'UserFilesPath' => FULL_PATH.'kernel/user_files', 'ProjectPath' => $this->Application->ConfigValue('Site_Path'), 'CustomConfigurationsPath' => rtrim( $this->Application->BaseURL('/'.ADMIN_DIR.'/editor/inp_fckconfig.js'), '/'), ); Index: trunk/core/units/help/help_tag_processor.php =================================================================== diff -u -N -r1938 -r2604 --- trunk/core/units/help/help_tag_processor.php (.../help_tag_processor.php) (revision 1938) +++ trunk/core/units/help/help_tag_processor.php (.../help_tag_processor.php) (revision 2604) @@ -61,7 +61,7 @@ $oFCKeditor->Value = $help_data; $oFCKeditor->Config = Array( - 'UserFilesPath' => DOC_ROOT.BASE_PATH.'kernel/user_files', + 'UserFilesPath' => FULL_PATH.'kernel/user_files', 'ProjectPath' => $this->Application->ConfigValue('Site_Path'), 'CustomConfigurationsPath' => rtrim( $this->Application->BaseURL('/'.ADMIN_DIR.'/editor/inp_fckconfig.js'), '/'), ); Index: trunk/core/kernel/utility/formatters.php =================================================================== diff -u -N -r2406 -r2604 --- trunk/core/kernel/utility/formatters.php (.../formatters.php) (revision 2406) +++ trunk/core/kernel/utility/formatters.php (.../formatters.php) (revision 2604) @@ -552,7 +552,7 @@ { if ($this->DestinationPath) { - $this->FullPath = DOC_ROOT.BASE_PATH.$this->DestinationPath; + $this->FullPath = FULL_PATH.$this->DestinationPath; } parent::kBase(); } @@ -567,7 +567,7 @@ if(getArrayValue($options, 'upload_dir')) { $this->DestinationPath = $options['upload_dir']; - $this->FullPath = DOC_ROOT.BASE_PATH.$this->DestinationPath; + $this->FullPath = FULL_PATH.$this->DestinationPath; } if (getArrayValue($value, 'upload') && getArrayValue($value, 'error') == UPLOAD_ERR_NO_FILE)