Modernize Constants and use new constant for string 'currentUser' (#5089)

* Modernize Constants and use new constant 'currentUser'

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Update app/Controllers/userController.php

* Update app/Controllers/userController.php

* Update app/Controllers/userController.php

* Update app/Models/Auth.php

* Update p/api/greader.php

* Update p/api/greader.php

* Update p/api/greader.php

* Update app/Models/Context.php

* Update app/Models/LogDAO.php

* Update lib/Minz/Log.php

* Update p/api/greader.php

* Update app/layout/header.phtml

* Update app/views/helpers/export/articles.phtml

* Update cli/do-install.php

* Remarque's from Alkarex

* Remarque's from Alkarex

* Refactor using new Minz_User class

* Consistent naming of public constants

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
This commit is contained in:
Luc SANCHEZ
2023-03-26 14:17:22 +02:00
committed by GitHub
parent df24fa2207
commit 5f898dcc5e
27 changed files with 123 additions and 92 deletions

View File

@@ -72,7 +72,7 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
}
$auth_type = FreshRSS_Context::$system_conf->auth_type;
FreshRSS_Context::initUser('_', false);
FreshRSS_Context::initUser(Minz_User::INTERNAL_USER, false);
switch ($auth_type) {
case 'form':
Minz_Request::forward(array('c' => 'auth', 'a' => 'formLogin'));
@@ -145,7 +145,7 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
if ($ok) {
// Set session parameter to give access to the user.
Minz_Session::_params([
'currentUser' => $username,
Minz_User::CURRENT_USER => $username,
'passwordHash' => FreshRSS_Context::$user_conf->passwordHash,
'csrf' => false,
]);
@@ -195,7 +195,7 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
unset($password);
if ($ok) {
Minz_Session::_params([
'currentUser' => $username,
Minz_User::CURRENT_USER => $username,
'passwordHash' => $s,
'csrf' => false,
]);