Projects
Kolab:16:Testing
kolab-syncroton
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 15
View file
kolab-syncroton-2.4.0.tar.gz/lib/ext/Syncroton/Backend/ABackend.php
Changed
@@ -128,7 +128,7 @@ unset($data$key); if (!empty($value) && preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $value)) { # 2012-08-12 07:43:26 - $value = new DateTime($value, new DateTimeZone('utc')); + $value = new DateTime($value, new DateTimeZone('UTC')); } $data$this->_toCamelCase($key, false) = $value;
View file
kolab-syncroton-2.4.0.tar.gz/lib/ext/Syncroton/Command/FolderCreate.php
Changed
@@ -98,16 +98,31 @@ $this->_folder->deviceId = $this->_device; $this->_folder->creationTime = $this->_syncTimeStamp; - $this->_folderBackend->create($this->_folder); + // Check if the folder already exists to avoid a duplicate insert attempt in db + try { + $this->_folderBackend->getFolder($this->_device, $this->_folder->serverId); + + if ($this->_logger instanceof Zend_Log) + $this->_logger->info(__METHOD__ . '::' . __LINE__ . " Attempted to create a folder that already exists. parentId: {$folder->parentId} displayName: {$folder->displayName}"); + + // The folder already exists + $this->_status = Syncroton_Command_FolderSync::STATUS_FOLDER_EXISTS; + } catch (Syncroton_Exception_NotFound $e) { + // This is the normal case + if ($this->_logger instanceof Zend_Log) + $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage()); + + $this->_folderBackend->create($this->_folder); + } } } catch (Syncroton_Exception_Status $e) { if ($this->_logger instanceof Zend_Log) - $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage()); + $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage()); $this->_status = $e->getCode(); } catch (Exception $e) { if ($this->_logger instanceof Zend_Log) - $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage()); + $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage()); $this->_status = Syncroton_Command_FolderSync::STATUS_UNKNOWN_ERROR; }
View file
kolab-syncroton-2.4.0.tar.gz/lib/ext/Syncroton/Command/ItemOperations.php
Changed
@@ -249,12 +249,13 @@ } } - if (isset($fetch->Options->MIMESupport)){ - $fetchArray'options''mimeSupport' = (int) $fetch->Options->MIMESupport; + $airSync = $fetch->Options->children('uri:AirSync'); + if (isset($airSync->MIMESupport)) { + $fetchArray'options''mimeSupport' = (int) $airSync->MIMESupport; } - if (isset($airSyncBase->Range)) { - $fetchArray'options''range' = (string) $airSyncBase->Range; + if (isset($fetch->Options->Range)) { + $fetchArray'options''range' = (string) $fetch->Options->Range; } }
View file
kolab-syncroton-2.4.0.tar.gz/lib/ext/Syncroton/Command/Ping.php
Changed
@@ -90,7 +90,7 @@ } } - $this->_device->lastping = new DateTime('now', new DateTimeZone('utc')); + $this->_device->lastping = new DateTime('now', new DateTimeZone('UTC')); if ($status == self::STATUS_NO_CHANGES_FOUND) { $this->_device = $this->_deviceBackend->update($this->_device); @@ -113,7 +113,7 @@ $intervalEnd = $intervalStart + $lifeTime; $secondsLeft = $intervalEnd; - $folders = unserialize($this->_device->pingfolder); + $folders = $this->_device->pingfolder ? unserialize($this->_device->pingfolder) : array(); if ($status === self::STATUS_NO_CHANGES_FOUND && (!is_array($folders) || count($folders) == 0)) { $status = self::STATUS_MISSING_PARAMETERS; @@ -185,7 +185,7 @@ continue; } - $now = new DateTime('now', new DateTimeZone('utc')); + $now = new DateTime('now', new DateTimeZone('UTC')); foreach ($folders as $folderId) { try {
View file
kolab-syncroton-2.4.0.tar.gz/lib/ext/Syncroton/Command/Search.php
Changed
@@ -33,9 +33,15 @@ /** * parse search command request * + * @throws Syncroton_Exception_UnexpectedValue */ public function handle() { + if (! $this->_requestBody instanceof DOMDocument) { + throw new Syncroton_Exception_UnexpectedValue( + 'request body is no DOMDocument. got: ' . print_r($this->_requestBody, true)); + } + $xml = simplexml_import_dom($this->_requestBody); $this->_store = new Syncroton_Model_StoreRequest($xml->Store);
View file
kolab-syncroton-2.4.0.tar.gz/lib/ext/Syncroton/Model/AXMLEntry.php
Changed
@@ -174,7 +174,7 @@ $element->appendChild($element->ownerDocument->createCDATASection(base64_encode($value))); } else { // strip off any non printable control characters - if (!ctype_print($value)) { + if (!ctype_print((string)$value)) { $value = $this->_removeControlChars($value); }
View file
kolab-syncroton-2.4.0.tar.gz/lib/ext/Syncroton/Model/StoreRequest.php
Changed
@@ -178,12 +178,12 @@ switch ($this->_store'name') { case 'DocumentLibrary': case 'Document Library': //? - '0-999'; + $this->_store'options''range' = '0-999'; break; case 'Mailbox': case 'GAL': default: - '0-99'; + $this->_store'options''range' = '0-99'; break; } }
View file
kolab-syncroton-2.4.0.tar.gz/lib/ext/Syncroton/Server.php
Changed
@@ -105,9 +105,9 @@ $className = 'Syncroton_Command_' . $requestParameters'command'; - if(!class_exists($className)) { + if (!class_exists($className)) { if ($this->_logger instanceof Zend_Log) - $this->_logger->crit(__METHOD__ . '::' . __LINE__ . " command not supported: " . $requestParameters'command'); + $this->_logger->notice(__METHOD__ . '::' . __LINE__ . " command not supported: " . $requestParameters'command'); header("HTTP/1.1 501 not implemented"); @@ -161,11 +161,11 @@ } catch (Exception $e) { if ($this->_logger instanceof Zend_Log) - $this->_logger->crit(__METHOD__ . '::' . __LINE__ . " unexpected exception occured: " . get_class($e)); + $this->_logger->err(__METHOD__ . '::' . __LINE__ . " unexpected exception occured: " . get_class($e)); if ($this->_logger instanceof Zend_Log) - $this->_logger->crit(__METHOD__ . '::' . __LINE__ . " exception message: " . $e->getMessage()); + $this->_logger->err(__METHOD__ . '::' . __LINE__ . " exception message: " . $e->getMessage()); if ($this->_logger instanceof Zend_Log) - $this->_logger->crit(__METHOD__ . '::' . __LINE__ . " " . $e->getTraceAsString()); + $this->_logger->err(__METHOD__ . '::' . __LINE__ . " " . $e->getTraceAsString()); header("HTTP/1.1 500 Internal server error"); @@ -190,7 +190,6 @@ } catch (Syncroton_Wbxml_Exception $swe) { if ($this->_logger instanceof Zend_Log) { $this->_logger->err(__METHOD__ . '::' . __LINE__ . " Could not encode output: " . $swe); - $this->_logDomDocument(Zend_Log::WARN, $response, __METHOD__, __LINE__); } header("HTTP/1.1 500 Internal server error"); @@ -245,15 +244,13 @@ /** * write (possible big) DOMDocument in smaller chunks to log file * - * @param unknown $priority + * @param int $priority * @param DOMDocument $dom * @param string $method * @param int $line */ protected function _logDomDocument($priority, DOMDocument $dom, $method, $line) { - $loops = 0; - $tempStream = tmpfile(); $meta_data = stream_get_meta_data($tempStream); @@ -265,12 +262,7 @@ rewind($tempStream); - // log data in 1MByte chunks - while (!feof($tempStream)) { - $this->_logger->log($method . '::' . $line . " xml response($loops):\n" . fread($tempStream, 1048576), $priority); - - $loops++; - } + $this->_logger->log($method . '::' . $line . " xml response(first 4k):\n" . fread($tempStream, 4 * 1024), $priority); fclose($tempStream); }
View file
kolab-syncroton-2.4.0.tar.gz/lib/kolab_sync_backend.php
Changed
@@ -176,7 +176,7 @@ } // Activesync folder identifier (serverId) - $folder_type = ($typedata$folder ?? null) ?: 'mail'; + $folder_type = !empty($typedata$folder) ? $typedata$folder : 'mail'; $folder_id = self::folder_id($folder, $folder_type); $folders_list$folder_id = $this->folder_data($folder, $folder_type);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.