diff options
| author | 2015-01-07 16:13:57 +0100 | |
|---|---|---|
| committer | 2015-01-07 16:13:57 +0100 | |
| commit | 4c128e05a4b1245525fd3eae7733e022ee805acd (patch) | |
| tree | 7ff96b0986603ceb3c8b19486dc4afda80a98914 /app/FreshRSS.php | |
| parent | 7f12058fab8a455cf33b5df614c5404f7a236d0a (diff) | |
Reorganize FreshRSS init
See https://github.com/FreshRSS/FreshRSS/issues/730
Diffstat (limited to 'app/FreshRSS.php')
| -rw-r--r-- | app/FreshRSS.php | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 254e35fee..4900528d3 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -6,15 +6,25 @@ class FreshRSS extends Minz_FrontController { Minz_Session::init('FreshRSS'); } + $this->initConfiguration(); + $this->initAuth(); + FreshRSS_Context::init(); + $this->initI18n(); + FreshRSS_Share::load(join_path(DATA_PATH, 'shares.php')); + $this->loadStylesAndScripts(); + $this->loadNotifications(); + $this->loadExtensions(); + } + + private function initConfiguration() { $current_user = Minz_Session::param('currentUser', '_'); Minz_Configuration::register('user', join_path(USERS_PATH, $current_user, 'config.php'), join_path(USERS_PATH, '_', 'config.default.php')); + } - // Need to be called just after session init because it initializes - // current user. + private function initAuth() { FreshRSS_Auth::init(); - if (Minz_Request::isPost() && !is_referer_from_same_domain()) { // Basic protection against XSRF attacks FreshRSS_Auth::removeAccess(); @@ -27,17 +37,6 @@ class FreshRSS extends Minz_FrontController { )) ); } - - // Load context and configuration. - FreshRSS_Context::init(); - - $this->initI18n(); - - FreshRSS_Share::load(join_path(DATA_PATH, 'shares.php')); - - $this->loadStylesAndScripts(); - $this->loadNotifications(); - $this->loadExtensions(); } private function initI18n() { |
