Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
저자: Chuck Hagenbuch (chuck@horde.org)
저자: Gunnar Wrobel (wrobel@pardus.de)
예제 #1
0
파일: Mongo.php 프로젝트: raz0rsdge/horde
 /**
  * Constructor.
  *
  * @param array $params  Configuration parameters:
  * <ul>
  *  <li>
  *   REQUIRED parameters:
  *   <ul>
  *    <li>
  *     mongo_db: (Horde_Mongo_Client) A MongoDB client object.
  *    </li>
  *   </ul>
  *  </li>
  */
 public function __construct($auth, array $params = array())
 {
     if (!isset($params['mongo_db'])) {
         throw new InvalidArgumentException('Missing mongo_db parameter.');
     }
     parent::__construct($params);
     $this->_db = $params['mongo_db']->selectDB(null);
 }
예제 #2
0
파일: Composite.php 프로젝트: horde/horde
 /**
  * Constructor.
  *
  * @param array $params  Configuration parameters:
  * <pre>
  * REQUIRED parameters:
  *   - drivers: (array) An array of Horde_History objects.
  * </pre>
  */
 public function __construct($auth, array $params = array())
 {
     if (!isset($params['drivers'])) {
         throw new InvalidArgumentException('Missing drivers parameter.');
     }
     $this->_drivers = $params['drivers'];
     parent::__construct($params);
 }
예제 #3
0
 /**
  */
 public function getChanges($ts)
 {
     $msgids = preg_replace('/^([^:]*:){2}/', '', array_keys($this->_history->getByTimestamp('>', $ts, array(), $this->_getUniqueHistoryId())));
     $out = array();
     foreach ($msgids as $val) {
         $out[] = new IMP_Maillog_Message($val);
     }
     return $out;
 }
예제 #4
0
파일: Base.php 프로젝트: horde/horde
 /**
  * Resets the bad login counter.
  *
  * @param string $userId  The user to reset.
  *
  * @throws Horde_Auth_Exception
  */
 protected function _resetBadLogins($userId)
 {
     if (!$this->_history_api) {
         throw new Horde_Auth_Exception('Unsupported.');
     }
     try {
         $this->_history_api->removeByNames(array($userId . '@logins.failed'));
     } catch (Horde_History_Exception $e) {
         throw new Horde_Auth_Exception($e);
     }
 }
예제 #5
0
파일: Base.php 프로젝트: jubinpatel/horde
 /**
  * Update the history log for an object.
  *
  * @param string                           $object The object ID.
  * @param string                           $bid    The backend ID of
  *                                                 the object.
  * @param Horde_Kolab_Storage_Folder_Stamp $stamp  The folder stamp.
  *
  * @return NULL
  */
 private function _updateLog($object, $bid, $stamp)
 {
     $log = $this->history->getHistory($object);
     if (count($log) == 0) {
         $this->history->log($object, array('action' => 'add', 'bid' => $bid, 'stamp' => $stamp));
     } else {
         $last = array('ts' => 0);
         foreach ($log as $entry) {
             if ($entry['ts'] > $last['ts']) {
                 $last = $entry;
             }
         }
         if (!isset($last['bid']) || $last['bid'] != $bid || isset($last['stamp']) && $last['stamp']->isReset($stamp)) {
             $this->history->log($object, array('action' => 'modify', 'bid' => $bid, 'stamp' => $stamp));
         }
     }
 }
예제 #6
0
파일: Base.php 프로젝트: raz0rsdge/horde
 /**
  * Update the history log for an object.
  *
  * @param string $object  The object ID.
  * @param string $bid     The backend ID of the object.
  * @param boolean $force  Force update
  */
 protected function _updateLog($object, $bid, $force = false)
 {
     $last = $this->_history->getLatestEntry($object);
     if ($last === false) {
         // New, unknown object
         $this->_logger->debug(sprintf('[KOLAB_STORAGE] New object to log in Horde_History: %s, uid: %d', $object, $bid));
         $this->_history->log($object, array('action' => 'add', 'bid' => $bid), true);
     } else {
         // If the last action for this object was 'delete', we issue an 'add'.
         // Objects can vanish and re-appear using the same object uid.
         // (a foreign client is sending an update over a slow link)
         if ($last['action'] == 'delete') {
             $this->_logger->debug(sprintf('[KOLAB_STORAGE] Re-adding previously deleted object in Horde_History: %s, uid: %d', $object, $bid));
             $this->_history->log($object, array('action' => 'add', 'bid' => $bid), true);
         }
         if (!isset($last['bid']) || $last['bid'] != $bid || $force) {
             $this->_logger->debug(sprintf('[KOLAB_STORAGE] Modifying object in Horde_History: %s, uid: %d, force: %d', $object, $bid, $force));
             $this->_history->log($object, array('action' => 'modify', 'bid' => $bid), true);
         }
     }
 }
예제 #7
0
 /**
  * Return the maximum modification sequence. To be overridden in concrete
  * class.
  *
  * @param string $parent  Restrict to entries a specific parent.
  *
  * @return integer  The modseq
  */
 public function getHighestModSeq($parent = null)
 {
     return $this->_history->getHighestModSeq($parent);
 }
예제 #8
0
파일: Sql.php 프로젝트: jubinpatel/horde
 /**
  * Constructor.
  *
  * @param string $auth  The current user.
  * @param Horde_Db_Adapter $db  The database connection.
  */
 public function __construct($auth, Horde_Db_Adapter $db)
 {
     parent::__construct($auth);
     $this->_db = $db;
 }