Jump to the post that solved this thread.
Solved: 2 Years, 10 Months ago How can i protect members of one group from being deleted?
#10
Solved: 2 Years, 10 Months ago
(2019-01-26, 11:23 AM)linguist Wrote: allow a super admin to delete themselves? That'd be .... odd.

Probably, tho the check inside the delete_user method is ran later.

(2019-01-26, 11:23 AM)linguist Wrote: I thought a check for the "undeletable" group might work here perhaps.

You have already been told what to edit. If you want a plugin, you just need to hook to datahandler_user_delete_start. Otherwise, add your check before $plugins->run_hooks('datahandler_user_delete_start', $this); in the /inc/datahandlers/user.php file. Something around the lines of (could be better):
		defined('PROTECTED_GROUPS') or define('PROTECTED_GROUPS', '4,187');

		foreach($this->delete_uids as $key => $uid)
		{
			$user = get_user($uid);

			if(is_member(PROTECTED_GROUPS, $user))
			{
				unset($this->delete_uids[$key]);
			}
		}
Reply
Jump to the post that solved this thread.


Messages In This Thread
RE: How can i protect members of one group from being deleted? - by Omar G. - 2019-01-26, 06:35 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)