mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-26 04:58:40 -04:00
Add a way to disable/enable users (#3056)
If you want to block users without deleting their account, you can now disable them from the interface.
This commit is contained in:
1 parent
6edbeaaf6a
commit
caeb660f29
28 files changed
+94
-19
No files matched your search
+1
-1
@@ -163,7 +163,7 @@ class FeverAPI
|
||||
$username = trim($username);
|
||||
Minz_Session::_param('currentUser', $username);
|
||||
$user_conf = get_user_configuration($username);
|
||||
if ($user_conf != null && $feverKey === $user_conf->feverKey) {
|
||||
if ($user_conf != null && $feverKey === $user_conf->feverKey && $user_conf->enabled) {
|
||||
FreshRSS_Context::$user_conf = $user_conf;
|
||||
Minz_Translate::init(FreshRSS_Context::$user_conf->language);
|
||||
$this->entryDAO = FreshRSS_Factory::createEntryDao();
|
||||
|
||||
@@ -157,6 +157,10 @@ function authorizationToUser() {
|
||||
Minz_Log::warning('Invalid API user ' . $user . ': configuration cannot be found.');
|
||||
unauthorized();
|
||||
}
|
||||
if (!FreshRSS_Context::$user_conf->enabled) {
|
||||
Minz_Log::warning('Invalid API user ' . $user . ': configuration cannot be found.');
|
||||
unauthorized();
|
||||
}
|
||||
if ($headerAuthX[1] === sha1(FreshRSS_Context::$system_conf->salt . $user . FreshRSS_Context::$user_conf->apiPasswordHash)) {
|
||||
return $user;
|
||||
} else {
|
||||
|
||||
@@ -140,6 +140,11 @@ foreach ($users as $userFilename) {
|
||||
Minz_Translate::reset(FreshRSS_Context::$user_conf->language);
|
||||
}
|
||||
|
||||
if (!FreshRSS_Context::$user_conf->enabled) {
|
||||
Minz_Log::warning('FreshRSS skip disabled user ' . $username);
|
||||
continue;
|
||||
}
|
||||
|
||||
list($updated_feeds, $feed, $nb_new_articles) = FreshRSS_feed_Controller::actualizeFeed(0, $self, false, $simplePie);
|
||||
if ($updated_feeds > 0 || $feed != false) {
|
||||
$nb++;
|
||||
|
||||
Reference in new issue
Block a user