[TikiWiki-commits] [Git][tikiwiki/tiki][master] [ENH] Admin Users: Add batch lock/unlock action for user accounts
"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <691c53c3cd056_2a1905dc85b5@gitlab-sidekiq-low-urgency-cpu-bound-v2-cf788b4bc-w86m6.mail> |
luci pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
cb835d2d by Elifeleti Mukisa Dan at 2025-11-18T10:59:59+00:00
[ENH] Admin Users: Add batch lock/unlock action for user accounts
---
* [NEW] Add bulk account lock/unlock feature for user management
* [NEW] Add global password invalidation feature for users
See merge request tikiwiki/tiki!8733
- - - - -
2 changed files:
- lib/core/Services/User/Controller.php
- templates/tiki-adminusers.tpl
Changes:
=====================================
lib/core/Services/User/Controller.php
=====================================
@@ -1305,15 +1305,45 @@ class Services_User_Controller
}
}
+ /**
+ * Admin user "perform with checked" action to lock selected users
+ *
+ * @param $input JitFilter
+ * @return array
+ * @throws Exception
+ * @throws Services_Exception
+ * @throws Services_Exception_Denied
+ */
+ public function actionLockUsers($input)
+ {
+ // Set the lock parameter and delegate to action_set_user_lock_status
+ $input['lock'] = 'lock';
+ return $this->action_set_user_lock_status($input);
+ }
+
+ /**
+ * Admin user "perform with checked" action to unlock selected users
+ *
+ * @param $input JitFilter
+ * @return array
+ * @throws Exception
+ * @throws Services_Exception
+ * @throws Services_Exception_Denied
+ */
+ public function actionUnlockUsers($input)
+ {
+ // Set the lock parameter and delegate to action_set_user_lock_status
+ $input['lock'] = 'unlock';
+ return $this->action_set_user_lock_status($input);
+ }
+
private function updateUserLockStatus($users, $newLockStatus)
{
global $user;
foreach ($users as $user_to_lock) {
if ($user_to_lock != 'admin') {
$res = $this->lib->update_user_lock_status($user_to_lock, $newLockStatus);
- if ($res === true) {
- Feedback::success(tr('User %0 lock status successfully updated', $user_to_lock));
- } else {
+ if ($res !== true) {
Feedback::error(tr('An error occurred. User %0 lock status could not be updated', $user_to_lock));
Services_Utilities::closeModal();
return false;
=====================================
templates/tiki-adminusers.tpl
=====================================
@@ -150,6 +150,9 @@
title="{$username}:{tr}Edit account settings{/tr}" {if $users[user].itemId}data-itemid="{$users[user].itemId}"{/if}>
{$users[user].user|escape}
</a>
+ {if $users[user].waiting eq 'l'}
+ {icon name='lock' title="|{tr}Locked account{/tr}" class='tips text-warning'}
+ {/if}
{if $prefs.user_show_realnames eq 'y' and $smarty.capture.username ne $users[user].user}
<div class="subcomment">
{$smarty.capture.username|escape}
@@ -182,6 +185,10 @@
<br>
{tr}Need to validate user{/tr}
{/if}
+ {if $users[user].waiting eq 'l'}
+ <br>
+ <span class="text-warning">{icon name="lock"} {tr}Account locked{/tr}</span>
+ {/if}
</td>
<td class="text">
{if $users[user].registrationDate}
@@ -360,6 +367,12 @@
<option value="default_groups">
{tr}Set default groups{/tr}
</option>
+ <option value="lock_users">
+ {tr}Lock accounts{/tr}
+ </option>
+ <option value="unlock_users">
+ {tr}Unlock accounts{/tr}
+ </option>
{if $prefs.feature_wiki == 'y'}
<option value="email_wikipage">
{tr}Send wiki page content by email{/tr}
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/cb835d2d47cac4cd7a1a0b71af9963a717a3b18d
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/cb835d2d47cac4cd7a1a0b71af9963a717a3b18d
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs