Skip to content

Commit

Permalink
Merge branch 'master' into imp_6_2
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Nov 15, 2013
2 parents 9542c7e + 246ccfa commit 9af73ea
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions framework/ActiveSync/lib/Horde/ActiveSync/Collections.php
Expand Up @@ -30,6 +30,7 @@ class Horde_ActiveSync_Collections implements IteratorAggregate
const COLLECTION_ERR_SERVER = -2;
const COLLECTION_ERR_STALE = -3;
const COLLECTION_ERR_SYNC_REQUIRED = -4;
const COLLECTION_ERR_PING_NEED_FULL = -5;

/**
* The collection data
Expand Down Expand Up @@ -990,6 +991,9 @@ public function pollForChanges($heartbeat, $interval, array $options = array())
$this->_procid,
$id)
);
if (!empty($options['pingable'])) {
return self::COLLECTION_ERR_PING_NEED_FULL;
}
$dataavailable = true;
$this->setGetChangesFlag($id);
continue;
Expand All @@ -1008,6 +1012,9 @@ public function pollForChanges($heartbeat, $interval, array $options = array())
return self::COLLECTION_ERR_FOLDERSYNC_REQUIRED;
} catch (Horde_ActiveSync_Exception $e) {
$this->_logger->err('Error loading state: ' . $e->getMessage());
if (!empty($options['pingable'])) {
return self::COLLECTION_ERR_PING_NEED_FULL;
}
$this->setGetChangesFlag($id);
$dataavailable = true;
continue;
Expand Down
11 changes: 11 additions & 0 deletions framework/ActiveSync/lib/Horde/ActiveSync/Request/Ping.php
Expand Up @@ -142,6 +142,7 @@ protected function _handle()
$this->_logger->info(sprintf(
'[%s] Empty PING request.',
$this->_procid));
$isEmpty = true;
$collections->loadCollectionsFromCache();
if ($collections->collectionCount() == 0 ||
!$collections->havePingableCollections()) {
Expand All @@ -153,6 +154,7 @@ protected function _handle()
return true;
}
} else {
$isEmpty = false;
if ($this->_decoder->getElementStartTag(self::HEARTBEATINTERVAL)) {
if (!$heartbeat = $this->_checkHeartbeat($this->_decoder->getElementContent())) {
$heartbeat = $this->_pingSettings['heartbeatdefault'];
Expand Down Expand Up @@ -207,7 +209,16 @@ protected function _handle()
if ($this->_statusCode == self::STATUS_NOCHANGES) {
$changes = $collections->pollForChanges($heartbeat, $interval, array('pingable' => true));
if ($changes !== true && $changes !== false) {
// If we received a status indicating we need to issue a full
// PING, but we already did, treat it as a status_needsync.
if (!$isEmpty && $changes == Horde_ActiveSync_Collections::COLLECTION_ERR_PING_NEED_FULL) {
$changes = Horde_ActiveSync_Collections::COLLECTION_ERR_SYNC_REQUIRED;
}
switch ($changes) {
case Horde_ActiveSync_Collections::COLLECTION_ERR_PING_NEED_FULL:
$this->_statusCode = self::STATUS_MISSING;
$this->_handleGlobalError();
return true;
case Horde_ActiveSync_Collections::COLLECTION_ERR_STALE:
$this->_logger->info(sprintf(
'[%s] Changes in cache detected during PING, exiting here.',
Expand Down
2 changes: 1 addition & 1 deletion nag/lib/Form/Task.php
Expand Up @@ -29,7 +29,7 @@ public function __construct($vars, $title = '')
parent::__construct($vars, $title);

$tasklist_enums = array();
foreach (Nag::listTasklists(false, Horde_Perms::EDIT) as $tl_id => $tl) {
foreach (Nag::listTasklists(false, Horde_Perms::EDIT, false) as $tl_id => $tl) {
$tasklist_enums[$tl_id] = Nag::getLabel($tl);
}
$tasklist = $vars->get('tasklist_id');
Expand Down

0 comments on commit 9af73ea

Please sign in to comment.