|
 | | |
| Autor | Správa |
JanoF
 Správca fóra
 Založený: 01.05.2005 Príspevky: 8736 Bydlisko: Bratislava Vek: 27
 | Zaslal: So 14.10.06 14:55 |   |
| kód: | ###############################################
## 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 ]--------------------------
#
#End |
|
_________________ Skrinka: Nexus Morpho & Enermax UCTB12P | Zdroj: Enermax EMG800AWT 800W | Základná doska: Asus Rampage III Gene | Procesor: Intel Core i7 990X Extreme Edition 3.46 GHz & Scythe Susanoo SCSO-1000 | Pamäť: Kingston HyperX XMP 24 GB DDR3 1600 MHz | Grafická karta: Asus GeForce GT 440 1 GB DDR3 & Thermalright HR-03 | Pevný disk: Intel SSD 510 Series 250 GB & Hitachi Deskstar 5K4000 4000 GB | Optická mechanika: Plextor PX-820SA | Čítačka kariet: Akasa AK-ICR-11 | Klávesnica: Logitech G19 | Myš: Logitech G9x & Razer Kabuto | Monitor: 24" LCD Eizo FlexScan S2431WE | Reproduktory: Logitech Z-2300 | Operačný systém: Microsoft Windows 7 & FreeBSD 9 | Záložný zdroj: APC Back-UPS ES 700 | Spotreba: Idle - 200W / Burn - 400W | Mobil: Nokia N9 64 GB | |
       |
 |
|
Nemôžete pridávať nové témy do tohto fóra. Nemôžete odpovedať na témy v tomto fóre. Nemôžete upravovať svoje príspevky v tomto fóre. Nemôžete mazať svoje príspevky v tomto fóre. Nemôžete hlasovať v tomto fóre.
|
| |