optimized the 'check_rights()' function
This commit is contained in:
@@ -11,6 +11,7 @@ $Source$
|
|||||||
main.php3; sql.php3; tbl_properties.php3; tbl_select.php3;
|
main.php3; sql.php3; tbl_properties.php3; tbl_select.php3;
|
||||||
tbl_replace.php3: the $server variable do not need to be urlencoded (it's
|
tbl_replace.php3: the $server variable do not need to be urlencoded (it's
|
||||||
an integer).
|
an integer).
|
||||||
|
* user_details.php3: optimized the 'check_rights()' function.
|
||||||
|
|
||||||
2001-08-28 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
2001-08-28 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||||
* lang/galician.inc.php3, select_lang.inc.php3: new Galician lang thanks to
|
* lang/galician.inc.php3, select_lang.inc.php3: new Galician lang thanks to
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
/* $Id$*/
|
/* $Id$*/
|
||||||
|
|
||||||
|
|
||||||
require("./grab_globals.inc.php3");
|
require('./grab_globals.inc.php3');
|
||||||
require("./lib.inc.php3");
|
require('./lib.inc.php3');
|
||||||
|
|
||||||
function check_operations()
|
function check_operations()
|
||||||
{
|
{
|
||||||
@@ -672,15 +672,23 @@ function edit_operations($host, $user)
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the current user is a super-user or not
|
||||||
|
*
|
||||||
|
* @return boolean true as soon as the current user is super-user, no return
|
||||||
|
* else
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
function check_rights()
|
function check_rights()
|
||||||
{
|
{
|
||||||
global $strNoRights;
|
$result = @mysql_query('USE mysql');
|
||||||
|
if (mysql_error()) {
|
||||||
$result = mysql_query("SELECT * FROM mysql.user");
|
mysql_die($GLOBALS['strNoRights']);
|
||||||
$rows = @mysql_num_rows($result);
|
}
|
||||||
|
|
||||||
if (!isset($rows)) mysql_die($strNoRights);
|
return true;
|
||||||
}
|
} // end of the 'check_rights()' function
|
||||||
|
|
||||||
|
|
||||||
function table_users($host = FALSE, $user = FALSE)
|
function table_users($host = FALSE, $user = FALSE)
|
||||||
@@ -814,7 +822,7 @@ function confirm() {
|
|||||||
|
|
||||||
if(!isset($message))
|
if(!isset($message))
|
||||||
{
|
{
|
||||||
include("./header.inc.php3");
|
include('./header.inc.php3');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -882,6 +890,6 @@ if (isset($edit) && $edit) { # Edit an user
|
|||||||
normal_operations();
|
normal_operations();
|
||||||
}
|
}
|
||||||
|
|
||||||
require("./footer.inc.php3");
|
require('./footer.inc.php3');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user