classes/conference/log/ConferenceLog.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00016 // $Id$
00017 
00018 
00019 class ConferenceLog {
00020 
00027    function logEventEntry($conferenceId, $schedConfId = null, &$entry) {
00028       $conferenceDao =& DAORegistry::getDAO('ConferenceDAO');
00029       $schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
00030 
00031       $conference = $conferenceDao->getConference($conferenceId);
00032       if(!$conference) {
00033          // Conference is invalid.
00034          return false;
00035       }
00036 
00037       $schedConf = null;
00038       if($schedConfId != null)
00039          $schedConf = $schedConfDao->getSchedConf($schedConfId);
00040 
00041       if($conference && !$conference->getSetting('conferenceEventLog')) {
00042          // Event logging is disabled
00043          return false;
00044       }
00045 
00046       // Add the entry
00047       $entry->setConferenceId($conferenceId);
00048       $entry->setSchedConfId($schedConfId);
00049 
00050       if ($entry->getUserId() == null) {
00051          $user =& Request::getUser();
00052          $entry->setUserId($user == null ? 0 : $user->getId());
00053       }
00054 
00055       $logDao =& DAORegistry::getDAO('ConferenceEventLogDAO');
00056       return $logDao->insertLogEntry($entry);
00057    }
00058 
00069    function logEvent($conferenceId, $schedConfId = null, $eventType, $assocType = 0, $assocId = 0, $messageKey = null, $messageParams = array()) {
00070       return ConferenceLog::logEventLevel($conferenceId, $schedConfId, LOG_LEVEL_NOTICE, $eventType, $assocType, $assocId, $messageKey, $messageParams);
00071    }
00072 
00084    function logEventLevel($conferenceId, $schedConfId, $logLevel, $eventType, $assocType = 0, $assocId = 0, $messageKey = null, $messageParams = array()) {
00085       $entry = new ConferenceEventLogEntry();
00086       $entry->setLogLevel($logLevel);
00087       $entry->setEventType($eventType);
00088       $entry->setAssocType($assocType);
00089       $entry->setAssocId($assocId);
00090 
00091       if (isset($messageKey)) {
00092          $entry->setLogMessage($messageKey, $messageParams);
00093       }
00094 
00095       return ConferenceLog::logEventEntry($conferenceId, $schedConfId, $entry);
00096    }
00097 
00104    function &getEventLogEntries($conferenceId, $schedConfId = null, $rangeInfo = null) {
00105       $logDao =& DAORegistry::getDAO('ConferenceEventLogDAO');
00106       $returner =& $logDao->getConferenceLogEntries($conferenceId, $schedConfId, $rangeInfo);
00107       return $returner;
00108    }
00109 }
00110 
00111 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7