|
|
|
|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 70
Members: 0
Total: 70
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
codelock decrypt |
|
Posted: Sat Nov 07, 2009 1:32 pm |
|
|
latrans |
Beginner |
|
|
Joined: Nov 07, 2009 |
Posts: 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Posted: Sat Nov 07, 2009 2:07 pm |
|
|
zerobytes |
Valuable expert |
|
|
Joined: Aug 30, 2008 |
Posts: 199 |
|
|
|
|
|
|
|
Code: |
<?php
// governor 5 user limit
function governor($force = 0) {
global $database, $language, $screen, $page;
include('compatibility/superglobals.inc.php');
$limit = 5;
// initial config
if (!isset($_SESSION["tp_users_ok"]) || $_SESSION["tp_users_ok"] == 0) {
$result = mysql_query("SELECT * FROM $database->table_users");
if ($result) {
if (mysql_num_rows($result) > $limit) {
$page->msgs[] = new msg("error"
,$language->messages["err_user_limit"]
);
$page->add_flag("hide");
$_SESSION["tp_users_ok"] = 0;
}
else {
$_SESSION["tp_users_ok"] = 1;
}
}
}
// admin screen
if ($screen == 'admin' && $_SESSION["tp"]->user->access->user_new == 1) {
$result = mysql_query("SELECT * FROM $database->table_users");
if ($result) {
$count = mysql_num_rows($result);
if ($count > $limit) {
$page->msgs[] = new msg("error"
,$language->messages["err_user_limit"]
);
$page->add_flag("hide");
$_SESSION["tp_users_ok"] = 0;
}
else if ($count == $limit) {
$page->msgs[] = new msg("info"
,$language->messages["warn_user_limit"]
);
$page->add_flag("max_users");
}
else {
if ($limit - $count < 3) {
$page->msgs[] = new msg("info"
,$language->variable($language->messages["user_limit"]
,($limit - $count)
)
);
}
}
}
}
// user screen
if ($screen == 'user' && empty($_REQUEST["id"])) {
$result = mysql_query("SELECT * FROM $database->table_users");
if ($result) {
$count = mysql_num_rows($result);
if ($count > $limit) {
$page->msgs[] = new msg("error"
,$language->messages["err_user_limit"]
);
$page->add_flag("hide");
$_SESSION["tp_users_ok"] = 0;
}
else if ($count == $limit) {
$page->msgs[] = new msg("warning"
,$language->messages["warn_user_limit"]
);
$page->add_flag("max_users");
$page->add_flag("hide");
}
}
}
// forced
if ($force == 1) {
$_SESSION["tp_users_ok"] = 1;
$result = mysql_query("SELECT * FROM $database->table_users");
if ($result) {
$count = mysql_num_rows($result);
if ($count > $limit) {
$page->msgs[] = new msg("error"
,$language->messages["err_user_limit"]
);
$page->add_flag("hide");
$_SESSION["tp_users_ok"] = 0;
}
else if ($count == $limit) {
$page->msgs[] = new msg("info"
,$language->messages["warn_user_limit"]
);
$page->add_flag("max_users");
}
else {
if ($limit - $count < 3) {
$page->msgs[] = new msg("info"
,$language->variable($language->messages["user_limit"]
,($limit - $count)
)
);
}
}
}
}
}
?> |
ZeroBytes |
|
_________________ Decoded by ASD @ Lost-codes.co.uk |
|
|
|
|
|
|
|
Posted: Sat Nov 07, 2009 2:16 pm |
|
|
latrans |
Beginner |
|
|
Joined: Nov 07, 2009 |
Posts: 2 |
|
|
|
|
|
|
|
very awesome, thanks mate! |
|
|
|
|
www.waraxe.us Forum Index -> PHP script decode requests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|
|