Nightmare EasyPHPBB Expert
Joined: 26 Mar 2005 Posts: 378 Location: Canada
|
Posted: Fri Jun 23, 2006 11:10 pm Post subject: keep the MAIN admin |
|
|
these mods lets you keep the first admin (the username when you made the forum) admin.
Code: |
###############################################
## Hack Title: Main Admin Security
## Hack Version: 1.1.0
## Author: Aiencran
## Description: This hack gives some extra security to the main administrator.
## - The other administrators can't delete the Main Admin
## - They can't change his profile
## - They can't change his user level to simple user
## Compatibility: 2.0.10
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: 4
## admin/admin_ug_auth.php,
## admin/admin_users.php,
## language/lang_english/lang_admin.php,
## language/lang_italian/lang_admin.php
##
## Included Files: None
##
## History:
## 2004-08-21 - Version 1.1.0
## - Added Main Admin's profile security
##
## 2004-08-14 - Version 1.0.0
## - First version
##
## Author Notes:
## In this MOD I supposed that Main Admin's user_id is 2. Feel free to changhe '2' with the id of your MainAdmin.
##
## Support: None
## Copyright: ©2004 Main Admin Security 1.1.0 - Aiencran
##
###############################################
## You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
## Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
## This hack is released under the GPL License.
## This hack can be freely used, but not distributed, without permission.
## Intellectual Property is retained by the hack author(s) listed above.
###############################################
#
#-----[ OPEN ]------------------------------------------
#
/language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------
#
$lang['Main_Admin_Undeleted'] = 'Main Admin can\'t be deleted!';
$lang['Main_Admin_Unchanged_Profile'] = 'You can\'t modify Main Admin\'s profile!';
$lang['Main_Admin_Unchanged_Level'] = 'Main Admin can\'t become a simple user!';
#
#-----[ OPEN ]------------------------------------------
#
/language/lang_italian/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------
#
$lang['Main_Admin_Undeleted'] = 'L\'amministratore principale non puņ essere cancellato!';
$lang['Main_Admin_Unchanged_Profile'] = 'Non puoi modificare il profilo dell\'amministratore principale!';
$lang['Main_Admin_Unchanged_Level'] = 'L\'amministratore principale non puņ diventare un semplice utente!';
#
#-----[ OPEN ]------------------------------------------
#
/admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
if( $HTTP_POST_VARS['deleteuser'] )
#
#-----[ REPLACE WITH ]------------------------------------------
#
//
// Main Admin can't be deleted
//
if( $HTTP_POST_VARS['deleteuser'] && $user_id == 2)
{
message_die(GENERAL_ERROR, $lang['Main_Admin_Undeleted'] );
}
if( $HTTP_POST_VARS['deleteuser'] && $user_id != 2)
#
#-----[ FIND ]------------------------------------------
#
$username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username']))) : '';
#
#-----[ BEFORE, ADD ]------------------------------------
#
//
// Main Admin's profile can't be modified
//
if ( $user_id == 2 && $userdata['user_id'] != 2 )
{
message_die(GENERAL_ERROR, $lang['Main_Admin_Unchanged_Profile'] );
}
#
#-----[ OPEN ]------------------------------------------
#
/admin/admin_ug_auth.php
#
#-----[ FIND ]------------------------------------------
#
//
// Make admin a user (if already admin) ... ignore if you're trying
// to change yourself from an admin to user!
//
if ( $userdata['user_id'] != $user_id )
#
#-----[ REPLACE WITH ]------------------------------------------
#
//
// Make admin a user (if already admin) ... ignore if you're trying
// to change yourself from an admin to user!
//
if ( $user_id == 2 )
{
message_die(GENERAL_ERROR, $lang['Main_Admin_Unchanged_Level'] );
}
else if ( $userdata['user_id'] != $user_id )
#
#-----[ SAVE & CLOSE ALL FILES ]--------------------------
#
# EoM
|
if you don't have the italian language package you don't have to add it to get this MOD working. ^_^
NOTE: they can delete the main admin if they use the userlist mod.
Code: |
#################################################################
## Hack Title: Auto Un-ban Main Admin
## Hack Version: 1.0.0
## Author: Nivisec < nivisec@hotmail.com > - http://nivisec.com/mods/
## Description: This will not prevent the banning of the first super
## admin, but will unban this user (if banned) on each
## page load.
##
## Installation Level: easy
## Installation Time: 2 Minutes
## Files To Edit: common.php
## Included Files: n/a
#################################################################
##
## Author Note:
## None.
##
#################################################################
## Before Adding This Hack To Your Forum, You Should Back Up All Files Related To This Hack
#################################################################
## Example Page: n/a
## Discussion Forum: http://nivisec.com/mods/viewforum.php?f=7
#################################################################
#
#-----[ OPEN ]------------------------------------------
#
/common.php
#
#-----[ FIND ]------------------------------------------
#
//
// Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
{
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Delete Main Admin Ban
//
$sql = "DELETE FROM " . BANLIST_TABLE . "
WHERE ban_userid = 2";
if (!$db->sql_query($sql))
{
message_die(GENERAL_MESSAGE, 'Unable to access the Banlist Table.');
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|
when they ban the main admin's name they will get a message saying Ban list has been updated but if you look if the username is banned, you won't be able to fine it .
hope you add theses MODs to the hosted forums cause theses are good mods and will stop people when getting admin to take over the forum. theses mods do not take much time to add. _________________ EasyPHPBB Support Mod from 07/07/05 to 01/14/07.
If you need help please contact EasyPHPBB with your problem. |
|