Пример #1
0
 private function lire_journal()
 {
     $nom_journal = _XML_PATH_MAIL . _XML_MAIL_JOURNAL . _XML_EXT;
     if (!@file_exists($nom_journal)) {
         $nom_modele_journal = _XML_PATH_INTERNE . _XML_MAIL_MODELE_JOURNAL . _XML_EXT;
         $this->anti_flooding = @copy($nom_modele_journal, $nom_journal);
     }
     if ($this->anti_flooding) {
         $xml_journal = new xml_struct();
         $this->anti_flooding = $xml_journal->ouvrir($nom_journal);
     }
     if ($this->anti_flooding) {
         $nb_ip = $xml_journal->compter_enfants();
         for ($cpt_ip = 0; $cpt_ip < $nb_ip; $cpt_ip++) {
             $ip = $xml_journal->lire_balise_enfant($cpt_ip);
             if (strlen($ip) > 0) {
                 $this->tab_journal[$ip] = new ip_flood_info($ip);
             }
         }
         foreach ($this->tab_journal as $adr_ip => $obj_ip) {
             $xml_journal->pointer_sur_origine();
             $xml_journal->pointer_sur_balise($adr_ip);
             $horodatage_succes = $xml_journal->lire_valeur(_MAIL_FLOOD_HORODATAGE_SUCCES);
             if (strlen($horodatage_succes) > 0) {
                 $obj_ip->set_horodatage_succes($horodatage_succes);
             }
             $horodatage_echec = $xml_journal->lire_valeur(_MAIL_FLOOD_HORODATAGE_ECHEC);
             if (strlen($horodatage_echec) > 0) {
                 $obj_ip->set_horodatage_echec($horodatage_echec);
             }
             $comptage_envois = $xml_journal->lire_valeur(_MAIL_FLOOD_COMPTAGE_ENVOIS);
             if (strlen($comptage_envois) > 0) {
                 $obj_ip->set_comptage_envois($comptage_envois);
             }
         }
     }
 }