function fun_getAdminUserInfo($auID = 0, $auUsername = '') { $sql = $sqlCheck = "SELECT * FROM " . TABLE_ADMINS_USERS; if ($auUsername == "") { $sql .= " WHERE au_id='" . (int) $auID . "'"; } else { $sql .= " WHERE au_username='******'"; } $result = $this->dbObj->fun_db_query($sql) or die("<font color='#ff0000' face='verdana' size='2'>Error: Unable to execute request!</font>"); $rowsAdmin = $this->dbObj->fun_db_fetch_rs_object($result); $adminArray = array("au_id" => fun_db_output($rowsAdmin->au_id), "au_username" => fun_db_output($rowsAdmin->au_username), "au_password" => fun_db_output($rowsAdmin->au_password), "au_email_id" => fun_db_output($rowsAdmin->au_email_id), "au_fname" => fun_db_output($rowsAdmin->au_fname), "au_lname" => fun_db_output($rowsAdmin->au_lname), "au_type" => fun_db_output($rowsAdmin->au_type), "au_can_add" => fun_db_output($rowsAdmin->au_can_add), "au_can_edit" => fun_db_output($rowsAdmin->au_can_edit), "au_can_delete" => fun_db_output($rowsAdmin->au_can_delete), "au_can_view" => fun_db_output($rowsAdmin->au_can_view), "au_activate" => fun_db_output($rowsAdmin->au_activate), "au_deactive" => fun_db_output($rowsAdmin->au_deactive), "al_au_id" => fun_db_output($rowsAdmin->al_au_id), "au_status" => fun_db_output($rowsAdmin->au_status), "au_last_modified" => fun_db_output($rowsAdmin->au_last_modified), "au_added_date" => fun_db_output($rowsAdmin->au_added_date), "au_site_perm" => fun_db_output($rowsAdmin->au_site_perm), "au_store_perm" => fun_db_output($rowsAdmin->au_store_perm)); $this->dbObj->fun_db_free_resultset($result); return $adminArray; }
<?php require_once "includes/application-top.php"; $objAdmin = new Admins(); $adminUname = fun_db_output($_POST['username']); $adminPass = fun_db_output($_POST['password']); if ($objAdmin->fun_verify_admins($adminUname, md5($adminPass))) { $adminInfo = $objAdmin->fun_getAdminUserInfo(0, $adminUname); if (sizeof($adminInfo)) { if ($adminInfo['status'] == "1") { $_SESSION['session_admin_userid'] = $adminInfo['id']; $_SESSION['session_admin_username'] = $adminInfo['username']; $_SESSION['session_admin_password'] = $adminInfo['password']; $_SESSION['session_admin_type'] = $adminInfo['type']; redirectURL(SITE_ADMIN_URL . "profile.php"); } else { unset($_SESSION['session_admin_userid']); unset($_SESSION['session_admin_username']); unset($_SESSION['session_admin_password']); $_SESSION['msg'] = 'You account has been suspended due to some reason!'; redirectURL(SITE_ADMIN_URL . "profile-login.php"); } } else { $_SESSION['msg'] = 'Invalid username or password!'; redirectURL(SITE_ADMIN_URL . "profile-login.php"); } } else { $_SESSION['msg'] = 'Invalid username or password!'; redirectURL(SITE_ADMIN_URL . "profile-login.php"); }
function fun_getAdminUserInfo($auID = 0, $auUsername = '') { $sql = $sqlCheck = "SELECT * FROM " . TABLE_USERS; if ($auUsername == "") { $sql .= " WHERE id='" . (int) $auID . "'"; } else { $sql .= " WHERE username='******'"; } $result = $this->dbObj->fun_db_query($sql) or die("<font color='#ff0000' face='verdana' size='2'>Error: Unable to execute request!</font>"); $rowsAdmin = $this->dbObj->fun_db_fetch_rs_object($result); $adminArray = array("id" => fun_db_output($rowsAdmin->id), "username" => fun_db_output($rowsAdmin->username), "password" => fun_db_output($rowsAdmin->password), "email" => fun_db_output($rowsAdmin->email), "name" => fun_db_output($rowsAdmin->name), "status" => fun_db_output($rowsAdmin->status), "type" => fun_db_output($rowsAdmin->type), "add_date" => fun_db_output($rowsAdmin->add_date)); $this->dbObj->fun_db_free_resultset($result); return $adminArray; }