aboutsummaryrefslogtreecommitdiff
path: root/app/FreshRSS.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/FreshRSS.php')
-rw-r--r--app/FreshRSS.php33
1 files changed, 17 insertions, 16 deletions
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index 5bf0011d0..fe55427c0 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -24,10 +24,12 @@ class FreshRSS extends Minz_FrontController {
Minz_Session::init('FreshRSS');
}
- // Register the configuration setter for the system configuration
- $configuration_setter = new FreshRSS_ConfigurationSetter();
- $system_conf = Minz_Configuration::get('system');
- $system_conf->_configurationSetter($configuration_setter);
+ FreshRSS_Context::initSystem();
+ if (FreshRSS_Context::$system_conf == null) {
+ $message = 'Error during context system init!';
+ Minz_Error::error(500, [$message], false);
+ die($message);
+ }
// Load list of extensions and enable the "system" ones.
Minz_ExtensionManager::init();
@@ -35,26 +37,25 @@ class FreshRSS extends Minz_FrontController {
// Auth has to be initialized before using currentUser session parameter
// because it's this part which create this parameter.
self::initAuth();
+ if (FreshRSS_Context::$user_conf == null) {
+ FreshRSS_Context::initUser();
+ }
+ if (FreshRSS_Context::$user_conf == null) {
+ $message = 'Error during context user init!';
+ Minz_Error::error(500, [$message], false);
+ die($message);
+ }
- // Then, register the user configuration and use the configuration setter
- // created above.
- $current_user = Minz_Session::param('currentUser', '_');
- Minz_Configuration::register('user',
- join_path(USERS_PATH, $current_user, 'config.php'),
- join_path(FRESHRSS_PATH, 'config-user.default.php'),
- $configuration_setter);
-
- // Finish to initialize the other FreshRSS / Minz components.
- FreshRSS_Context::init();
+ // Complete initialization of the other FreshRSS / Minz components.
self::initI18n();
self::loadNotifications();
// Enable extensions for the current (logged) user.
- if (FreshRSS_Auth::hasAccess() || $system_conf->allow_anonymous) {
+ if (FreshRSS_Auth::hasAccess() || FreshRSS_Context::$system_conf->allow_anonymous) {
$ext_list = FreshRSS_Context::$user_conf->extensions_enabled;
Minz_ExtensionManager::enableByList($ext_list);
}
- if ($system_conf->force_email_validation && !FreshRSS_Auth::hasAccess('admin')) {
+ if (FreshRSS_Context::$system_conf->force_email_validation && !FreshRSS_Auth::hasAccess('admin')) {
self::checkEmailValidated();
}