[TikiWiki-commits] [Git][tikiwiki/tiki][29.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 | <691c688dbb75a_2a17edc8683c@gitlab-sidekiq-low-urgency-cpu-bound-v2-cf788b4bc-dpqcw.mail> |
Elifeleti Mukisa Dan pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki Commits: 9400103c by Elifeleti Mukisa Dan at 2025-11-18T12:29:51+00:00 [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 - - - - - 2 changed files: - lib/core/Services/User/Controller.php - templates/tiki-adminusers.tpl Changes: ===================================== lib/core/Services/User/Controller.php ===================================== @@ -1256,15 +1256,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/9400103cdd0d42cbbacccd0d62d7b5c939fe1fcc -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/9400103cdd0d42cbbacccd0d62d7b5c939fe1fcc 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