Esempio n. 1
0
 public function actionReset($id)
 {
     $model = $this->loadModel($id);
     $model->counter = 0;
     if ($model->save()) {
         foreach ($model->AE as $ae) {
             $s = Syslog::model()->findByPk($ae->archive_id);
             if ($s) {
                 $s->delete();
             }
         }
         $this->redirect(array('view', 'id' => $model->id));
     }
 }
Esempio n. 2
0
 public function login()
 {
     if ($this->_identity === null) {
         $this->_identity = new UserIdentity($this->username, $this->password);
         $this->_identity->authenticate();
     }
     if ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {
         $duration = $this->rememberMe ? 3600 * 24 * 30 : 0;
         // 30 дней
         Yii::app()->user->login($this->_identity, $duration);
         Syslog::add(Logs::LOG_LOGIN, $this->username . ' успешно авторизовался');
         return true;
     } else {
         return false;
     }
 }
 /**
  * Creates a new model .
  *
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionFromsyslog($syslog_id)
 {
     $entry = Syslog::model()->findByPk($syslog_id);
     $model = new Whitelist();
     $model->host = $entry->hostip;
     $model->facility = $entry->facility;
     $model->level = $entry->level;
     $model->program = $entry->program;
     $model->pattern = addcslashes($entry->msg, '\\');
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Whitelist'])) {
         $model->attributes = $_POST['Whitelist'];
         if ($model->save()) {
             $this->redirect(array('/syslog/logs/admin'));
         }
     }
     $this->render('create', array('model' => $model));
 }
 /**
  * Creates a new model based on a specific message from Syslog.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionFromsyslog($syslog_id)
 {
     $entry = Syslog::model()->findByPk($syslog_id);
     $model = new AbuserTrigger();
     $model->facility = $entry->facility;
     $model->severity = $entry->level;
     $model->program = $entry->program;
     $model->msg = addcslashes($entry->msg, '\\');
     $model->pattern = '/^(.*?)/';
     $model->grouping = 1;
     $model->capture = 1;
     $model->occurrence = 1;
     $model->priority = 1;
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['AbuserTrigger'])) {
         $model->attributes = $_POST['AbuserTrigger'];
         if ($model->save()) {
             $this->redirect(array('/syslog/logs/admin'));
         }
     }
     $this->render('create', array('model' => $model));
 }
Esempio n. 5
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * 
  * @param
  *          integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
   $model = Syslog::model ()->findByPk ( $id );
   if ($model === null)
     throw new CHttpException ( 404, 'The requested page does not exist.' );
   return $model;
 }
Esempio n. 6
0
 public function afterDelete()
 {
     AdminsServers::model()->deleteAllByAttributes(array('admin_id' => $this->id));
     Syslog::add(Logs::LOG_DELETED, 'Удален AmxModX админ <strong>' . $this->nickname . '</strong>');
     return parent::afterDelete();
 }
Esempio n. 7
0
 public function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удален комментарий к бану <strong>' . $this->bid . '</strong>, написанный пользователем <strong>' . $this->name . '</strong>');
     return parent::afterDelete();
 }
Esempio n. 8
0
 public function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удален уровень веб админов № <strong>' . $this->level . '</strong>');
     return parent::afterDelete();
 }
Esempio n. 9
0
 public function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удален веб админ <strong>' . $this->username . '</strong>');
     return parent::afterDelete();
 }
Esempio n. 10
0
 public function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удалена запись системного лога № <strong>' . $this->id . '</strong>, зафиксированная за админом strong>' . $this->username . '</strong>');
     return parent::afterDelete();
 }
Esempio n. 11
0
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
  */
 public function search()
 {
     // Warning: Please modify the following code to remove attributes that
     // should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id, true);
     $criteria->compare('host', $this->host, true);
     $criteria->compare('inet_ntoa(host)', $this->hostip, true);
     $criteria->compare('facility', $this->facility);
     $criteria->compare('priority', $this->priority);
     $criteria->compare('level', $this->level);
     $criteria->compare('program', $this->program, true);
     $criteria->compare('pid', $this->pid, true);
     $criteria->compare('tag', $this->tag, true);
     $criteria->compare('msg', $this->msg, true);
     $criteria->compare('received_ts', $this->received_ts, true);
     $criteria->compare('created_at', $this->created_at, true);
     if (Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']) == 0) {
         $pagination = false;
     } else {
         $pagination = array('pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']));
     }
     if ($this->acknowledge !== false) {
         Syslog::model()->deleteAll($criteria->condition, $criteria->params);
         $this->unsetAttributes();
         return new CActiveDataProvider($this, array('sort' => array('defaultOrder' => 'received_ts DESC', 'attributes' => array('hostip' => array('asc' => 'inet_ntoa(host)', 'desc' => 'inet_ntoa(host) DESC'), '*')), 'pagination' => $pagination));
     }
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => array('defaultOrder' => 'received_ts DESC', 'attributes' => array('hostip' => array('asc' => 'inet_ntoa(host)', 'desc' => 'inet_ntoa(host) DESC'), '*')), 'pagination' => $pagination));
 }
Esempio n. 12
0
 public function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удален бан игрока <strong>' . $this->player_nick . '</strong>');
     return parent::afterDelete();
 }
Esempio n. 13
0
 public function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удалена причина банов <strong>' . $this->reason . '</strong>');
     return parent::afterDelete();
 }
Esempio n. 14
0
 public function afterSave()
 {
     if (!$this->isNewRecord) {
         Syslog::add(Logs::LOG_EDITED, 'Изменены настройки сайта');
     }
     Yii::app()->cache->delete('web_cfg');
     return parent::afterSave();
 }
Esempio n. 15
0
 public function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удалена ссылка <strong>' . $this->id . '</strong>');
     return parent::afterDelete();
 }
Esempio n. 16
0
 protected function afterDelete()
 {
     Syslog::add(Logs::LOG_DELETED, 'Удален файл <strong>' . $this->demo_real . '</strong> к бану № <strong>' . $this->bid . '</strong>');
     return parent::afterDelete();
 }
Esempio n. 17
0
}
//END OF if($returnType_a=="LeafClass")
// else if($returnType_a=="LeafClass" && $returnComposedObjects_a=="true")
// {
// 	#### SI NODI CLASSIFICATION
//
//
//
// }//END OF if($returnType_a=="LeafClass" && $returnComposedObjects_a=="true")
// ATNA Stored Query
if ($ATNA_active == 'A') {
    $today = date("Y-m-d");
    $cur_hour = date("H:i:s");
    $datetime = $today . "T" . $cur_hour;
    require_once './lib/syslog.php';
    $syslog = new Syslog();
    $message_query = "<AuditMessage xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"healthcare-security-audit.xsd\">\n\t\t<EventIdentification EventActionCode=\"E\" EventDateTime=\"{$datetime}\" EventOutcomeIndicator=\"0\">\n\t\t\t<EventID code=\"110112\" codeSystemName=\"DCM\" displayName=\"Query\"/>\n\t\t\t<EventTypeCode code=\"ITI-18\" codeSystemName=\"IHE Transactions\" displayName=\"Registry Stored Query\"/>\n\t\t</EventIdentification>\n\t\t<AuditSourceIdentification AuditSourceID=\"MARIS REGISTRY\"/>\n\t\t\t<ActiveParticipant UserID=\"Consumer\" NetworkAccessPointTypeCode=\"2\" NetworkAccessPointID=\"" . $_SERVER['REMOTE_ADDR'] . "\"  UserIsRequestor=\"true\">\n        \t\t<RoleIDCode code=\"110153\" codeSystemName=\"DCM\" displayName=\"Source\"/>\n\t\t</ActiveParticipant>\n\t\t<ActiveParticipant UserID=\"" . $http_protocol . $ip_server . ":" . $port_server . $www_REG_path . "\" NetworkAccessPointTypeCode=\"2\" NetworkAccessPointID=\"" . $reg_host . "\"  UserIsRequestor=\"false\">\n        \t\t<RoleIDCode code=\"110152\" codeSystemName=\"DCM\" displayName=\"Destination\"/>\n    \t\t</ActiveParticipant>\n\t\t<ParticipantObjectIdentification ParticipantObjectID=\"empty\" ParticipantObjectTypeCode=\"2\" ParticipantObjectTypeCodeRole=\"24\">\n        \t\t<ParticipantObjectIDTypeCode code=\"ITI-16\" codeSystemName=\"IHE Transactions\" displayName=\"Registry Stored Query\"/>\n\t\t<ParticipantObjectQuery>" . base64_encode($SQLQuery_ESEGUITA) . "</ParticipantObjectQuery>    \t</ParticipantObjectIdentification>\n\t\t</AuditMessage>";
    // ParticipantObjectID da TF deve essere vuoto ma non valida da syslog nist
    //manca la parte relativa al recupero del patientID.  <ParticipantObjectIdentification ParticipantObjectID=\"".trim($patient_id)."\" ParticipantObjectTypeCode=\"1\" ParticipantObjectTypeCodeRole=\"1\"><ParticipantObjectIDTypeCode code=\"2\"/></ParticipantObjectIdentification>
    $logSyslog = $syslog->Send($ATNA_host, $ATNA_port, $message_query);
    writeTimeFile($idfile . "--StoredQuery: Ho spedito il messaggio di ATNA");
}
// Fine if($ATNA_active=='A')
//Statistiche
if ($statActive == "A") {
    //Parte per calcolare i tempi di esecuzione
    $mtime = microtime();
    $mtime = explode(" ", $mtime);
    $mtime = $mtime[1] + $mtime[0];
    $endtime = $mtime;
    $totaltime = number_format($endtime - $starttime, 15);
Esempio n. 18
0
        print fread($file, 1024 * 8);
        // flush();//NOTA BENE!!!!!!!!!
    }
    //END OF while((!feof($file)) && (connection_status()==0))
    fclose($file);
}
//END OF if($file = fopen($tmp_path."body_response",'rb'))
#### SPEDISCO E PULISCO IL BUFFER DI USCITA
//Da verificare se va o non va messo
//ob_end_flush();//OKKIO FONDAMENTALE!!!!!!!!
writeTimeFile($idfile . "--Repository: Ho spedito l'ack al Source");
writeTimeFile($idfile . "--Repository: Ho terminato");
//================  FINE RISPOSTA AL DOCUMENT SOURCE  =================//
if ($ATNA_active == 'A') {
    require_once './lib/syslog.php';
    $syslog = new Syslog();
    // ATNA IMPORT per Provide And Register Document Set
    $eventOutcomeIndicator = "0";
    //EventOutcomeIndicator 0 OK 12 ERROR
    $repository_endpoint = $_SERVER['PHP_SELF'];
    $ip_repository = $rep_host;
    $ip_source = $_SERVER['REMOTE_ADDR'];
    $today = date("Y-m-d");
    $cur_hour = date("H:i:s");
    $datetime = $today . "T" . $cur_hour;
    $message_import = "<AuditMessage>\n    <EventIdentification EventDateTime=\"{$datetime}\" EventActionCode=\"R\" EventOutcomeIndicator=\"0\">\n        <EventID code=\"110107\" codeSystemName=\"DCM\" displayName=\"Import\"/>\n        <EventTypeCode code=\"ITI-15\" codeSystemName=\"IHE Transactions\" displayName=\"Provide and Register Document Set\"/>\n    </EventIdentification>\n    <AuditSourceIdentification AuditSourceID=\"MARIS Repository\">\n        <AuditSourceTypeCode code=\"4\" />\n    </AuditSourceIdentification>\n    <ActiveParticipant UserID=\"{$ip_source}\" UserIsRequestor=\"true\">\n        <RoleIDCode code=\"110153\" codeSystemName=\"DCM\" displayName=\"Source\"/>\n    </ActiveParticipant>\n    <ActiveParticipant UserID=\"{$repository_endpoint}\" UserIsRequestor=\"false\">\n        <RoleIDCode code=\"110152\" codeSystemName=\"DCM\" displayName=\"Destination\"/>\n    </ActiveParticipant>\n    <ParticipantObjectIdentification ParticipantObjectID=\"{$submission_uniqueID}\" ParticipantObjectTypeCode=\"2\" ParticipantObjectTypeCodeRole=\"20\">\n        <ParticipantObjectIDTypeCode code=\"urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd\"/>\n    </ParticipantObjectIdentification>\n    </AuditMessage>";
    $logSyslog = $syslog->Send($ATNA_host, $ATNA_port, $message_import);
    // ATNA EXPORT per Register Document Set
    $eventOutcomeIndicator = "0";
    //EventOutcomeIndicator 0 OK 12 ERROR
    $message_export = "<AuditMessage>\n    <EventIdentification EventDateTime=\"{$datetime}\" EventActionCode=\"R\" EventOutcomeIndicator=\"{$eventOutcomeIndicator}\">\n        <EventID code=\"110106\" codeSystemName=\"DCM\" displayName=\"Export\"/>\n        <EventTypeCode code=\"ITI-14\" codeSystemName=\"IHE Transactions\" displayName=\"Register Document Set\"/>\n    </EventIdentification>\n    <AuditSourceIdentification AuditSourceID=\"MARIS Repository\">\n        <AuditSourceTypeCode code=\"4\" />\n    </AuditSourceIdentification>\n    <ActiveParticipant UserID=\"{$ip_repository}\" UserIsRequestor=\"true\">\n        <RoleIDCode code=\"110153\" codeSystemName=\"DCM\" displayName=\"Source\"/>\n    </ActiveParticipant>\n    <ActiveParticipant UserID=\"http://" . $reg_host . ":" . $reg_port . $reg_path . "\" UserIsRequestor=\"false\">\n        <RoleIDCode code=\"110152\" codeSystemName=\"DCM\" displayName=\"Destination\"/>\n    </ActiveParticipant>\n    <ParticipantObjectIdentification ParticipantObjectID=\"{$submission_uniqueID}\" ParticipantObjectTypeCode=\"2\" ParticipantObjectTypeCodeRole=\"20\">\n        <ParticipantObjectIDTypeCode code=\"urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd\"/>\n    </ParticipantObjectIdentification>\n    </AuditMessage>";
Esempio n. 19
0
/**
 * Insert system log into DB
 *
 * @param string Message text
 * @param string Log type: 'info', 'warning', 'error', 'critical_error'
 * @param string Object type: 'comment', 'item', 'user', 'file' or leave default NULL if none of them
 * @param integer Object ID
 * @param string Origin type: 'core', 'plugin'
 * @param integer Origin ID
 */
function syslog_insert($message, $log_type, $object_type = NULL, $object_ID = NULL, $origin_type = 'core', $origin_ID = NULL)
{
    global $servertimenow;
    $Syslog = new Syslog();
    $Syslog->set_user();
    $Syslog->set('type', $log_type);
    $Syslog->set_origin($origin_type, $origin_ID);
    $Syslog->set_object($object_type, $object_ID);
    $Syslog->set_message($message);
    $Syslog->set('timestamp', date2mysql($servertimenow));
    $Syslog->dbinsert();
}