Customizing SMF > Tips and Tricks

Disable deletion of yourself

<< < (15/16) > >>

dougiefresh:
Thanks for the information!

I assume 2.0 RC4 is similar to RC5.   :-[  I looked in Sources/Subs-Members.php and replace this line:

--- Code: ---function deleteMembers($users, $check_not_admin = false)
{
global $sourcedir, $modSettings, $user_info, $smcFunc;
--- End code ---
with the following:
--- Code: ---function deleteMembers($users, $check_not_admin = false)
{
global $sourcedir, $modSettings, $user_info, $smcFunc;

  // Protect the person who started the forum
  if ($users == 1 or @in_array(1, $users))
    fatal_error('You\'re not allowed to delete the administrator.');
--- End code ---
Once the code was installed, I tried to delete myself (after making a backup of the database  ;) ).  The "not allowed" message came up....  I hope this helps.

H3lioz:
Anyone knows how to do this on 2.0?

Kryzen:
Check the post above yours..

H3lioz:
function deleteMembers($users, $check_not_admin = false)
{
   global $sourcedir, $modSettings, $user_info, $smcFunc;

Is nowhere in subs-members.php

Kryzen:
It is for me.. o_O Check +/- line 85

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version