Advertisement:
2by2host

Author Topic: [Trick] Administrate Yourself  (Read 25083 times)

Offline Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,426
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
[Trick] Administrate Yourself
« on: March 09, 2011, 02:01:05 AM »
I know I made a topic for this a while ago, but things have changed enough, that I decided to just start a new topic.

A long time ago, I decided to make a script for people who needed to administrate themselves, if they lost their main account, or for some reason it was un-administered..

I decided it was finally time to update it, so here it is.

Here are the features I worked in to this version.
  • Works on all themes
  • Follows forums width
  • Validates session
  • Pushes guests to a login form
  • Error notifications
  • Success notification
  • Uses a "language" function, for easy translation
  • Separates Source from Display
  • Redirects Administrators

Note: This does not work on XAMPP if you don't have a password setup, sorry Ha2. :P

Right now, it only will work with the SMF 2.0 series, and has validation to stop it from being run on SMF 1.1x series.

Although I wrote this version with the mindset of eventually backporting it to 1.1x.

Screenshots and zip attached.

To use, simply download "administrate.php" and upload it to the same directory as your forums SSI.php, then visit in your browser.

Enjoy,
Labradoodle-360
« Last Edit: July 16, 2011, 11:51:40 PM by Labradoodle-360 »

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline texasman1979

  • Full Member
  • ***
  • Posts: 488
  • Gender: Male
  • hello
    • http://www.myfewclicks.com
Re: [Trick] Administrate Yourself
« Reply #1 on: March 09, 2011, 09:21:47 AM »
Just to double check, does this check to see if the account was at one time an admin? How would it prevent a would be hacker from gaining access? Or is it like install.php, intended to be removed after use?
SMF 2.0.4
SimplePortal 2.3.5

LOGIC is a FOUR letter word! :)


Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,772
    • wedgebook on Facebook
Re: [Trick] Administrate Yourself
« Reply #2 on: March 09, 2011, 09:23:12 AM »
It requires the database password, which it checks for.

Offline texasman1979

  • Full Member
  • ***
  • Posts: 488
  • Gender: Male
  • hello
    • http://www.myfewclicks.com
Re: [Trick] Administrate Yourself
« Reply #3 on: March 09, 2011, 09:29:17 AM »
Ah kk. Sounds like a pretty good deal. Lab you come up with some pretty good stuff. :) maybe i can get you to check my site out and me some thoughts, maybe we can put our heads together on something sometime.
SMF 2.0.4
SimplePortal 2.3.5

LOGIC is a FOUR letter word! :)


Offline Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,426
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: [Trick] Administrate Yourself
« Reply #4 on: March 09, 2011, 11:28:27 AM »
Sure, feel free to shoot me a pm.

Moved to Tips and Tricks :)
« Last Edit: March 09, 2011, 01:12:04 PM by Labradoodle-360 »

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 38,564
  • Gender: Male
  • Nothing (Or nothing you can see)
Re: [Trick] Administrate Yourself
« Reply #5 on: March 09, 2011, 01:21:17 PM »
Useful for people who don't have an emergency admin account, I'd imagine. :)

Always the first thing I do, when I start a forum, that.

Make myself another admin account.

Hmmm... Thinking about it, I might just suggest that as a future feature. :)

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,772
    • wedgebook on Facebook
Re: [Trick] Administrate Yourself
« Reply #6 on: March 09, 2011, 01:23:08 PM »
I'd actually discourage having more admin accounts than necessary... no point in having two separate accounts that can be brute-forced, it's more points of failure.

Offline Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,426
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: [Trick] Administrate Yourself
« Reply #7 on: March 09, 2011, 01:23:23 PM »
There's no need to with this script :P All you have to do is know the database password.

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 38,564
  • Gender: Male
  • Nothing (Or nothing you can see)
Re: [Trick] Administrate Yourself
« Reply #8 on: March 09, 2011, 01:38:47 PM »
Fairy nuff! :)

Offline DoctorMalboro

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 9,087
  • Gender: Male
  • うまいいいいいい!!!!!
    • @DoctorMalboro on Twitter
    • Personal website
Re: [Trick] Administrate Yourself
« Reply #9 on: March 09, 2011, 05:24:18 PM »
I've always wonder why SMF let administrators delete their own account, I mean, all permissions shouldn't always mean ALL permissions.

Offline Yoshi

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,118
  • Gender: Male
Re: [Trick] Administrate Yourself
« Reply #10 on: March 09, 2011, 05:34:27 PM »
I've always wonder why SMF let administrators delete their own account, I mean, all permissions shouldn't always mean ALL permissions.
Lol, good point.

And nice script. Might use it when I am being stupid again and I remove my admin rights (again :P).
My Mods / [WIP] Mod Builder / GitHub profile / "A programmer is just a tool which converts caffeine into code."
Quote
<FLAMER> Marketing is about to get into drug activities maybe... but we will see about that later on :P
<Yoshi2889> We're getting free drugs?
<CoreISP> He's talking about caffeine man, damn pen lifter.

Offline Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,426
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: [Trick] Administrate Yourself
« Reply #11 on: March 09, 2011, 05:36:45 PM »
This might sound quite contradicting to the purpose of this script, but during development of 1.0, I made a script called "unadministrate.php" which actually does the opposite of this, except it was very crude, with no validation whatsoever. :P

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline DoctorMalboro

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 9,087
  • Gender: Male
  • うまいいいいいい!!!!!
    • @DoctorMalboro on Twitter
    • Personal website
Re: [Trick] Administrate Yourself
« Reply #12 on: March 10, 2011, 06:31:22 PM »
I would call it "New admin account for morons", but it would be to harsh :P

Offline ysNoi

  • Jr. Member
  • **
  • Posts: 139
  • Gender: Male
  • I'm For DeMolay Alone
    • pHForums™
Re: [Trick] Administrate Yourself
« Reply #13 on: August 14, 2011, 02:46:55 AM »
Hi...

I forgot my Administrator password. I tried to upload administrate.php file as instructed above but I could not get to the "Administrate Yourself" page...
Can someone help me please...

Thanks,
ysNoi
"Don't fix it if it ain't broken, don't break it if you can't fix it."

Offline Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,426
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: [Trick] Administrate Yourself
« Reply #14 on: August 14, 2011, 02:54:48 AM »
Administrate Yourself does not recover an admin password.

It would allow you to create a new account, and then run this file, to make that account an administrator however.

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline Shadow Queen

  • Jr. Member
  • **
  • Posts: 184
  • Gender: Female
    • My Kingdom
Re: [Trick] Administrate Yourself
« Reply #15 on: September 06, 2011, 11:08:31 PM »
Sound a good idea to use.  In cause it something happen like this.

Offline ahrasis

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 3,993
  • 26M deal concluded. Now busy with its post-work...
    • alfaqir.ahmad.rasyid on Facebook
    • @ahrasis on Twitter
    • ahrasis
Re: [Trick] Administrate Yourself
« Reply #16 on: September 12, 2011, 10:13:23 PM »
Nice job. I think it should be integrated with repair_settings.php. But standalone is also nice.
SimpleRevamp2 site might be temporarily disable at anytime due to site management. Kindly proceed to anypost open forum at http://anypost.qom.my to see the latest SimpleRevamp2 theme in action.

Offline Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,426
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: [Trick] Administrate Yourself
« Reply #17 on: September 12, 2011, 11:05:23 PM »
I personally prefer it standalone, although in my opinion repair_settings.php needs a re-write too. So you never know.

Maybe combine a bunch of scripts together into a new section and name it "tools.php" or something.

If I were to re-write this, I would allow you to also create a new account, I saw somewhere that was the case for some, that they couldn't even create a new account, it'd be simple to add too.

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline ahrasis

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 3,993
  • 26M deal concluded. Now busy with its post-work...
    • alfaqir.ahmad.rasyid on Facebook
    • @ahrasis on Twitter
    • ahrasis
Re: [Trick] Administrate Yourself
« Reply #18 on: September 13, 2011, 12:06:11 AM »
Indeed. Creating a new account is also important especially with your tricks. I can't imagine how they're going to use this trick when they don't have a user account and can't create a new one.

I really think that SMF should create a protection to all admin account where it either cannot be deleted at all or can be deleted only by superadmin (preferably only one superadmin user and prerably only user #1 to avoid conflict).
SimpleRevamp2 site might be temporarily disable at anytime due to site management. Kindly proceed to anypost open forum at http://anypost.qom.my to see the latest SimpleRevamp2 theme in action.

Offline Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,426
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: [Trick] Administrate Yourself
« Reply #19 on: September 13, 2011, 11:04:45 AM »
It somewhat does, you cannot delete the Administrator if it's the only admin account, so really, there has to be one base admin.

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications