Skip to content

Commit

Permalink
Force default user before rendering login page (#4620)
Browse files Browse the repository at this point in the history
  • Loading branch information
aledeg authored Sep 18, 2022
1 parent 3d5b9ac commit 37cf233
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions app/Controllers/authController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,22 @@ public function loginAction() {
}

$auth_type = FreshRSS_Context::$system_conf->auth_type;
FreshRSS_Context::initUser('_');
switch ($auth_type) {
case 'form':
Minz_Request::forward(array('c' => 'auth', 'a' => 'formLogin'));
break;
case 'http_auth':
Minz_Error::error(403, array('error' => array(_t('feedback.access.denied'),
' [HTTP Remote-User=' . htmlspecialchars(httpAuthUser(), ENT_NOQUOTES, 'UTF-8') . ']'
)), false);
break;
case 'none':
// It should not happen!
Minz_Error::error(404);
default:
// TODO load plugin instead
Minz_Error::error(404);
case 'form':
Minz_Request::forward(array('c' => 'auth', 'a' => 'formLogin'));
break;
case 'http_auth':
Minz_Error::error(403, array('error' => array(_t('feedback.access.denied'),
' [HTTP Remote-User=' . htmlspecialchars(httpAuthUser(), ENT_NOQUOTES, 'UTF-8') . ']'
)), false);
break;
case 'none':
// It should not happen!
Minz_Error::error(404);
default:
// TODO load plugin instead
Minz_Error::error(404);
}
}

Expand Down

0 comments on commit 37cf233

Please sign in to comment.