Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: Tristan Perry in September 11, 2004, 09:56:11 VORMITTAG

Titel: Disable deletion of yourself
Beitrag von: Tristan Perry in September 11, 2004, 09:56:11 VORMITTAG
Hello all,
  If you're like me, and very paranoid then this may help you  :P. It stops people [With the correct permissions] from deleting your account on your forums. To do this find:

function deleteMembers($users)
{
global $db_prefix, $sourcedir, $modSettings, $ID_MEMBER;

In Sources/ManageMembers.php (/Sources/Subs-members.php in SMF 1.1)

and replace it with:

function deleteMembers($users)
{
global $db_prefix, $sourcedir, $modSettings, $ID_MEMBER;

        // 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.');


This stops people from deleting your account either through your profile, or through the view/delete members page in the admin panel.
If you're ID isn't 1, but you still want to protect yourself, then just change the 2 numbers in this part:
if ($users == 1 || (is_array($users) && in_array(1, $users)))
to whatever your member ID is.

If you want this to not extend to more than one user, you can do so by doing what JohnyB (http://www.simplemachines.org/community/index.php?action=profile;u=67763) suggested:

// Protect the person who started the forum

if ($users == 1 or $users == 2 or @in_array(1, $users) or @in_array(2, $users))
     fatal_error('You\'re not allowed to delete the administrator.');


I hope this helps someone.
TauOnline.Org (http://tauonline.org)
Titel: Re: Disable deletion of yourself.
Beitrag von: Amacythe in September 11, 2004, 10:23:49 VORMITTAG
Keep in mind this only works if the Admin is member number one.  In my case, (an upgraded board that had a 'dummy' admin set up as member number one) I need to change it slightly.
Titel: Re: Disable deletion of yourself.
Beitrag von: Tristan Perry in September 11, 2004, 10:26:14 VORMITTAG
Zitat von: Amacythe in September 11, 2004, 10:23:49 VORMITTAG
Keep in mind this only works if the Admin is member number one.  In my case, (an upgraded board that had a 'dummy' admin set up as member number one) I need to change it slightly.
Yeah it's easy to change though  :) I'll edit my post just to show how to do it if people don't know.
Titel: Re: Disable deletion of yourself.
Beitrag von: [Unknown] in September 11, 2004, 03:28:08 NACHMITTAGS
Zitat von: Tau Online in September 11, 2004, 09:56:11 VORMITTAG
if ($users == 1 xor in_array(1, $users) )

Just wondering; is there a particular reason you're using xor here?  It's different from or in that it means one OR the other, but not BOTH.  In this case, it really *couldn't* be both, but or (||) should work too....

-[Unknown]
Titel: Re: Disable deletion of yourself.
Beitrag von: Tristan Perry in September 11, 2004, 04:12:51 NACHMITTAGS
Zitat von: [Unknown] in September 11, 2004, 03:28:08 NACHMITTAGS
Zitat von: Tau Online in September 11, 2004, 09:56:11 VORMITTAG
if ($users == 1 xor in_array(1, $users) )

Just wondering; is there a particular reason you're using xor here?  It's different from or in that it means one OR the other, but not BOTH.  In this case, it really *couldn't* be both, but or (||) should work too....

-[Unknown]
Your right! Thanks, I'll change it now  :) It wouldn't make a difference though would it? (I mean whether xor or || is used?)
Titel: Re: Disable deletion of yourself.
Beitrag von: [Unknown] in September 11, 2004, 04:23:57 NACHMITTAGS
Nope, none really in this case.... although, I prefer "||" over the word form "or".... then again I like C/C++ ;).

-[Unknown]
Titel: Re: Disable deletion of yourself.
Beitrag von: double_d in Januar 25, 2005, 05:40:46 NACHMITTAGS
Dont' want to be a pain, but is there a way to keep users from deleting their own accounts?  I hate when people do that.
Titel: Re: Disable deletion of yourself.
Beitrag von: [Unknown] in Januar 25, 2005, 06:45:40 NACHMITTAGS
It's a permission.  Simply disallow it.

-[Unknown]
Titel: Re: Disable deletion of yourself.
Beitrag von: Sol in Januar 27, 2005, 11:56:38 VORMITTAG
This doesn't seem to work with SMF 1.0.1 Final :'(

I get this error :
2: in_array(): Wrong datatype for second argument
File: /home/sol/public_html/forum/Sources/ManageMembers.php
Line: 984

Line 984 :
if ($users == 1 || in_array(1, $users) )

I've used this trick twice before with RC2 and it's worked fine. I've copied everything exactly right.
Titel: Re: Disable deletion of yourself.
Beitrag von: Tristan Perry in Januar 27, 2005, 12:19:23 NACHMITTAGS
Zitat von: Sol in Januar 27, 2005, 11:56:38 VORMITTAG
This doesn't seem to work with SMF 1.0.1 Final :'(

I get this error :
2: in_array(): Wrong datatype for second argument
File: /home/sol/public_html/forum/Sources/ManageMembers.php
Line: 984

Line 984 :
if ($users == 1 || in_array(1, $users) )

I've used this trick twice before with RC2 and it's worked fine. I've copied everything exactly right.
It's not updated to work with SMF 1.0(.1) I'll update it sometime  :)
Titel: Re: Disable deletion of yourself.
Beitrag von: Sol in Januar 27, 2005, 03:45:44 NACHMITTAGS
As soon as possible please :P
Titel: Re: Disable deletion of yourself.
Beitrag von: azuregenesis in Mai 24, 2005, 11:58:02 NACHMITTAGS
working fix for 1.03 (tested) just quoted TauOnline and edited it :)

find in Sources/ManageMembers.php
function deleteMembers($users)
{
global $db_prefix, $sourcedir, $modSettings, $ID_MEMBER;

In Sources/ManageMembers.php

and replace it with:


function deleteMembers($users)
{
global $db_prefix, $sourcedir, $modSettings, $ID_MEMBER;

        // Protect the person who started the forum
if ($users == 1)
{
           fatal_error('You\'re not allowed to delete the administrator.');
           exit();
}


This stops people from deleting your account either through your profile, or through the view/delete members page in the admin panel.
If you're ID isn't 1, but you still want to protect yourself, then just change the number.
Titel: Re: Disable deletion of yourself.
Beitrag von: Jako in Juni 26, 2005, 04:59:20 VORMITTAG
Am I the only one that's scared to test this mod out? >>
Titel: Re: Disable deletion of yourself
Beitrag von: Tristan Perry in Juni 26, 2005, 05:37:49 VORMITTAG
I've updated my first post so this now works with updated versions (Tested with 1.1 Beta 3 and 1.0.5)

Credit goes to [Unknown] for this update, he posted an updated/working version of this hack in one of the threads in the Announcements board.

Zitat von: Jako in Juni 26, 2005, 04:59:20 VORMITTAG
Am I the only one that's scared to test this mod out? >>
:P I was at first. Either backup your database or run SMF on a test server.. It should work though.
Titel: Re: Disable deletion of yourself.
Beitrag von: azuregenesis in Juni 26, 2005, 08:18:04 VORMITTAG
Zitat von: Jako in Juni 26, 2005, 04:59:20 VORMITTAG
Am I the only one that's scared to test this mod out? >>

you can do what TAU said above or you can also change the user number in the code above. :)

instead of "1" (whcih is the admin) change it to another one, like a member that you're about to remove.
Titel: Re: Disable deletion of yourself
Beitrag von: Metal_GunBlade in Juli 10, 2005, 12:34:42 NACHMITTAGS
Dude, I have SMF 1.1 Beta 3 but I can't find the code...
Is there something I'm missing???
Titel: Re: Disable deletion of yourself
Beitrag von: [Unknown] in Juli 10, 2005, 07:43:45 NACHMITTAGS
It's in Subs-Members.php.

-[Unknown]
Titel: Re: Disable deletion of yourself
Beitrag von: rojamaia in August 27, 2005, 08:05:21 VORMITTAG

how about if i want to protect two or more accounts?

can i just add comma to the number like if ($users == 1,2 xor in_array(1,2 $users) )

by the way, which one of the two codes would work for 1.0.5?  could you please label those codes with the versions that it would work with?

thank you!  :D
Titel: Re: Disable deletion of yourself
Beitrag von: [Unknown] in August 27, 2005, 01:17:58 NACHMITTAGS
No, you can't just add commas like that.  Instead:

if ($users == 1 or $users == 2 or @in_array(1, $users) or @in_array(2, $users))

Would probably be best.

-[Unknown]
Titel: Re: Disable deletion of yourself
Beitrag von: rojamaia in August 27, 2005, 01:28:31 NACHMITTAGS
so if it's three users, i just add more "or"s?


something like this?
if ($users == 1 or $users == 2 or $users == 36 or @in_array(1, $users) or @in_array(2, $users) or @in_array(3, $users))
Titel: Re: Disable deletion of yourself
Beitrag von: Tristan Perry in August 27, 2005, 01:40:07 NACHMITTAGS
Zitat von: malinaobenny in August 27, 2005, 01:28:31 NACHMITTAGS
so if it's three users, i just add more "or"s?


something like this?
if ($users == 1 or $users == 2 or $users == 36 or @in_array(1, $users) or @in_array(2, $users) or @in_array(3, $users))
That would be correct, yes.
Titel: Re: Disable deletion of yourself
Beitrag von: Anakin_holland in August 27, 2005, 02:23:07 NACHMITTAGS
Zitat von: malinaobenny in August 27, 2005, 01:28:31 NACHMITTAGS
so if it's three users, i just add more "or"s?


something like this?
if ($users == 1 or $users == 2 or $users == 36 or @in_array(1, $users) or @in_array(2, $users) or @in_array(3, $users))

Shouldn't that be:

if ($users == 1 or $users == 2 or $users == 36 or @in_array(1, $users) or @in_array(2, $users) or @in_array(36, $users))

?? Don't know myself, just curious?

Greetz!
Titel: Re: Disable deletion of yourself
Beitrag von: Tristan Perry in August 27, 2005, 02:46:43 NACHMITTAGS
Zitat von: Anakin_holland in August 27, 2005, 02:23:07 NACHMITTAGS
Shouldn't that be:

if ($users == 1 or $users == 2 or $users == 36 or @in_array(1, $users) or @in_array(2, $users) or @in_array(36, $users))

?? Don't know myself, just curious?

Greetz!
Yeah, I presumed the original "3" was just a typo.
Titel: Re: Disable deletion of yourself
Beitrag von: DemonicInfluence in November 08, 2005, 09:58:47 NACHMITTAGS
I have a question. Couldn't they just ban you? It would end in the same effect. Could someone make it so they can't ban or demote u?
Titel: Re: Disable deletion of yourself
Beitrag von: Anakin_holland in November 09, 2005, 02:23:12 NACHMITTAGS
Zitat von: Libo in November 08, 2005, 09:58:47 NACHMITTAGS
I have a question. Couldn't they just ban you? It would end in the same effect. Could someone make it so they can't ban or demote u?

True, but a ban or demotion is reversable... ;) and the effect isn't exactly the same, because the messages will still be attached to that banned or demoted user?

Greetz!
Titel: Re: Disable deletion of yourself
Beitrag von: Elmacik in November 09, 2005, 06:00:37 NACHMITTAGS
Support me here: Super admin (http://www.simplemachines.org/community/index.php?topic=53498.0) ;)
Maybe if much people asks for it, they give :P
Pepsi! Ask for more! LOL
Titel: Re: Disable deletion of yourself
Beitrag von: DemonicInfluence in November 09, 2005, 06:49:04 NACHMITTAGS
okay, cool
Titel: Re: Disable deletion of yourself
Beitrag von: SleePy in November 12, 2005, 07:19:05 NACHMITTAGS
couldnt you just check if the user is administrator and then disable deletion?
Titel: Re: Disable deletion of yourself.
Beitrag von: alphacaveman in Januar 02, 2006, 07:38:12 NACHMITTAGS
Zitat von: [Unknown] in Januar 25, 2005, 06:45:40 NACHMITTAGS
It's a permission.  Simply disallow it.

-[Unknown]

As far as removing the ability of a member to delete their account, I can't find it in the permissions to disallow. Where is it?
Titel: Re: Disable deletion of yourself.
Beitrag von: azuregenesis in Januar 04, 2006, 10:14:00 VORMITTAG
Zitat von: leesw in Januar 02, 2006, 07:38:12 NACHMITTAGS
Zitat von: [Unknown] in Januar 25, 2005, 06:45:40 NACHMITTAGS
It's a permission.  Simply disallow it.

-[Unknown]

As far as removing the ability of a member to delete their account, I can't find it in the permissions to disallow. Where is it?

using 1.1?
- admin>permissions>modify>uncheck delete account:own account

1.05?
- admin>edit permissions>modify>uncheck delete account:own account
Titel: Re: Disable deletion of yourself
Beitrag von: alphacaveman in Januar 07, 2006, 12:45:54 VORMITTAG
Thank you azuregenesis!
Titel: Re: Disable deletion of yourself
Beitrag von: Dexy in Januar 16, 2006, 05:26:47 VORMITTAG
What is code for SMF 1.0.5. ?
Titel: Re: Disable deletion of yourself
Beitrag von: sbarnes in Mai 30, 2006, 05:34:27 NACHMITTAGS
Hi there,
I was about to add this to my site.
Just wanted to ask, is this till valid for version 1.1 RC2? or does that version already have this kind of feature?

I can find the code no problem but just wondered if this was a needed mod to add.
function deleteMembers($users)
{
global $db_prefix, $sourcedir, $modSettings, $ID_MEMBER;
Titel: Re: Disable deletion of yourself
Beitrag von: PrizeLive.com in Juni 16, 2006, 03:25:06 NACHMITTAGS
What's the code for version 1.1 RC2?
Titel: Re: Disable deletion of yourself
Beitrag von: DemonicInfluence in Juni 18, 2006, 06:49:39 NACHMITTAGS
The one for smf 1.1...
Titel: Re: Disable deletion of yourself
Beitrag von: Skipdawg in Juni 18, 2006, 08:32:43 NACHMITTAGS
Glad this came back up. I had forgotten to had it back after updating to 1.1 RC2  ;D ;)
Titel: Re: Disable deletion of yourself
Beitrag von: PrizeLive.com in Juni 21, 2006, 11:28:52 VORMITTAG
Zitat von: DemonicInfluence in Juni 18, 2006, 06:49:39 NACHMITTAGS
The one for smf 1.1...

So the code for smf 1.1 is compatible if you use 1.1 RC2? Are you sure?
Titel: Re: Disable deletion of yourself
Beitrag von: DemonicInfluence in Juni 26, 2006, 07:03:26 NACHMITTAGS
yes..
Titel: Re: Disable deletion of yourself
Beitrag von: PrizeLive.com in Juni 29, 2006, 09:15:32 VORMITTAG
Zitat von: DemonicInfluence in Juni 26, 2006, 07:03:26 NACHMITTAGS
yes..

Thanks!
Titel: Re: Disable deletion of yourself
Beitrag von: Stuart in Juli 08, 2006, 08:17:53 NACHMITTAGS
This works great, thanks!
Titel: Re: Disable deletion of yourself
Beitrag von: ShadowStriker in Juli 19, 2006, 10:25:41 VORMITTAG
Im member #1, but I have a spy that I use on the forum and act like a regular member, just to see ways people act and stuff. How would I make both undeleteable?
Titel: Re: Disable deletion of yourself
Beitrag von: Thurnok in August 03, 2006, 04:55:33 VORMITTAG
[EDIT]

Removed all the code from here.  I have packaged this as a mod now and should be available shortly (once approved) here at SMF as "Admin Deletion Protect" mod.

In the interim, if you want this right away, you can find it at my TP Blocks (http://www.tpblocks.com) site available for download.  Downloading requires registration however.
Titel: Re: Disable deletion of yourself
Beitrag von: Stuart in Dezember 21, 2006, 11:14:14 VORMITTAG
Zitat von: Stuart in Juli 08, 2006, 08:17:53 NACHMITTAGS
This works great, thanks!

It's no longer working with SMF 1.1.1 though  :'(
Titel: Re: Disable deletion of yourself
Beitrag von: Shadow Queen in Februar 15, 2007, 08:43:39 NACHMITTAGS
I can't found the code what i am looking for in the file.  I am running with 1.1.1 with TP.
Titel: Re: Disable deletion of yourself
Beitrag von: Yellowrose in März 04, 2007, 03:12:28 NACHMITTAGS
I would also like to make use of this code edit.

SMF 1.1.2 w/Tiny Portal 0.9.7.1
Titel: Re: Disable deletion of yourself
Beitrag von: Skipdawg in März 04, 2007, 06:06:24 NACHMITTAGS
Yes would be nice to have this updated for 1.1.2  ;)
Would be nicer to have this as a fixed option of enable or disabled in SMF Admin panel  ;D
Titel: Re: Disable deletion of yourself
Beitrag von: Thurnok in April 29, 2007, 07:41:22 VORMITTAG
I updated the hack.  You can find a working version, including the fix for the Profile page to prevent removing from the Admin group, at my TP Blocks site (http://www.tpblocks.com).  The post is located here (http://www.tpblocks.com/index.php?topic=67.msg182#msg182) and is accessable to guests as well.
Titel: Re: Disable deletion of yourself
Beitrag von: DrDom in April 30, 2007, 10:49:30 VORMITTAG
Zitat von: Thurnok in April 29, 2007, 07:41:22 VORMITTAG
I updated the hack.  You can find a working version, including the fix for the Profile page to prevent removing from the Admin group, at my TP Blocks site (http://tpblocks.ccs-net.com).  The post is located here (http://tpblocks.ccs-net.com/index.php?topic=67.msg182#msg182) and is accessable to guests as well.

It appears that guest access is not available, when I clicked the link it presents me with a registration box. :(
Titel: Re: Disable deletion of yourself
Beitrag von: Thurnok in April 30, 2007, 10:06:17 NACHMITTAGS
Sorry, caught me in the middle of moving my site as well.  Try going to the new site (updated in my original post) and you should now be able to access it.
Titel: Re: Disable deletion of yourself
Beitrag von: DrDom in Mai 01, 2007, 06:38:49 VORMITTAG
Zitat von: Thurnok in April 30, 2007, 10:06:17 NACHMITTAGS
Sorry, caught me in the middle of moving my site as well.  Try going to the new site (updated in my original post) and you should now be able to access it.
hi,
I noticed that the site was under maintenance later last night, thanks for the reply, i'll try again now.

Regards
Titel: Re: Disable deletion of yourself
Beitrag von: Thurnok in Mai 05, 2007, 05:47:43 NACHMITTAGS
I've packaged this up as a Mod and it has now been submitted to SMF, just waiting approval.
Titel: Re: Disable deletion of yourself
Beitrag von: DrDom in Mai 06, 2007, 07:03:37 VORMITTAG
I applied the mods from your site on may 1st, it works very well indeed.
But pleased to see you have made a package.

Regards
Titel: Re: Disable deletion of yourself
Beitrag von: Bulakbol in Juni 29, 2007, 07:47:38 NACHMITTAGS
Zitat von: Thurnok in Mai 05, 2007, 05:47:43 NACHMITTAGS
I've packaged this up as a Mod and it has now been submitted to SMF, just waiting approval.

Is this mod not available for downloading yet?  It will be nice if it will work with SMF 1.1.3   ;)
Titel: Re: Disable deletion of yourself
Beitrag von: Bulakbol in Juli 04, 2007, 12:12:03 NACHMITTAGS
Ok, tested with SMF 1.1.3 and it works. It won't delete user #5 and #6. Then I deleted #9 and it deleted it.  Thank you.


// Protect the person who started the forum

if ($users == 5 or $users == 6 or @in_array(5, $users) or @in_array(6, $users))
     fatal_error('You\'re not allowed to delete the administrator.');
Titel: Re: Disable deletion of yourself
Beitrag von: chrishicks in Dezember 11, 2007, 09:45:09 VORMITTAG
is anyone using this on 1.1.4?
Titel: Re: Disable deletion of yourself
Beitrag von: SleePy in Dezember 11, 2007, 01:31:26 NACHMITTAGS
The same method JohnyB has posted above would work for 1.1.4.
You will find little differences between 1.1.3 and 1.1.4 as once we released the 1.1 line it was only bug patches and security fixes we are doing :)
Titel: Re: Disable deletion of yourself
Beitrag von: theboogymaster in Januar 15, 2008, 04:46:35 NACHMITTAGS
nice thks a lot
Titel: Re: Disable deletion of yourself
Beitrag von: MisticJeff in März 02, 2008, 06:07:30 NACHMITTAGS
Anyone have any further info on this working with 1.1 RC3??  I tried inserting the code into Subs-Members.php and then tried deleting the named admin and it allowed me to...
Titel: Re: Disable deletion of yourself
Beitrag von: Stuart in März 09, 2008, 10:53:46 VORMITTAG
Zitat von: chrishicks in Dezember 11, 2007, 09:45:09 VORMITTAG
is anyone using this on 1.1.4?

Yes, and it works great!
Titel: Re: Disable deletion of yourself
Beitrag von: Tristan Perry in März 24, 2008, 07:25:09 VORMITTAG
I've updated my first post to reflect JohnyB's suggested code change :)
Titel: Re: Disable deletion of yourself
Beitrag von: brianjw in Juli 02, 2008, 07:40:28 NACHMITTAGS
A couple other questions, is it possible to disable ban of yourself and disable admin membergroup remove of yourself?
Titel: Re: Disable deletion of yourself
Beitrag von: assam_siddibapa in Juli 09, 2008, 10:55:48 VORMITTAG
Wat about smf 1.1.5
Titel: Re: Disable deletion of yourself
Beitrag von: Bulakbol in Juli 09, 2008, 09:12:20 NACHMITTAGS
It should work.
Titel: Re: Disable deletion of yourself
Beitrag von: assam_siddibapa in Juli 10, 2008, 08:14:57 VORMITTAG
Can some one give me the exact code for smf 1.1.5

As i didnt find what  i need to change
Titel: Re: Disable deletion of yourself
Beitrag von: bros in Juli 11, 2008, 03:01:14 NACHMITTAGS
Zitat von: brianjw in Juli 02, 2008, 07:40:28 NACHMITTAGS
A couple other questions, is it possible to disable ban of yourself and disable admin membergroup remove of yourself?

That feature would be quite useful
Titel: Re: Disable deletion of yourself
Beitrag von: Mr. Khan in Juli 12, 2008, 07:48:56 VORMITTAG
Zitat von: double_d in Januar 25, 2005, 05:40:46 NACHMITTAGS
Dont' want to be a pain, but is there a way to keep users from deleting their own accounts?  I hate when people do that.
Totally agree :P
Titel: Re: Disable deletion of yourself
Beitrag von: Whimsical in Januar 22, 2009, 04:19:03 NACHMITTAGS
Does this work for SMF 1.1.7??

Am curious, as I was going to use it but I am not finding any of the quoted code from the first post, in the stated files.

Any help appreciated :):)

Thanks :)
Titel: Re: Disable deletion of yourself
Beitrag von: Antechinus in Januar 22, 2009, 05:02:58 NACHMITTAGS
I use it with 1.1.7.  Look on Line 113 of Sources/Subs-Members.php (note that this assumes the file has not been altered since installation).
Titel: Re: Disable deletion of yourself
Beitrag von: Whimsical in Januar 22, 2009, 07:49:41 NACHMITTAGS
thank you so much!!

found it right where you said to look

no idea why it wasnt showing up when i did a search for it in the actual php file  ???

anywho.. thank you for the help, appreciate it :):)
Titel: Re: Disable deletion of yourself
Beitrag von: drvanitus in Februar 02, 2011, 08:32:08 NACHMITTAGS
Anybody know what to do for 2.0 RC4?  I'm sure it can be done but I'm not qualified to mess around with it.  I could really use this.
Titel: Re: Disable deletion of yourself
Beitrag von: dougiefresh in Februar 26, 2011, 11:08:09 VORMITTAG
Thanks for the information!

I assume 2.0 RC4 is similar to RC5.   :-[  I looked in Sources/Subs-Members.php and replace this line:
function deleteMembers($users, $check_not_admin = false)
{
global $sourcedir, $modSettings, $user_info, $smcFunc;

with the following:
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.');

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.
Titel: Re: Disable deletion of yourself
Beitrag von: H3lioz in Oktober 06, 2011, 10:35:57 VORMITTAG
Anyone knows how to do this on 2.0?
Titel: Re: Disable deletion of yourself
Beitrag von: Robert. in Oktober 06, 2011, 10:56:21 VORMITTAG
Check the post above yours..
Titel: Re: Disable deletion of yourself
Beitrag von: H3lioz in Oktober 06, 2011, 11:18:56 VORMITTAG
function deleteMembers($users, $check_not_admin = false)
{
   global $sourcedir, $modSettings, $user_info, $smcFunc;

Is nowhere in subs-members.php
Titel: Re: Disable deletion of yourself
Beitrag von: Robert. in Oktober 06, 2011, 02:45:09 NACHMITTAGS
It is for me.. o_O Check +/- line 85
Titel: Re: Disable deletion of yourself
Beitrag von: H3lioz in Oktober 06, 2011, 03:50:25 NACHMITTAGS
Oh now i found it ;D Thanks
Titel: Re: Disable deletion of yourself
Beitrag von: Chalky in März 19, 2012, 07:54:55 NACHMITTAGS
Thanks, I just made the edits given in post #70.  Now how do I test it without deleting myself if it doesn't work?  Would my bco-admin be able to reinstate me and reassign me all my posts etc?

Edit: Doh!  I made an additional admin account, changed the numbers and tested by deleting that second admin account.  I found out this mod works great, as long as you don't use it in conjunction with the quick ban on delete mod - it doesn't seem to protect me from being banned  :P
Titel: Re: Disable deletion of yourself
Beitrag von: matricrsult in April 24, 2012, 03:04:20 VORMITTAG
Great tip thanks for sharing