diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/FreshRSS.php | 23 | ||||
| -rw-r--r-- | app/Models/Configuration.php | 2 |
2 files changed, 19 insertions, 6 deletions
diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 0af0c01da..4ebb6d631 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -51,12 +51,25 @@ class FreshRSS extends Minz_FrontController { try { $this->conf = new FreshRSS_Configuration($currentUser); - } catch (Minz_Exception $e) { - Minz_Session::_param('currentUser', ''); - die('Invalid configuration for user [' . $currentUser . ']! ' . $e->getMessage()); //Permission denied or conf file does not exist + Minz_View::_param ('conf', $this->conf); + Minz_Session::_param('currentUser', $currentUser); + } catch (Minz_Exception $me) { + $loginOk = false; + try { + $this->conf = new FreshRSS_Configuration(Minz_Configuration::defaultUser()); + Minz_Session::_param('currentUser', Minz_Configuration::defaultUser()); + Minz_View::_param('conf', $this->conf); + $notif = array( + 'type' => 'bad', + 'content' => 'Invalid configuration for user [' . $currentUser . ']!', + ); + Minz_Session::_param ('notification', $notif); + Minz_Log::record ($notif['content'] . ' ' . $me->getMessage(), Minz_Log::WARNING); + Minz_Session::_param('currentUser', ''); + } catch (Exception $e) { + die($e->getMessage()); + } } - Minz_View::_param ('conf', $this->conf); - Minz_Session::_param('currentUser', $currentUser); if ($loginOk) { switch (Minz_Configuration::authType()) { diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index e0ae3bf6b..d44420f56 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -64,7 +64,7 @@ class FreshRSS_Configuration { public function __construct ($user) { $this->filename = DATA_PATH . '/' . $user . '_user.php'; - $data = include($this->filename); + $data = @include($this->filename); if (!is_array($data)) { throw new Minz_PermissionDeniedException($this->filename); } |
