FLT = $LL; $this->USERID = 1; } function SysLog( $CMD, $LVL, $Dataset = '' ){ global $DATABASE; if( $this->USERID < 2 ) return; if( ( $LVL & $this->FLT ) == $LVL ){ if( $Dataset == '' ){ $QS = "INSERT INTO `access_log` SET `user_id`={$this->USERID}, `ts`=NOW(), `cmd`={$CMD}"; } else { $DS = $DATABASE->escape( json_encode( $Dataset ) ); $QS = "INSERT INTO `access_log` SET `user_id`={$this->USERID}, `ts`=NOW(), `cmd`={$CMD}, `dataset`='{$DS}'"; }; $DATABASE->Query( $QS ); }; } function SetUID( $UID ){ $this->USERID = $UID; } function ScreenChanges( $OW, $OH, $NW, $NH ){ $Dataset['old']=array( 'width'=>$OW, 'height'=>$OH ); $Dataset['new']=array( 'width'=>$NW, 'height'=>$NH ); $this->SysLog( ACTION_SCREEN_RESIZE, LOG_LVL_INFO, $Dataset ); } function login(){ $this->SysLog( ACTION_LOGIN, LOG_LVL_INFO ); } function logout(){ $this->SysLog( ACTION_LOGOUT, LOG_LVL_INFO ); } function login_failure($Login,$Password,$UserID,$Session){ $Dataset=array(); $this->SysLog( ACTION_FAILED_LOGIN, LOG_LVL_SECURITY ); } }; ?>