mirror of
https://github.com/slawkens/myaac.git
synced 2025-06-02 02:44:29 +02:00
Do not allow access to tools/ folder after install
This commit is contained in:
parent
149e10261b
commit
fcfe5b0dbd
@ -100,7 +100,7 @@ for($i = 1; $i < $size; $i++)
|
|||||||
$basedir = str_replace(array('/admin', '/install', '/tools'), '', $basedir);
|
$basedir = str_replace(array('/admin', '/install', '/tools'), '', $basedir);
|
||||||
define('BASE_DIR', $basedir);
|
define('BASE_DIR', $basedir);
|
||||||
|
|
||||||
if (file_exists(BASE . 'config.local.php') && !defined('MYAAC_INSTALL')) {
|
if (file_exists(BASE . 'config.local.php')) {
|
||||||
require BASE . 'config.local.php';
|
require BASE . 'config.local.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,9 +13,6 @@ require BASE . 'install/includes/functions.php';
|
|||||||
require BASE . 'install/includes/locale.php';
|
require BASE . 'install/includes/locale.php';
|
||||||
require SYSTEM . 'clients.conf.php';
|
require SYSTEM . 'clients.conf.php';
|
||||||
|
|
||||||
if(file_exists(BASE . 'config.local.php'))
|
|
||||||
require BASE . 'config.local.php';
|
|
||||||
|
|
||||||
// ignore undefined index from Twig autoloader
|
// ignore undefined index from Twig autoloader
|
||||||
$config['env'] = 'prod';
|
$config['env'] = 'prod';
|
||||||
|
|
||||||
|
@ -139,14 +139,5 @@ else {
|
|||||||
}
|
}
|
||||||
$_SESSION['installed'] = true;
|
$_SESSION['installed'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($_SESSION as $key => $value) {
|
|
||||||
if(strpos($key, 'var_') !== false)
|
|
||||||
unset($_SESSION[$key]);
|
|
||||||
}
|
|
||||||
unset($_SESSION['saved']);
|
|
||||||
if(file_exists(CACHE . 'install.txt')) {
|
|
||||||
unlink(CACHE . 'install.txt');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,11 @@ require SYSTEM . 'functions.php';
|
|||||||
require BASE . 'install/includes/functions.php';
|
require BASE . 'install/includes/functions.php';
|
||||||
require BASE . 'install/includes/locale.php';
|
require BASE . 'install/includes/locale.php';
|
||||||
|
|
||||||
|
if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) {
|
||||||
|
warning($locale['already_installed']);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
require BASE . 'install/includes/config.php';
|
require BASE . 'install/includes/config.php';
|
||||||
|
|
||||||
|
@ -97,8 +97,18 @@ require_once SYSTEM . 'migrations/22.php';
|
|||||||
require_once SYSTEM . 'migrations/27.php';
|
require_once SYSTEM . 'migrations/27.php';
|
||||||
require_once SYSTEM . 'migrations/30.php';
|
require_once SYSTEM . 'migrations/30.php';
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
foreach($_SESSION as $key => $value) {
|
||||||
|
if(strpos($key, 'var_') !== false)
|
||||||
|
unset($_SESSION[$key]);
|
||||||
|
}
|
||||||
|
unset($_SESSION['saved']);
|
||||||
|
if(file_exists(CACHE . 'install.txt')) {
|
||||||
|
unlink(CACHE . 'install.txt');
|
||||||
|
}
|
||||||
|
|
||||||
$locale['step_finish_desc'] = str_replace('$ADMIN_PANEL$', generateLink(str_replace('tools/', '',ADMIN_URL), $locale['step_finish_admin_panel'], true), $locale['step_finish_desc']);
|
$locale['step_finish_desc'] = str_replace('$ADMIN_PANEL$', generateLink(str_replace('tools/', '',ADMIN_URL), $locale['step_finish_admin_panel'], true), $locale['step_finish_desc']);
|
||||||
$locale['step_finish_desc'] = str_replace('$HOMEPAGE$', generateLink(str_replace('tools/', '', BASE_URL), $locale['step_finish_homepage'], true), $locale['step_finish_desc']);
|
$locale['step_finish_desc'] = str_replace('$HOMEPAGE$', generateLink(str_replace('tools/', '', BASE_URL), $locale['step_finish_homepage'], true), $locale['step_finish_desc']);
|
||||||
$locale['step_finish_desc'] = str_replace('$LINK$', generateLink('https://my-aac.org', 'https://my-aac.org', true), $locale['step_finish_desc']);
|
$locale['step_finish_desc'] = str_replace('$LINK$', generateLink('https://my-aac.org', 'https://my-aac.org', true), $locale['step_finish_desc']);
|
||||||
|
|
||||||
success($locale['step_finish_desc']);
|
success($locale['step_finish_desc']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user