News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Disable deletion of yourself

Started by Tristan Perry, September 11, 2004, 09:56:11 AM

Previous topic - Next topic

brianjw

A couple other questions, is it possible to disable ban of yourself and disable admin membergroup remove of yourself?

assam_siddibapa


Bulakbol

Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

assam_siddibapa

Can some one give me the exact code for smf 1.1.5

As i didnt find what  i need to change

bros

Quote from: brianjw on July 02, 2008, 07:40:28 PM
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

Mr. Khan

Quote from: double_d on January 25, 2005, 05:40:46 PM
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



Whimsical

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 :)

Antechinus

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).

Whimsical

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 :):)

drvanitus

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.

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:
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.

H3lioz

Anyone knows how to do this on 2.0?

Robert.


H3lioz

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

Is nowhere in subs-members.php

Robert.

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

H3lioz


Chalky

#76
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

matricrsult


Advertisement: