aboutsummaryrefslogtreecommitdiff
path: root/app/FreshRSS.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-01 17:01:09 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-01 17:01:09 +0100
commit67531f796f4c273cc9b078db788fdb51ece824ee (patch)
treed6e9971e2eae28896bdfa36856025e66d6735cf7 /app/FreshRSS.php
parenta08201c41486815de25c71f5497e939631ea68b4 (diff)
HTTP Auth : améliorations + changelog
* Affichage logo FreshRSS pendant la demande de nom d'utilisateur HTTP * Meilleure page d'erreur si utilisateur HTTP non-configuré dans FreshRSS + log Je recommande donc de placer le .htaccess pour le contrôle d'accès dans ./FreshRSS/p/i/.htaccess et pas plus haut pour une meilleure mise en cache et messages de connexion.
Diffstat (limited to 'app/FreshRSS.php')
-rw-r--r--app/FreshRSS.php23
1 files changed, 18 insertions, 5 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()) {