Example #1
0
 public function validateAccess($eusername, $id, $rand)
 {
     if (false === ($log = GWF_AuditLog::getByID($id))) {
         return $this->module->error('err_log');
     }
     if ($log->getVar('al_eusername') !== $eusername || $log->getVar('al_rand') !== $rand) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     $this->log = $log;
     return false;
 }
Example #2
0
 public function execute()
 {
     if (false === ($id = Common::getGetInt('id', false))) {
         return GWF_HTML::err('ERR_PARAMETER', array(__FILE__, __LINE__, 'id'));
     }
     if (false === ($log = GWF_AuditLog::getByID($id))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     GWF_Website::plaintext();
     die($log->getVar('al_data'));
 }
Example #3
0
 private static function parseSudoDestroyed(Module_Audit $module, $row)
 {
     $data = explode(':', trim($row));
     if (count($data) !== 3) {
         return self::error('Invalid row: ' . $row);
     }
     if (false === ($log = GWF_AuditLog::getByID($data[1]))) {
         echo GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
         return false;
     }
     self::notice('Destroy session' . $log->getID());
     if (false === self::copySudoDestroyed($module, $log)) {
         return false;
     }
     if (false === $log->saveVar('al_time_end', time())) {
         echo GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
         return false;
     }
     return self::sendMails($module, $log, 2);
 }