Advertisement:

Author Topic: Disable deletion of yourself  (Read 85183 times)

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,154
  • Gender: Male
Re: Disable deletion of yourself
« Reply #60 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?

Offline assam_siddibapa

  • Full Member
  • ***
  • Posts: 429
Re: Disable deletion of yourself
« Reply #61 on: July 09, 2008, 10:55:48 AM »
Wat about smf 1.1.5

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Disable deletion of yourself
« Reply #62 on: July 09, 2008, 09:12:20 PM »
It should work.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline assam_siddibapa

  • Full Member
  • ***
  • Posts: 429
Re: Disable deletion of yourself
« Reply #63 on: July 10, 2008, 08:14:57 AM »
Can some one give me the exact code for smf 1.1.5

As i didnt find what  i need to change

Offline bros

  • Full Member
  • ***
  • Posts: 634
Re: Disable deletion of yourself
« Reply #64 on: July 11, 2008, 03:01:14 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

Offline Mr. Khan

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
  • The Future Champ!
    • Religionism
Re: Disable deletion of yourself
« Reply #65 on: July 12, 2008, 07:48:56 AM »
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



Offline Whimsical

  • Semi-Newbie
  • *
  • Posts: 14
Re: Disable deletion of yourself
« Reply #66 on: January 22, 2009, 04:19:03 PM »
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 :)

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,754
  • Master of BBC Abuse
Re: Disable deletion of yourself
« Reply #67 on: January 22, 2009, 05:02:58 PM »
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).
Mods - Manky Old Themes - Apocalypse theme (WIP)

Going through 2.0.x in detail is like picking through something that dropped out of the rear end of a vulture. Every couple of seconds I'm like "Oooo, that's gruesome. WTF is that doing in there?"

It doesn't matter if the glass is half empty or half full. There is clearly room for more beer.

Offline Whimsical

  • Semi-Newbie
  • *
  • Posts: 14
Re: Disable deletion of yourself
« Reply #68 on: January 22, 2009, 07:49:41 PM »
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 :):)

Offline drvanitus

  • Semi-Newbie
  • *
  • Posts: 15
Re: Disable deletion of yourself
« Reply #69 on: February 02, 2011, 08:32:08 PM »
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.

Offline dougiefresh

  • Jr. Member
  • **
  • Posts: 265
Re: Disable deletion of yourself
« Reply #70 on: February 26, 2011, 11:08:09 AM »
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: [Select]
function deleteMembers($users, $check_not_admin = false)
{
global $sourcedir, $modSettings, $user_info, $smcFunc;
with the following:
Code: [Select]
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.
My Mods - PMs are ok but please not for support, here's why.

Offline H3lioz

  • Jr. Member
  • **
  • Posts: 333
Re: Disable deletion of yourself
« Reply #71 on: October 06, 2011, 10:35:57 AM »
Anyone knows how to do this on 2.0?

Offline Kryzen

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,673
  • Gender: Male
Re: Disable deletion of yourself
« Reply #72 on: October 06, 2011, 10:56:21 AM »
Check the post above yours..

Offline H3lioz

  • Jr. Member
  • **
  • Posts: 333
Re: Disable deletion of yourself
« Reply #73 on: October 06, 2011, 11:18:56 AM »
function deleteMembers($users, $check_not_admin = false)
{
   global $sourcedir, $modSettings, $user_info, $smcFunc;

Is nowhere in subs-members.php

Offline Kryzen

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,673
  • Gender: Male
Re: Disable deletion of yourself
« Reply #74 on: October 06, 2011, 02:45:09 PM »
It is for me.. o_O Check +/- line 85

Offline H3lioz

  • Jr. Member
  • **
  • Posts: 333
Re: Disable deletion of yourself
« Reply #75 on: October 06, 2011, 03:50:25 PM »
Oh now i found it ;D Thanks

Offline Chalky

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 3,010
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: Disable deletion of yourself
« Reply #76 on: March 19, 2012, 07:54:55 PM »
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
« Last Edit: March 21, 2012, 04:48:43 PM by Sabrinova »

Offline matricrsult

  • Newbie
  • *
  • Posts: 5
Re: Disable deletion of yourself
« Reply #77 on: April 24, 2012, 03:04:20 AM »
Great tip thanks for sharing