mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
Code cleanup and optimization
This commit is contained in:
@@ -64,8 +64,8 @@ if (isset($_POST['edit_admin']) || $action == "edit")
|
||||
{
|
||||
$edid = array_keys($_POST['edit_admin']);
|
||||
$theid = intval(($sub_action < 0) ? $edid[0] : $sub_action);
|
||||
if ((!$sql->db_Select("user", "*", "user_id=".$theid))
|
||||
|| !($row = $sql->db_Fetch()))
|
||||
if ((!$sql->select("user", "*", "user_id=".$theid))
|
||||
|| !($row = $sql->fetch()))
|
||||
{
|
||||
$mes->addDebug("Couldn't find user ID: {$theid}, {$sub_action}, {$edid[0]}"); // Debug code - shouldn't be executed
|
||||
}
|
||||
@@ -76,8 +76,8 @@ if (isset($_POST['del_admin']) && count($_POST['del_admin']))
|
||||
{
|
||||
$delid = array_keys($_POST['del_admin']);
|
||||
$aID = intval($delid[0]);
|
||||
$sql->db_Select("user", "*", "user_id= ".$aID);
|
||||
$row = $sql->db_Fetch();
|
||||
$sql->select("user", "*", "user_id= ".$aID);
|
||||
$row = $sql->fetch();
|
||||
|
||||
if ($row['user_id'] == 1)
|
||||
{ // Can't delete main admin
|
||||
@@ -92,7 +92,7 @@ if (isset($_POST['del_admin']) && count($_POST['del_admin']))
|
||||
exit;
|
||||
}
|
||||
|
||||
$mes->addAuto($sql -> db_Update("user", "user_admin=0, user_perms='' WHERE user_id= ".$aID), 'update', ADMSLAN_61, LAN_DELETED_FAILED, false);
|
||||
$mes->addAuto($sql->update("user", "user_admin=0, user_perms='' WHERE user_id= ".$aID), 'update', ADMSLAN_61, LAN_DELETED_FAILED, false);
|
||||
$logMsg = str_replace(array('[x]', '[y]'),array($aID, $row['user_name']),ADMSLAN_73);
|
||||
e107::getLog()->add('ADMIN_02',$logMsg,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
Reference in New Issue
Block a user