Index: branches/RC/admin/index.php =================================================================== diff -u -r8929 -r10304 --- branches/RC/admin/index.php (.../index.php) (revision 8929) +++ branches/RC/admin/index.php (.../index.php) (revision 10304) @@ -1,42 +1,46 @@ Init(); -$application->Run(); -$application->Done(); + include_once(FULL_PATH.'/core/kernel/startup.php'); -$end = getmicrotime(); + if (DIRECTORY_SEPARATOR != '\\') { + // force user to remove write permissions for important files (Linux only) + if (check_write_permissions(FULL_PATH.'/config.php') || check_write_permissions(FULL_PATH)) { + die('Please remove write permissions from "config.php" file and root website folder.'); + } + } -function getmicrotime() -{ - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); -} + $application =& kApplication::Instance(); + $application->Init(); + $application->Run(); + $application->Done(); -//update_memory_check_script(); + $end = getmicrotime(); -function update_memory_check_script() { - $files = get_included_files(); - $script = '$files = Array('."\n"; - foreach ($files as $file_name) { - $script .= "\t\t'".str_replace(FULL_PATH, '', $file_name)."',\n"; + function getmicrotime() + { + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); } - $script .= ");\n"; - echo "
";
-	echo $script;
-	echo "
"; -} + //update_memory_check_script(); + + function update_memory_check_script() { + $files = get_included_files(); + $script = '$files = Array('."\n"; + foreach ($files as $file_name) { + $script .= "\t\t'".str_replace(FULL_PATH, '', $file_name)."',\n"; + } + $script .= ");\n"; + echo "
";
+		echo $script;
+		echo "
"; + } ?> \ No newline at end of file Index: branches/RC/admin/install/upgrades/inportal_upgrade_v4.3.0.php =================================================================== diff -u --- branches/RC/admin/install/upgrades/inportal_upgrade_v4.3.0.php (revision 0) +++ branches/RC/admin/install/upgrades/inportal_upgrade_v4.3.0.php (revision 10304) @@ -0,0 +1,11 @@ +ConfigValue('InstallFinished') === false) { + $fields_hash = Array ( + 'VariableName' => 'InstallFinished', + 'VariableValue' => 1, + ); + $application->Conn->doInsert($fields_hash, TABLE_PREFIX.'ConfigurationValues'); + } +?> \ No newline at end of file Index: branches/RC/core/kernel/utility/debugger.php =================================================================== diff -u -r10098 -r10304 --- branches/RC/core/kernel/utility/debugger.php (.../debugger.php) (revision 10098) +++ branches/RC/core/kernel/utility/debugger.php (.../debugger.php) (revision 10304) @@ -1156,7 +1156,8 @@ case 'PROFILE_T': // profile total $record_cell = ''; - $ret .= ''.$record_cell.$title.':'.$record_cell.''.sprintf('%.5f', $this->ProfilerTotals[$record_data]).' s'; + $total = array_key_exists($record_data, $this->ProfilerTotals) ? $this->ProfilerTotals[$record_data] : 0; + $ret .= ''.$record_cell.$title.':'.$record_cell.''.sprintf('%.5f', $total).' s'; break; case 'SEP': Index: branches/RC/admin/install.php =================================================================== diff -u -r10238 -r10304 --- branches/RC/admin/install.php (.../install.php) (revision 10238) +++ branches/RC/admin/install.php (.../install.php) (revision 10304) @@ -1493,7 +1493,7 @@ $ado =& inst_GetADODBConnection(); require_once $pathtoroot.'kernel/include/tag-class.php'; if( !isset($objTagList) || !is_object($objTagList) ) $objTagList = new clsTagList(); - + // TODO: make possible to define module install order (e.g. via special order file in module directory, because db info is not available before module is installed) $ebay_key = array_search('in-auction', $doms); if ($ebay_key !== false) { @@ -1720,6 +1720,14 @@ $ado->Execute("DROP TABLE IF EXISTS $EventTable"); $ado->Execute('INSERT INTO '.$g_TablePrefix.'Cache (VarName, Data) VALUES (\'ForcePermCacheUpdate\', \'1\')'); + if ($application->ConfigValue('InstallFinished') === false) { + $fields_hash = Array ( + 'VariableName' => 'InstallFinished', + 'VariableValue' => 1, + ); + $application->Conn->doInsert($fields_hash, TABLE_PREFIX.'ConfigurationValues'); + } + $include_file = $pathtoroot.$admin."/install/install_finish.php"; } Index: branches/RC/core/install.php =================================================================== diff -u -r10098 -r10304 --- branches/RC/core/install.php (.../install.php) (revision 10098) +++ branches/RC/core/install.php (.../install.php) (revision 10304) @@ -669,7 +669,12 @@ function AlreadyInstalled() { $table_prefix = $this->systemConfig['Database']['TablePrefix']; - return $this->TableExists('ConfigurationValues') && $this->Conn->GetOne('SELECT VariableValue FROM '.$table_prefix.'ConfigurationValues WHERE VariableName = \'InstallFinished\''); + + $sql = 'SELECT VariableValue + FROM '.$table_prefix.'ConfigurationValues + WHERE VariableName = "InstallFinished"'; + + return $this->TableExists('ConfigurationValues') && $this->Conn->GetOne($sql); } function CheckDatabase($check_installed = true) Index: branches/RC/core/kernel/globals.php =================================================================== diff -u -r10098 -r10304 --- branches/RC/core/kernel/globals.php (.../globals.php) (revision 10098) +++ branches/RC/core/kernel/globals.php (.../globals.php) (revision 10304) @@ -601,6 +601,18 @@ return $headers; } + /** + * Checks that file is writable by group or others + * + * @param string $file + * @return boolean + */ + function check_write_permissions($file) + { + $permissions = fileperms($file); + return $permissions & 0x0010 || $permissions & 0x0002; + } + if (!function_exists('easter_date')) { // calculates easter date, when calendar extension not installed in php // see also: http://php.prod.intechnic.lv/manual/en/function.easter-date.php