News:

Wondering if this will always be free?  See why free is better.

Main Menu

Super Admin

Started by Bulakbol, August 04, 2008, 06:44:30 PM

Previous topic - Next topic

Bulakbol

Link to Mod

Author: JohnyB    Mod Name: ZuperAdmin    Version: 1.4
Tested: Freshly installed SMF 1.1.7 and SMF 2.0 Beta 4


Zuper Admin

  • Protect admin#1 from deletion of himself or by other admins.
  • No other admins can ban or post warn admin#1.
  • Hide important information of admin#1 from other admins.
  • A board switch that if enabled (checked), other admins can see the board in board index
    but cannot modify permissions etcetera. Only admin#1 can.
  • Assign members as spies including himself as a superspy by going to
    Profile => Account Related Settings. You won't miss it.
  • See who are online spies.
  • Only Admin #1 can hide the SuperAdmin mod from list of installed packages by navigating to
    Admin => Current Theme => Hide Super Admin from list of installed packages?
  • Can delete moderation log regardless of date and time. Other admins have to wait 24 hours.

Spy members are:

  • Invisible and cannot be seen by members or other admins.
  • Cannot see theirselves.

Spy Profile:

  • Never logged-in.
  • Always offline.

Bonus

  • SMF 1.1.7: In Profile summary, hide icq, msn, website etc. if they are empty.

Note:

  • I have no more time to do the edits for you so please do not ask.

I thank you.

SuperAdmin117_UOT.zip

  • Contains installation codes for those who installed "Users Online Today" mod.
  • It's for version SMF 1.1.7 only.

SuperAdmin.zip

  • For version SMF 2.0 Beta 4, with or without "User Online Today" mod installed.
  • It is also for version SMF 1.1.7 without "Users Online Today" mod installed. Supports Tiny Postal.

December 13, 2008

  • Added Support for Simple Portal version 2.1.1
  • Added Support for ezPortal version 0.2.2

January 8, 2009

  • Hide spy from "Who is viewing" topic and posts

February 18, 2009

  • Released update for version 2.0 RC1
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

ccbtimewiz

Great mod, but one tiny problem. What if someone whom is admin (and not root admin) were to uninstall this package? How can you prevent them from doing so without deleting the package and/or preventing them from adding packages?

Adish - (F.L.A.M.E.R)

This is a very good mod. But the problem is like, I bought the site when i had a different user number, Hence i am not like the number 1 admin. So how shall I change the permissions to keep me safe rather than the profile 1 ?

I am sorry to disrupt your free time, but it would be great if you can help.

Thank you.

edi67

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Nathaniel

Very nice mod, It will come in handy when I need to add some more admin to my website! :)

Thank you!
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Adish - (F.L.A.M.E.R)

Quote from: Kylezz on August 04, 2008, 11:30:55 PM
Quote from: F.L.A.M.E.R on August 04, 2008, 07:24:02 PM
This is a very good mod. But the problem is like, I bought the site when i had a different user number, Hence i am not like the number 1 admin. So how shall I change the permissions to keep me safe rather than the profile 1 ?

I am sorry to disrupt your free time, but it would be great if you can help.

Thank you.
Well, you can try the button that says 'HELP' Or just Click 'HOME' press CTRL F and find the word: Help

Ahh.. what am suppose to do with the "Help" Option ? How will that help me ?

Eliana Tamerin

Quote from: F.L.A.M.E.R on August 04, 2008, 07:24:02 PM
This is a very good mod. But the problem is like, I bought the site when i had a different user number, Hence i am not like the number 1 admin. So how shall I change the permissions to keep me safe rather than the profile 1 ?

I am sorry to disrupt your free time, but it would be great if you can help.

Thank you.

That's not hard. Just change all the instances of 1 to $yourid (where $yourid is, well, your ID):

NOTE: I'm assuming you use SMF 1.1.5!

Open Load.php:
Code (Find this) Select
mem.usertitle' : '');
$select_tables = "
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
" . ($ID_MEMBER != 1 ? " AND mem.spy != 1" : '') . "


Code (Replace with) Select
mem.usertitle' : '');
$select_tables = "
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
" . ($ID_MEMBER != $yourid ? " AND mem.spy != $yourid" : '') . "


Code (Find this) Select
IF(mem.ID_GROUP = 0 OR mg.stars = '', pg.stars, mg.stars) AS stars, mem.passwordSalt";
$select_tables = "
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
" . ($ID_MEMBER != 1 ? " AND mem.spy != 1" : '') . "


Code (Replace with) Select
IF(mem.ID_GROUP = 0 OR mg.stars = '', pg.stars, mg.stars) AS stars, mem.passwordSalt";
$select_tables = "
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
" . ($ID_MEMBER != $yourid ? " AND mem.spy != $yourid" : '') . "


Open Profile.php:
Code (Find this) Select
if (($context['user']['is_owner'] && allowedTo('profile_identity_own') && $memID == 1) || allowedTo(array('profile_identity_any', 'manage_membergroups')) && $memID != 1)

Code (Replace with) Select
if (($context['user']['is_owner'] && allowedTo('profile_identity_own') && $memID == $yourid) || allowedTo(array('profile_identity_any', 'manage_membergroups')) && $memID != $yourid)


Code (Find this) Select
if (($context['user']['is_owner'] && allowedTo('profile_remove_own') && $memID != 1) || allowedTo('profile_remove_any') && $memID != 1)

Code (Replace with) Select
if (($context['user']['is_owner'] && allowedTo('profile_remove_own') && $memID != $yourid) || allowedTo('profile_remove_any') && $memID != $yourid)


Open BoardIndex.php:
Code (Find this) Select
if (!empty($row['spy']) && $context['user']['id'] != 1)
{
$context['num_spy']++;
continue;
}
elseif (empty($row['realName']))


Code (Replace with) Select
if (!empty($row['spy']) && $context['user']['id'] != $yourid)
{
$context['num_spy']++;
continue;
}
elseif (empty($row['realName']))



Code (Find this) Select
if ($row['spy'] == 1)
$link = $link . $txt['spy_stat'];

$is_buddy = in_array($row['ID_MEMBER'], $user_info['buddies']);


Code (Replace with) Select
if ($row['spy'] == $yourid)
$link = $link . $txt['spy_stat'];

$is_buddy = in_array($row['ID_MEMBER'], $user_info['buddies']);




Open Memberlist.template.php:
Code (Find this) Select
<td class="windowbg" align="left">', $member['link'], ' ', ($context['user']['id'] == '1' && $member['spy']) ? $txt['spy_stat'] : '', '</td>

Code (Replace with) Select
<td class="windowbg" align="left">', $member['link'], ' ', ($context['user']['id'] == '$yourid' && $member['spy']) ? $txt['spy_stat'] : '', '</td>



Open ManageBoards.template.php:
Code (Find this) Select
if (!$board['admin1'] || $context['user']['id'] == 1)

Code (Replace with) Select
if (!$board['admin1'] || $context['user']['id'] == $yourid)


Code (Find this) Select
if ($context['user']['id'] == 1)
echo '
<tr>
<td>
<b>', $txt['admin1_only'], '</b><br />
', $txt['admin1_desc'], '<br /><br />
</td>
<td valign="top" align="right">
<input type="checkbox" name="admin1" ', $context['board']['admin1'] ? ' checked="checked"' : '', ' class="check" />
</td>
</tr>';


Code (Replace with) Select
if ($context['user']['id'] == $yourid)
echo '
<tr>
<td>
<b>', $txt['admin1_only'], '</b><br />
', $txt['admin1_desc'], '<br /><br />
</td>
<td valign="top" align="right">
<input type="checkbox" name="admin1" ', $context['board']['admin1'] ? ' checked="checked"' : '', ' class="check" />
</td>
</tr>';




Open Profile.template.php:
Code (Find this) Select
<td>', $context['member']['name'], ' ',
$context['user']['is_admin'] ? '(' . $context['member']['id'] . ')' : '',
($context['user']['id'] == $yourid && $context['member']['spy'] == $yourid) ? $txt['spy_stat'] : '', '
</td>



Code (Find this) Select
<td>', $context['member']['spy'] == 1 && $context['user']['id'] != 1 ? $txt['never'] : $context['member']['last_login'], '</td>

Code (Replace with) Select
<td>', $context['member']['spy'] == $yourid && $context['user']['id'] != $yourid ? $txt['never'] : $context['member']['last_login'], '</td>


Code (Find this) Select
// Some more information.
echo '
</td>
</tr>';
if (!empty($context['member']['website']['url']))
echo '
<tr>
<td><b>', $txt[96], ': </b></td>
<td><a href="', $context['member']['website']['url'], '" target="_blank">', $context['member']['website']['title'], '</a></td>
</tr>';
echo '
<tr>
<td><b>', $txt[113], ' </b></td>
<td>';
if ($context['user']['id'] != 1 && $context['member']['spy'] == 1)
echo '<i>', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $settings['default_images_url'] . '/useroff.gif' . '" alt="' . $txt['online3'] . '" align="middle" />' : $txt['online3'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $txt['online3'] . '</span>' : '', '</i>';
else
echo '<i>', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '', '</i>';


Code (Replace with) Select
// Some more information.
echo '
</td>
</tr>';
if (!empty($context['member']['website']['url']))
echo '
<tr>
<td><b>', $txt[96], ': </b></td>
<td><a href="', $context['member']['website']['url'], '" target="_blank">', $context['member']['website']['title'], '</a></td>
</tr>';
echo '
<tr>
<td><b>', $txt[113], ' </b></td>
<td>';
if ($context['user']['id'] != $yourid && $context['member']['spy'] == $yourid)
echo '<i>', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $settings['default_images_url'] . '/useroff.gif' . '" alt="' . $txt['online3'] . '" align="middle" />' : $txt['online3'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $txt['online3'] . '</span>' : '', '</i>';
else
echo '<i>', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '', '</i>';



Code (Find this) Select
if ($context['member']['id'] == 1 && $context['user']['id'] != 1)
fatal_error($txt['no_way']);

// The main containing header.
echo '
<form action="', $scripturl, '?action=profile2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" onsubmit="return checkProfileSubmit();">


Code (Replace with) Select
if ($context['member']['id'] == $yourid && $context['user']['id'] != $yourid)
fatal_error($txt['no_way']);

// The main containing header.
echo '
<form action="', $scripturl, '?action=profile2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" onsubmit="return checkProfileSubmit();">



Code (Find this) Select
if (($context['allow_edit_membergroups'] && $context['user']['is_owner'] && $context['member']['group'] == 1) && $context['member']['id'] != 1)

Code (Replace with) Select
if (($context['allow_edit_membergroups'] && $context['user']['is_owner'] && $context['member']['group'] == $yourid) && $context['member']['id'] != $yourid)


Code (Find this) Select
// If deleting another account give them a lovely info box.
if ($context['member']['id'] == 1 && $context['user']['id'] != 1)
fatal_error($txt['no_way']);


Code (Replace with) Select
// If deleting another account give them a lovely info box.
if ($context['member']['id'] == $yourid && $context['user']['id'] != $yourid)
fatal_error($txt['no_way']);




Open Who.template.php:
Code (Find this) Select
if (!$member['spy'] || $context['user']['id'] == 1)

Code (Replace with) Select
if (!$member['spy'] || $context['user']['id'] == $yourid)



If you want you can alter the language files.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

N3RVE

Nice mod Johny ;)
Great work Eliana :)

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

Adish - (F.L.A.M.E.R)

#8
@ Eliana Tamerin

I did all the edits you told me to do, but yet the option doesnt show up in Account Related Settings.

Any file that you might have missed which I have to edit ?

I have also checked that the number 1 account has been deleted. I mean the admin account who owned the site long back.

So any way to make myself the user 1 ? I am at the moment the user 9

Thank you for your time to help me out.

Eliana Tamerin

LOL, you could have said that! Just change your user ID in the database.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Adish - (F.L.A.M.E.R)

oh seriously.. was that it ? If i would have changed my user ID in database, everything yould have worked well ?

ccbtimewiz

Quote from: Eliana Tamerin on August 05, 2008, 09:22:05 PM
LOL, you could have said that! Just change your user ID in the database.

Bad idea. It would be hell to have to update every single table to preappend his new ID.

Eliana Tamerin

Oh, true. But i dunno. The mod was made for User Numero Uno. Guess JB will have to put his head to it.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Adish - (F.L.A.M.E.R)

So well.. No new ideas as such ? That can change the user ID ? I changed all the "1" to "9" in all the edits you asked me.

Actually it is not that important as i have set permissions that users can delete their own account only. Only me as the owner a.k.a admin of the site can delete other accounts. But yet securing other accounts is somewhat a good idea.

Why do these type of problems come to me..!! :(

Tell me if anything is possible.

Thank you.

Nathaniel

Just remember that you will probably need to alter most other tables in smf, because there are a lot of tables that use the 'ID_MEMBER' column. You will have to have those values for every table that uses that column, or there will be major errors.

Queries like this will work (for SMF 1.1.5, use id_member for SMF 2 Beta):
QuoteUPDATE {$db_prefix}table
SET ID_MEMBER = '1'
WHERE ID_MEMBER = '9'

You will have to run that query, quite a few times. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Eliana Tamerin

I can think of a few, like messages, boards, topics, PM, PM recipients, members, log_*, etc.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Nathaniel

Indeed, you will have to run these other queries as well, for specific tables:
QuoteUPDATE {$db_prefix}topics
SET ID_MEMBER_STARTED = '1'
WHERE ID_MEMBER_STARTED = '9'
QuoteUPDATE {$db_prefix}topics
SET ID_MEMBER_UPDATED = '1'
WHERE ID_MEMBER_UPDATED = '9'
QuoteUPDATE {$db_prefix}personal_messages
SET ID_MEMBER_FROM= '1'
WHERE ID_MEMBER_FROM = '9'

They are the only extra queries apart from the 'ID_MEMBER' ones that I could find for SMF 1.1.5.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Adish - (F.L.A.M.E.R)

Everything is going bumper.. Isnt there a easy way out ?

butchs

Nice mod!  Love it...
8)
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

christicehurst

A great mod that evens the odds with other forum software. Great work!
www.brisbanelionsunited.com - A forum for everyone!

Advertisement: