From 5f898dcc5ee244e4adbd6aa83b607c844d432fb6 Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Sun, 26 Mar 2023 14:17:22 +0200 Subject: 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 Co-authored-by: Alexandre Alapetite --- lib/lib_rss.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 76e7b92cd..1babc8d63 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -547,7 +547,7 @@ function uTimeString(): string { function invalidateHttpCache(string $username = ''): bool { if (!FreshRSS_user_Controller::checkUsername($username)) { Minz_Session::_param('touch', uTimeString()); - $username = Minz_Session::param('currentUser', '_'); + $username = Minz_User::name() ?? Minz_User::INTERNAL_USER; } $ok = @touch(DATA_PATH . '/users/' . $username . '/' . LOG_FILENAME); //if (!$ok) { @@ -564,7 +564,7 @@ function listUsers(): array { $base_path = join_path(DATA_PATH, 'users'); $dir_list = array_values(array_diff( scandir($base_path) ?: [], - ['..', '.', '_'] + ['..', '.', Minz_User::INTERNAL_USER] )); foreach ($dir_list as $file) { if ($file[0] !== '.' && is_dir(join_path($base_path, $file)) && file_exists(join_path($base_path, $file, 'config.php'))) { -- cgit v1.2.3