create new display class, fixed and added same new feature
This commit is contained in:
+3
-5
@@ -38,7 +38,7 @@ final class Auth {
|
||||
}
|
||||
|
||||
public function user_data($user) {
|
||||
$adata = array();
|
||||
$adata = [];
|
||||
$this->__db->Query("SELECT *,DECODE(Menu,'".$this->__id_reg."') Menu2 FROM app_operator WHERE Username='".$this->__db->SafeSQL($user)."'");
|
||||
if ($this->__db->Next()) {
|
||||
$adata = $this->__db->AllRow();
|
||||
@@ -50,14 +50,14 @@ final class Auth {
|
||||
$_SESSION['APP_TOKEN'] = $_token;
|
||||
$this->__db->Query("INSERT INTO app_token SET Token='".$_token."',UserID='".$adata['UserID']."',IP='".$_SERVER['REMOTE_ADDR']."'");
|
||||
}
|
||||
if (intval($adata['Grup_MenuID']) > 0) $adata['Menu_Grup'] = $this->user_allmenu($adata['Grup_MenuID']);
|
||||
$adata['UNIX'] = time();
|
||||
$adata['LOCALE'] = $_SESSION['__WEB_APP']['DEF_LOCALE'];
|
||||
return $adata;
|
||||
}
|
||||
|
||||
public function gen_module_menu() {
|
||||
$amodul = array();
|
||||
$aallow = array();
|
||||
$amodul = []; $aallow = [];
|
||||
if ($_SESSION['__WEB_APP']['APP_MODULE']) {
|
||||
$this->__db->Query("SELECT * FROM app_menu_grup WHERE Grup_MenuID='".$_SESSION['__WEB_USER']['Grup_MenuID']."' LIMIT 1");
|
||||
if ($this->__db->Next()) $aallow = ($this->__db->Row("Modul_Akses")=="") ? array() : explode(",", $this->__db->Row("Modul_Akses"));
|
||||
@@ -94,8 +94,6 @@ final class Auth {
|
||||
if (count($a_hasil) > 0) {
|
||||
$this->__db->Query("UPDATE app_operator SET Last_IP='".$a_hasil['Last_IP']."',Last_Date='".$a_hasil['Last_Date']."' WHERE UserID='".user_id()."'");
|
||||
}
|
||||
//$tgl_lalu = tgl_sql2str(tgl_operasi(tgl_dmy(), 0, -3));
|
||||
//$this->__db->Query("DELETE FROM app_logs WHERE UserID='".user_id()."' AND Last_Date<'".$tgl_lalu."'");
|
||||
$this->__db->Query("INSERT IGNORE INTO app_logs SELECT UserID,Token,IP,DateStamp FROM app_token WHERE Token='".$_SESSION['APP_TOKEN']."'");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user