[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] [BP][ENH] Admin Users: Add batch lock/unlock action for user accounts

"Elifeleti Mukisa Dan \(@Danelif\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <691c6c4f4f0a0_2a89b37c103b1@gitlab-sidekiq-low-urgency-cpu-bound-v2-cf788b4bc-qfb7z.mail>

Elifeleti Mukisa Dan pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki


Commits:
bace4c16 by Elifeleti Mukisa Dan at 2025-11-18T12:46:53+00:00
[BP][ENH] Admin Users: Add batch lock/unlock action for user accounts
---
* [BP][ENH] Admin Users: Add batch lock/unlock action for user accounts
---
* [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


(cherry picked from commit cb835d2d47cac4cd7a1a0b71af9963a717a3b18d)

e9a9a7cb [NEW] Add global password invalidation feature for users
06bbd59e [NEW] Add bulk account lock/unlock feature for user management
dd85aa8c Merge remote-tracking branch 'origin/master' into invalidate_user

Co-authored-by: Elifeleti Mukisa Dan <[email protected]>

See merge request tikiwiki/tiki!9047


(cherry picked from commit 9400103cdd0d42cbbacccd0d62d7b5c939fe1fcc)

fc4120f6 [ENH] Admin Users: Add batch lock/unlock action for user accounts

Co-authored-by: Elifeleti Mukisa Dan <[email protected]>

See merge request tikiwiki/tiki!9048

- - - - -


2 changed files:

- lib/core/Services/User/Controller.php
- templates/tiki-adminusers.tpl


Changes:

=====================================
lib/core/Services/User/Controller.php
=====================================
@@ -1249,15 +1249,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}
@@ -359,6 +366,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/bace4c16551db3213f68427b61a116e0aceb8e96

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/bace4c16551db3213f68427b61a116e0aceb8e96
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.