Index: .htaccess =================================================================== --- .htaccess (revision 13377) +++ .htaccess (working copy) @@ -6,16 +6,10 @@ deny from all -# Exclude direct access - - order allow,deny - deny from all - - ## Enable mod-rewrite RewriteEngine On -###### Rewrite rule to force 'www.' prefix. Use only if needed +###### Rewrite rule to force 'www.' prefix. Use only if needed # If your site can be accessed both with and without the 'www.' prefix, # use the following setting to redirect all users to access the site with the 'www.' # when they access without 'www.'. Uncomment and MAKE sure to adapt for your domain name Index: core/install.php =================================================================== --- core/install.php (revision 13377) +++ core/install.php (working copy) @@ -113,7 +113,6 @@ '$1/stylesheets', '$1/user_files', '$1/cache', - '/themes', ); /** @@ -160,15 +159,12 @@ if (file_exists($this->toolkit->INIFile)) { // if config.php found, then check his write permission too - $this->writeableFolders[] = '/config.php'; + $this->writeableFolders[] = $this->toolkit->defaultWritablePath . '/config.php'; } - else { - $this->writeableFolders[] = '/'; - } if (!$this->toolkit->getSystemConfig('Misc', 'WriteablePath')) { // set global writable folder when such setting is missing - $this->toolkit->setSystemConfig('Misc', 'WriteablePath', DIRECTORY_SEPARATOR . 'system'); + $this->toolkit->setSystemConfig('Misc', 'WriteablePath', $this->toolkit->defaultWritablePath); $this->toolkit->SaveConfig(true); // immediately save, because this path will be used in Application later } @@ -389,7 +385,7 @@ } $write_check = true; - $check_paths = Array ('/', '/index.php', '/config.php', ADMIN_DIRECTORY . '/index.php'); + $check_paths = Array ('/', '/index.php', $this->toolkit->defaultWritablePath . '/config.php', ADMIN_DIRECTORY . '/index.php'); foreach ($check_paths as $check_path) { $path_check_status = $this->toolkit->checkWritePermissions(FULL_PATH . $check_path); Index: core/install/install_toolkit.php =================================================================== --- core/install/install_toolkit.php (revision 13377) +++ core/install/install_toolkit.php (working copy) @@ -75,6 +75,13 @@ var $systemConfig = Array (); /** + * Path, used by system to store data on filesystem + * + * @var string + */ + var $defaultWritablePath = ''; + + /** * Installator instance * * @var kInstallator @@ -83,13 +90,15 @@ function kInstallToolkit() { + $this->defaultWritablePath = DIRECTORY_SEPARATOR . 'system'; + if (class_exists('kApplication')) { // auto-setup in case of separate module install $this->Application =& kApplication::Instance(); $this->Conn =& $this->Application->GetADODBConnection(); } - $this->INIFile = FULL_PATH . DIRECTORY_SEPARATOR . 'config.php'; + $this->INIFile = FULL_PATH . $this->defaultWritablePath . DIRECTORY_SEPARATOR . 'config.php'; $this->systemConfig = $this->ParseConfig(true); } Index: core/install/step_templates/security.tpl =================================================================== --- core/install/step_templates/security.tpl (revision 13377) +++ core/install/step_templates/security.tpl (working copy) @@ -12,7 +12,7 @@ $output = ''; $write_check = true; - $check_paths = Array ('/', '/index.php', '/config.php', ADMIN_DIRECTORY . '/index.php'); + $check_paths = Array ('/', '/index.php', $this->toolkit->defaultWritablePath . '/config.php', ADMIN_DIRECTORY . '/index.php'); foreach ($check_paths as $check_path) { $path_secure = true; Index: core/install/steps_db.xml =================================================================== --- core/install/steps_db.xml (revision 13377) +++ core/install/steps_db.xml (working copy) @@ -74,9 +74,9 @@

In case if you see a Failure notice saying that In-Portal Installation cannot continue until all permissions are set correctly please continue reading below.

Permissions can be set by using FTP program or directly in shell running "chmod" command. Please refer to the following guide to learn how to set permissions using your FTP program. In case if you have access to shell in your account you can simply run fix_perms.sh files located in /tools folder or do

-    # chmod -R 777 ../system ../themes ../config.php

+    # chmod -R 777 ../system ../themes ../system/config.php

-

Security reasons you will be asked to change permissions back to 755 on /config.php file and root / folder of In-Portal on the last step of this installation process!

+

Security reasons you will be asked to change permissions back to 755 on /system/config.php file and root / folder of In-Portal on the last step of this installation process!

]]> Index: core/kernel/globals.php =================================================================== --- core/kernel/globals.php (revision 13377) +++ core/kernel/globals.php (working copy) @@ -131,12 +131,12 @@ if(!defined($const_name)) define($const_name,$const_value); } -if( !function_exists('parse_portal_ini') ) -{ - function parse_portal_ini($file, $parse_section = false) + function parse_portal_ini($parse_section = false) { - if (!file_exists($file)) return false; + $file = FULL_PATH . DIRECTORY_SEPARATOR . 'system' . DIRECTORY_SEPARATOR . 'config.php'; + if (!file_exists($file)) return false; + if( file_exists($file) && !is_readable($file) ) die('Could Not Open Ini File'); $contents = file($file); @@ -185,9 +185,7 @@ return $retval; } -} - if( !function_exists('getmicrotime') ) { function getmicrotime() Index: core/kernel/startup.php =================================================================== --- core/kernel/startup.php (revision 13377) +++ core/kernel/startup.php (working copy) @@ -29,7 +29,7 @@ include_once(KERNEL_PATH . '/utility/multibyte.php'); // emulating multi-byte php extension $globals_end = getmicrotime(); - $vars = parse_portal_ini(FULL_PATH . '/config.php'); + $vars = parse_portal_ini(); $admin_directory = isset($vars['AdminDirectory']) ? $vars['AdminDirectory'] : '/admin'; define('ADMIN_DIRECTORY', $admin_directory); @@ -113,8 +113,8 @@ define('SAFE_MODE', 1); } - if (file_exists(FULL_PATH . '/debug.php')) { - include_once(FULL_PATH . '/debug.php'); + if (file_exists(WRITEABLE . '/debug.php')) { + include_once(WRITEABLE . '/debug.php'); if (array_key_exists('DEBUG_MODE', $dbg_options) && $dbg_options['DEBUG_MODE']) { $debugger_start = getmicrotime(); include_once(KERNEL_PATH . '/utility/debugger.php'); Index: core/units/helpers/modules_helper.php =================================================================== --- core/units/helpers/modules_helper.php (revision 13377) +++ core/units/helpers/modules_helper.php (working copy) @@ -165,7 +165,7 @@ } $modules = Array(); - $vars = parse_portal_ini(FULL_PATH . DIRECTORY_SEPARATOR . 'config.php'); + $vars = parse_portal_ini(); $license = array_key_exists('License', $vars) ? base64_decode($vars['License']) : false; if ($license) { list ( , , $i_Keys) = $this->_ParseLicense($license); Index: INSTALL =================================================================== --- INSTALL (revision 13377) +++ INSTALL (working copy) @@ -222,14 +222,14 @@ will guide you through the rest of the installation. -Once installation completed you should have /config.php file +Once installation completed you should have /system/config.php file created in the root folder of your In-Portal installation. In some rare cases servers might be configured the way when -WEB INSTALLATION fails to create /config.php. In this case +WEB INSTALLATION fails to create /system/config.php. In this case and you'll have to manually - a. copy /tools/config.php-dist file into the root folder + a. copy /tools/config.php-dist file into the /system subfolder of your In-Portal installation. b. rename it from config.php-dist to config.php. Make sure you Index: tools/fix_perms.sh =================================================================== --- tools/fix_perms.sh (revision 13377) +++ tools/fix_perms.sh (working copy) @@ -1,4 +1,4 @@ -touch ../config.php +touch ../system/config.php -chmod -R 777 ../system ../themes ../config.php +chmod -R 777 ../system