Skip to content
Permalink
Browse files

Merge branch 'master' of ssh://dev.horde.org/horde/git/horde

  • Loading branch information...
yunosh committed Nov 15, 2015
2 parents 8472ef2 + 805b9b5 commit 1dfebf6fdad4391f520bf2265181d432368df3b8
Showing with 5,304 additions and 1,930 deletions.
  1. +16 −2 .travis.yml
  2. +2 −2 framework/ActiveSync/composer.json
  3. +6 −2 framework/ActiveSync/lib/Horde/ActiveSync/Connector/Exporter.php
  4. +94 −18 framework/ActiveSync/lib/Horde/ActiveSync/Device.php
  5. +79 −0 framework/ActiveSync/lib/Horde/ActiveSync/Device/Ios.php
  6. +1 −1 framework/ActiveSync/lib/Horde/ActiveSync/Message/Base.php
  7. +15 −0 framework/ActiveSync/lib/Horde/ActiveSync/Message/Contact.php
  8. +0 −2 framework/ActiveSync/lib/Horde/ActiveSync/Request/Search.php
  9. +1 −1 framework/ActiveSync/lib/Horde/ActiveSync/State/Mongo.php
  10. +15 −9 framework/ActiveSync/lib/Horde/ActiveSync/State/Sql.php
  11. +3 −1 framework/ActiveSync/lib/Horde/ActiveSync/Wbxml/Decoder.php
  12. +54 −7 framework/ActiveSync/package.xml
  13. +23 −1 framework/ActiveSync/test/Horde/ActiveSync/ContactTest.php
  14. +49 −2 framework/ActiveSync/test/Horde/ActiveSync/DeviceTest.php
  15. +2 −2 framework/Core/composer.json
  16. +6 −0 framework/Core/js/map/horde.js
  17. +89 −0 framework/Core/js/map/owm.js
  18. +2 −1 framework/Core/lib/Horde/Core/ActiveSync/Connector.php
  19. +22 −10 framework/Core/lib/Horde/Core/ActiveSync/Driver.php
  20. +1 −1 framework/Core/lib/Horde/Core/ActiveSync/Logger/Factory.php
  21. +8 −1 framework/Core/lib/Horde/Core/Ajax/Imple/WeatherLocationAutoCompleter.php
  22. +1 −1 framework/Core/lib/Horde/Core/Factory/Alarm.php
  23. +1 −1 framework/Core/lib/Horde/Core/Factory/Weather.php
  24. +1 −1 framework/Core/lib/Horde/Deprecated.php
  25. +37 −6 framework/Core/package.xml
  26. +2 −2 framework/Exception/test/Horde/Exception/ExceptionTest.php
  27. +33 −1 framework/Icalendar/lib/Horde/Icalendar.php
  28. +6 −4 framework/Icalendar/package.xml
  29. +23 −0 framework/Icalendar/test/Horde/Icalendar/ParseTest.php
  30. +46 −0 framework/Icalendar/test/Horde/Icalendar/fixtures/bug14132.ics
  31. +263 −0 framework/Icalendar/test/Horde/Icalendar/fixtures/bug14153.ics
  32. +1 −1 framework/Kolab_Filter/lib/Horde/Kolab/Filter/Transport.php
  33. +25 −13 framework/Kolab_Storage/lib/Horde/Kolab/Storage/Cache/Data.php
  34. +2 −2 framework/Nls/composer.json
  35. +17 −4 framework/Nls/package.xml
  36. +2 −2 framework/Notification/composer.json
  37. +16 −3 framework/Notification/package.xml
  38. +2 −2 framework/Pdf/composer.json
  39. +16 −3 framework/Pdf/package.xml
  40. +5 −15 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php
  41. +683 −155 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php
  42. +44 −37 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php
  43. +47 −26 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php
  44. +20 −18 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php
  45. +135 −25 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC2.php
  46. +34 −16 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC4.php
  47. +146 −30 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php
  48. +3 −3 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php
  49. +313 −548 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php
  50. +62 −9 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php
  51. +8 −23 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php
  52. +157 −126 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/File/ANSI.php
  53. +20 −9 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php
  54. +62 −28 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/File/X509.php
  55. +100 −91 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php
  56. +4 −4 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php
  57. +150 −41 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php
  58. +5 −2 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php
  59. +7 −7 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Net/SSH1.php
  60. +671 −288 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
  61. +147 −0 framework/Pgp/bundle/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
  62. +2 −2 framework/Queue/composer.json
  63. +16 −3 framework/Queue/package.xml
  64. +2 −2 framework/Secret/composer.json
  65. +16 −3 framework/Secret/package.xml
  66. +2 −2 framework/Service_Weather/composer.json
  67. +16 −0 framework/Service_Weather/lib/Horde/Service/Weather.php
  68. +4 −4 framework/Service_Weather/lib/Horde/Service/Weather/Base.php
  69. +94 −0 framework/Service_Weather/lib/Horde/Service/Weather/Current/Owm.php
  70. +73 −0 framework/Service_Weather/lib/Horde/Service/Weather/Forecast/Owm.php
  71. +379 −0 framework/Service_Weather/lib/Horde/Service/Weather/Owm.php
  72. +1 −1 framework/Service_Weather/lib/Horde/Service/Weather/Period/Base.php
  73. +89 −0 framework/Service_Weather/lib/Horde/Service/Weather/Period/Owm.php
  74. +7 −5 framework/Service_Weather/lib/Horde/Service/Weather/WeatherUnderground.php
  75. +2 −1 framework/Service_Weather/lib/Horde/Service/Weather/Wwo.php
  76. +28 −5 framework/Service_Weather/package.xml
  77. +6 −5 framework/Service_Weather/test/Horde/Service/Weather/Wwov2Test.php
  78. +3 −3 framework/SessionHandler/composer.json
  79. +17 −3 framework/SessionHandler/package.xml
  80. +2 −2 framework/Token/composer.json
  81. +16 −3 framework/Token/package.xml
  82. +1 −0 framework/Vcs/test/Horde/Vcs/CvsTest.php
  83. +1 −0 framework/Vcs/test/Horde/Vcs/RcsTest.php
  84. +1 −0 gollem/lib/Gollem.php
  85. +1 −0 hermes/js/hermes.js
  86. +10 −1 hermes/lib/Ajax/Application/Handler.php
  87. +2 −0 hermes/templates/dynamic/deliverables.inc
  88. +3 −3 hermes/themes/default/dynamic/screen.css
  89. +2 −1 horde/admin/cmdshell.php
  90. +2 −0 horde/admin/phpshell.php
  91. +4 −1 horde/admin/sqlshell.php
  92. +3 −2 horde/config/conf.xml
  93. +1 −0 horde/docs/CHANGES
  94. +33 −0 horde/js/weatherblockmap.js
  95. +21 −4 horde/lib/Block/Weather.php
  96. +1 −1 horde/lib/Test.php
  97. +13 −7 horde/lib/View/Sidebar.php
  98. +9 −3 horde/package.xml
  99. +2 −0 horde/templates/admin/cmdshell.html.php
  100. +2 −0 horde/templates/admin/phpshell.html.php
  101. +2 −0 horde/templates/admin/sqlshell.html.php
  102. +16 −128 horde/templates/block/weather.html.php
  103. +127 −0 horde/templates/block/weather_content.html.php
  104. +19 −9 horde/themes/default/block/screen.css
  105. +20 −0 imp/config/hooks.php.dist
  106. +1 −0 imp/docs/CHANGES
  107. +1 −1 imp/lib/Ajax/Application/Handler/Dynamic.php
  108. +9 −0 imp/lib/Auth.php
  109. +10 −2 imp/lib/Compose.php
  110. +1 −1 imp/lib/Mime/Viewer/Html.php
  111. +1 −0 imp/lib/Prefs/Special/PgpPrivateKey.php
  112. +1 −1 imp/lib/Smime.php
  113. +1 −0 imp/package.xml
  114. +2 −0 imp/templates/prefs/pgpprivatekey.html.php
  115. +6 −2 ingo/lib/Basic/Forward.php
  116. +6 −2 ingo/lib/Basic/Spam.php
  117. +6 −2 ingo/lib/Basic/Vacation.php
  118. +68 −23 kronolith/lib/Ajax/Application/Handler.php
  119. +7 −6 kronolith/lib/Api.php
  120. +6 −2 kronolith/lib/Application.php
  121. +6 −14 kronolith/lib/Event.php
  122. +15 −4 kronolith/lib/Kronolith.php
  123. +0 −3 nag/app/controllers/SaveTask.php
  124. +2 −2 nag/lib/Api.php
  125. +5 −0 nag/lib/Driver.php
  126. +24 −3 nag/lib/Search.php
  127. +8 −1 nag/lib/TagBrowser.php
  128. +48 −1 nag/lib/Task.php
  129. +0 −2 nag/task.php
  130. +14 −3 trean/data.php
  131. +1 −0 trean/docs/CHANGES
  132. +86 −0 trean/lib/Data/Html.php
  133. +4 −1 trean/package.xml
  134. +24 −3 turba/lib/Api.php
  135. +4 −0 turba/lib/Driver.php
  136. +1 −1 turba/lib/Driver/Kolab.php
  137. +2 −2 turba/lib/Driver/Sql.php
  138. +11 −2 turba/lib/Driver/Vbook.php
  139. +1 −0 turba/lib/Turba.php
  140. +2 −4 whups/lib/Api.php
  141. +12 −12 whups/lib/Driver.php
  142. +32 −16 whups/lib/Driver/Sql.php
@@ -1,9 +1,11 @@
sudo: false
language: php
php:
# - 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- nightly
matrix:
allow_failures:
@@ -12,9 +14,21 @@ services:
- memcached
- redis-server
env: ACTIVESYNC_SQL_MYSQL_TEST_CONFIG='{"activesync":{"sql":{"mysql":{"adapter":"mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' ACTIVESYNC_SQL_MYSQLI_TEST_CONFIG='{"activesync":{"sql":{"mysqli":{"adapter":"mysqli","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' ACTIVESYNC_SQL_PDO_MYSQL_TEST_CONFIG='{"activesync":{"sql":{"pdo_mysql":{"adapter":"pdo_mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' ALARM_TEST_CONFIG='{"alarm":{"test":{"horde":{"adapter":"pdo_mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' CRYPT_TEST_CONFIG='{"crypt":{"keyserver":false}}' DB_ADAPTER_MYSQL_TEST_CONFIG='{"db":{"adapter":{"mysql":{"test":{"host":"localhost","username":"root","password":"","dbname":"test"}}}}}' DB_ADAPTER_MYSQLI_TEST_CONFIG='{"db":{"adapter":{"mysqli":{"test":{"host":"localhost","username":"root","password":"","dbname":"test"}}}}}' DB_ADAPTER_PDO_MYSQL_TEST_CONFIG='{"db":{"adapter":{"pdo":{"mysql":{"test":{"host":"localhost","username":"root","password":"","dbname":"test"}}}}}}' DB_ADAPTER_PDO_PGSQL_TEST_CONFIG='{"db":{"adapter":{"pdo":{"pgsql":{"test":{"username":"postgres","password":"","dbname":"test"}}}}}}' GROUP_SQL_MYSQL_TEST_CONFIG='{"group":{"sql":{"mysql":{"adapter":"mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' GROUP_SQL_MYSQLI_TEST_CONFIG='{"group":{"sql":{"mysqli":{"adapter":"mysqli","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' GROUP_SQL_PDO_MYSQL_TEST_CONFIG='{"group":{"sql":{"pdo_mysql":{"adapter":"pdo_mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' GROUP_SQL_PDO_PGSQL_TEST_CONFIG='{"group":{"sql":{"pdo_pgsql":{"adapter":"pdo_pgsql","username":"postgres","password":"","dbname":"test","charset":"utf-8"}}}}' HASHTABLE_MEMCACHE_TEST_CONFIG='{"hashtable":{"memcache":{"hostspec":["localhost"],"port":[11211]}}}' HASHTABLE_PREDIS_TEST_CONFIG='{"hashtable":{"predis":{"hostspec":["localhost"],"scheme":"tcp"}}}' HISTORY_MONGO_TEST_CONFIG='{"history":{"mongo":"mongodb://localhost"}}' HISTORY_SQL_MYSQL_TEST_CONFIG='{"history":{"sql":{"mysql":{"adapter":"mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' HISTORY_SQL_MYSQLI_TEST_CONFIG='{"history":{"sql":{"mysqli":{"adapter":"mysqli","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' HISTORY_SQL_PDO_MYSQL_TEST_CONFIG='{"history":{"sql":{"pdo_mysql":{"adapter":"pdo_mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' HISTORY_SQL_PDO_PGSQL_TEST_CONFIG='{"history":{"sql":{"pdo_pgsql":{"adapter":"pdo_pgsql","username":"postgres","password":"","dbname":"test","charset":"utf-8"}}}}' HTTP_TEST_CONFIG='{"http":{"server":"www.google.com"}}' IMAGE_EXIF_TEST_CONFIG='{"image":{"exiftool":"/usr/bin/exiftool"}}' IMAPCLIENT_TEST_CONFIG='{"imapclient":{"mongo":"localhost"}}' MAILAUTOCONFIG_TEST_CONFIG='{"mail_autoconfig":{"nonauth_emails":["test@gmail.com","test@gmx.net"],"nonauth_emails_bad":["test@example.com"],"domains":[[["gmail.com"]],[["test.mail.gmail.com","mail.gmail.com","gmail.com"]]]}}' LOCK_MONGO_TEST_CONFIG='{"lock":{"mongo":"localhost"}}' PEAR_TEST_CONFIG='{"pear":{"config":"/etc/pear/pear.conf","server":"pear.horde.org"}}' PREFS_SQL_MYSQL_TEST_CONFIG='{"prefs":{"sql":{"mysql":{"adapter":"mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' PREFS_SQL_MYSQLI_TEST_CONFIG='{"prefs":{"sql":{"mysqli":{"adapter":"mysqli","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' PREFS_SQL_PDO_MYSQL_TEST_CONFIG='{"prefs":{"sql":{"pdo_mysql":{"adapter":"pdo_mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' PREFS_SQL_PDO_PGSQL_TEST_CONFIG='{"prefs":{"sql":{"pdo_pgsql":{"adapter":"pdo_pgsql","username":"postgres","password":"","dbname":"test","charset":"utf-8"}}}}' SERVICE_GRAVATAR_TEST_CONFIG='{"service":{"gravatar":{"server":"http://www.gravatar.com"}}}' SESSIONHANDLER_SQL_MYSQL_TEST_CONFIG='{"sessionhandler":{"sql":{"mysql":{"adapter":"mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' SESSIONHANDLER_SQL_MYSQLI_TEST_CONFIG='{"sessionhandler":{"sql":{"mysqli":{"adapter":"mysqli","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' SESSIONHANDLER_SQL_PDO_MYSQL_TEST_CONFIG='{"sessionhandler":{"sql":{"pdo_mysql":{"adapter":"pdo_mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' SESSIONHANDLER_SQL_PDO_PGSQL_TEST_CONFIG='{"sessionhandler":{"sql":{"pdo_pgsql":{"adapter":"pdo_pgsql","username":"postgres","password":"","dbname":"test","charset":"utf-8"}}}}' SHARE_SQL_MYSQL_TEST_CONFIG='{"share":{"sql":{"mysql":{"adapter":"mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' SHARE_SQL_MYSQLI_TEST_CONFIG='{"share":{"sql":{"mysqli":{"adapter":"mysqli","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' SHARE_SQL_PDO_MYSQL_TEST_CONFIG='{"share":{"sql":{"pdo_mysql":{"adapter":"pdo_mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' SHARE_SQL_PDO_PGSQL_TEST_CONFIG='{"share":{"sql":{"pdo_pgsql":{"adapter":"pdo_pgsql","username":"postgres","password":"","dbname":"test","charset":"utf-8"}}}}' TOKEN_MONGO_TEST_CONFIG='{"token":{"mongo":"localhost"}}' VCS_TEST_CONFIG='{"paths":{"ci":"\/usr\/bin\/ci","co":"\/usr\/bin\/co","rcs":"\/usr\/bin\/rcs","rcsdiff":"\/usr\/bin\/rcsdiff","rlog":"\/usr\/bin\/rlog","cvs":"\/usr\/bin\/cvs","cvsps":"\/usr\/bin\/cvsps","cvsps_home":"\/tmp","svn":"\/usr\/bin\/svn","diff":"\/usr\/bin\/diff","git":"\/usr\/bin\/git"}}' VFS_MONGO_TEST_CONFIG='{"vfs":{"mongo":{"hostspec":"localhost"}}}' VFS_SQL_MYSQL_TEST_CONFIG='{"vfs":{"sql":{"mysql":{"adapter":"mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' VFS_SQL_MYSQLI_TEST_CONFIG='{"vfs":{"sql":{"mysqli":{"adapter":"mysqli","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' VFS_SQL_PDO_MYSQL_TEST_CONFIG='{"vfs":{"sql":{"pdo_mysql":{"adapter":"pdo_mysql","host":"localhost","username":"root","password":"","dbname":"test","charset":"utf-8"}}}}' VFS_SQL_PDO_PGSQL_TEST_CONFIG='{"vfs":{"sql":{"pdo_pgsql":{"adapter":"pdo_pgsql","username":"postgres","password":"","dbname":"test","charset":"utf-8"}}}}'
addons:
apt:
packages:
- aspell
- aspell-en
- cvs
- cvsps
- language-pack-en
- language-pack-cs
- language-pack-de
- language-pack-tr
- libimage-exiftool-perl
- libwbxml2-utils
- rcs
before_install:
- sudo locale-gen cs_CZ.UTF-8 de_DE.UTF-8 tr_TR
- sudo apt-get -qq install libwbxml2-utils aspell rcs cvs cvsps libimage-exiftool-perl
- mysql -e "create database IF NOT EXISTS test;" -uroot
before_script:
- phpenv config-add .travis.ini
@@ -11,8 +11,8 @@
"role": "lead"
}
],
"version": "2.29.1",
"time": "2015-09-01",
"version": "2.30.1",
"time": "2015-10-28",
"repositories": [
{
"type": "pear",
@@ -188,7 +188,11 @@ protected function _sendNextChange()
// Ignore this change, no UID value, keep trying until we get a
// good entry or we run out of entries.
while (empty($change['id']) && $this->_step < count($this->_changes) - 1) {
$this->_logger->err('Missing UID value for an entry in: ' . $this->_currentCollection['id']);
$this->_logger->notice(sprintf(
'Missing UID value for an entry in: %s. Details: %s.',
$this->_currentCollection['id'],
print_r($change, true)
));
$this->_step++;
$change = $this->_getNextChange();
}
@@ -206,7 +210,7 @@ protected function _sendNextChange()
$message->flags = (isset($change['flags'])) ? $change['flags'] : false;
$this->messageChange($change['id'], $message);
} catch (Horde_Exception_NotFound $e) {
$this->_logger->err(sprintf(
$this->_logger->notice(sprintf(
'[%s] Message gone or error reading message from server: %s',
$this->_procid, $e->getMessage()));
$this->_as->state->updateState($change['type'], $change);
@@ -77,6 +77,13 @@ class Horde_ActiveSync_Device
const TYPE_UNKNOWN = 'unknown';
const TYPE_NINE = 'nine';
/**
* Quirk to specify if the client fails to property ghost the
* POOMCONTACTS:Picture field. If this quirk is present, it means we should
* add the POOMCONTACTS:Picture field to the SUPPORTED array for this client.
*/
const QUIRK_NEEDS_SUPPORTED_PICTURE_TAG = 1;
/**
* Device properties.
*
@@ -112,6 +119,13 @@ class Horde_ActiveSync_Device
*/
protected $_clientType;
/**
* Cache of OS version.
*
* @var string
*/
protected $_iOSVersion;
/**
* Const'r
*
@@ -163,11 +177,11 @@ public function &__get($property)
default:
if (isset($this->_properties[$property])) {
return $this->_properties[$property];
} else {
$return = null;
return $return;
}
}
$return = null;
return $return;
}
/**
@@ -383,13 +397,12 @@ public function getMajorVersion()
break;
case self::TYPE_IPOD:
case self::TYPE_IPAD:
if (preg_match('/(\d+)\.(\d+)/', $this->properties[self::OS], $matches)) {
return $matches[1];
}
break;
case self::TYPE_IPHONE:
if (preg_match('/(.+)\/(\d+)\.(\d+)/', $this->userAgent, $matches)) {
return $matches[2];
if (empty($this->_iOSVersion)) {
$this->_getIosVersion();
}
if (preg_match('/(\d+)\.(\d+)/', $this->_iOSVersion, $matches)) {
return $matches[1];
}
break;
case self::TYPE_ANDROID:
@@ -417,6 +430,29 @@ public function getMajorVersion()
return 0;
}
/**
* Detects the iOS version in M.m format and caches locally.
*/
protected function _getIosVersion()
{
// First see if we have a newer client that sends the OS version
// Newer iOS sends e.g., "iOS 8.2.2" in OS field.
if (!empty($this->properties[self::OS]) &&
preg_match('/\d+\.\d+\.?\d+?/', $this->properties[self::OS], $matches)) {
if (!empty($matches[0])) {
$this->_iOSVersion = $matches[0];
return;
}
}
// Match to a known UserAgent string version.
foreach (Horde_ActiveSync_Device_Ios::$VERSION_MAP as $userAgent => $version) {
if (preg_match('/\w+\/(' . $userAgent . ')$/', $this->userAgent, $matches)) {
$this->_iOSVersion = $version;
return;
}
}
}
/**
* Return the minor version number of the OS (or client app) as reported
* by the client.
@@ -433,13 +469,12 @@ public function getMinorVersion()
break;
case self::TYPE_IPOD:
case self::TYPE_IPAD:
if (preg_match('/(\d+)\.(\d+)/', $this->properties[self::OS], $matches)) {
return $matches[2];
}
break;
case self::TYPE_IPHONE:
if (preg_match('/(.+)\/(\d+)\.(\d+)/', $this->userAgent, $matches)) {
return $matches[3];
if (empty($this->_iOSVersion)) {
$this->_getIosVersion();
}
if (preg_match('/(\d+)\.(\d+)/', $this->_iOSVersion, $matches)) {
return $matches[2];
}
break;
case self::TYPE_ANDROID:
@@ -611,6 +646,27 @@ public function normalizePoomContactsDates($date, $toEas = false)
}
}
/**
* Return if this client has the described quirk.
*
* @param integer $quirk The specified quirk to check for.
*
* @return boolean True if quirk is present.
*/
public function hasQuirk($quirk)
{
switch ($quirk) {
case self::QUIRK_NEEDS_SUPPORTED_PICTURE_TAG:
if ($this->_isIos() && $this->getMajorVersion() == 4) {
return true;
}
return false;
break;
default:
return false;
}
}
/**
* Attempt to determine the *client* application as opposed to the device,
* which may or may not be the client.
@@ -664,7 +720,7 @@ protected function _isNine()
protected function _sniffMultiplex()
{
$clientType = Horde_String::lower($this->clientType);
if (strpos($this->userAgent, 'iOS') === 0 || in_array($clientType, array(self::TYPE_IPAD, self::TYPE_IPOD, self::TYPE_IPHONE))) {
if ($this->_isIos()) {
// iOS seems to support multiple collections for everything except Notes.
$this->_properties['properties'][self::MULTIPLEX] = Horde_ActiveSync_Device::MULTIPLEX_NOTES;
} else if ($clientType == self::TYPE_ANDROID) {
@@ -717,12 +773,32 @@ protected function _sniffMultiplex()
Horde_ActiveSync_Device::MULTIPLEX_CALENDAR |
Horde_ActiveSync_Device::MULTIPLEX_NOTES |
Horde_ActiveSync_Device::MULTIPLEX_TASKS;
} else if (strpos($this->userAgent, 'Outlook/15.0') !== false) {
// OL2013 Doesn't support multiple contact lists.
} else if (strpos($this->userAgent, 'Outlook/15.0') !== false ||
strpos($this->userAgent, 'Outlook/16.0') !== false) {
// OL2013 and OL2016 do not support multiple contact lists.
$this->_properties['properties'][self::MULTIPLEX] = Horde_ActiveSync_Device::MULTIPLEX_CONTACTS;
} else {
$this->_properties['properties']['multiplex'] = 0;
}
}
/**
* Return if this client is an iOS device. Different versions require
* different checks.
*
* @return boolean [description]
*/
protected function _isIos()
{
// Compare in order of likelyhood / most recent to least recent versions.
if (strpos($this->{self::OS}, 'iOS') === 0 ||
strpos($this->userAgent, 'iOS') === 0 ||
in_array(Horde_String::lower($this->clientType), array(self::TYPE_IPAD, self::TYPE_IPOD, self::TYPE_IPHONE)) ||
strpos($this->userAgent, 'Apple-') === 0) {
return true;
}
return false;
}
}
@@ -0,0 +1,79 @@
<?php
/**
* Horde_ActiveSync_Device_Ios::
*
* @license http://www.horde.org/licenses/gpl GPLv2
* NOTE: According to sec. 8 of the GENERAL PUBLIC LICENSE (GPL),
* Version 2, the distribution of the Horde_ActiveSync module in or
* to the United States of America is excluded from the scope of this
* license.
* @copyright 2015 Horde LLC (http://www.horde.org)
* @author Michael J Rubinsky <mrubinsk@horde.org>
* @package ActiveSync
*/
/**
* Contains constants and maps related to iOS devices.
*
* @license http://www.horde.org/licenses/gpl GPLv2
* NOTE: According to sec. 8 of the GENERAL PUBLIC LICENSE (GPL),
* Version 2, the distribution of the Horde_ActiveSync module in or
* to the United States of America is excluded from the scope of this
* license.
* @copyright 2015 Horde LLC (http://www.horde.org)
* @author Michael J Rubinsky <mrubinsk@horde.org>
* @package ActiveSync
*/
class Horde_ActiveSync_Device_Ios
{
/**
* Mapping of regexps to match a ios agent string.
*
* @var array
*/
static public $VERSION_MAP = array(
"801.293" => "4.0",
"801.306" => "4.0.1",
"801.400" => "4.0.2",
"802.117" => "4.1",
"802.118" => "4.1",
"803.148" => "4.2.1",
"803.14800001" => "4.2.1",
"805.128" => "4.2.5",
"805.200" => "4.2.6",
"805.303" => "4.2.7",
"805.401" => "4.2.8",
"805.501" => "4.2.9",
"805.600" => "4.2.10",
"806.190" => "4.3",
"806.191" => "4.3",
"807.4" => "4.3.1",
"808.7" => "4.3.2",
"808.8" => "4.3.2",
"810.2" => "4.3.3",
"810.3" => "4.3.3",
"811.2" => "4.3.4",
"812.1" => "4.3.5",
"901.334" => "5.0",
"901.40\d+" => "5.0.1",
"902.17\d+" => "5.1",
"902.206" => "5.1.1",
"1001.40\d+" => "6.0",
"1001.52\d+" => "6.0.1",
"1002.14\d+"=> "6.1",
"1002.146" => "6.1.2",
"1002.329" => "6.1.3",
"1002.350" => "6.1.3",
"1101.465" => "7.0",
"1101.470"=>"7.0.1",
"1101.47000001"=>"7.0.1",
"1101.501"=>"7.0.2",
"1102.511" => "7.0.3",
"1102.55400001" => "7.0.4",
"1102.601" => "7.0.5",
"1102.651" => "7.0.6",
"1104.167" => "7.1",
"1104.169" => "7.1",
"1104.201" => "7.1.1",
"1104.257" => "7.1.2",
);
}
@@ -88,7 +88,7 @@ class Horde_ActiveSync_Message_Base
protected $_supported = array();
/**
* Existance cache, used for working with ghosted properties.
* Existence cache, used for working with ghosted properties.
*
* @var array
*/
@@ -434,4 +434,19 @@ protected function _formatDate(Horde_Date $dt, $type)
return parent::_formatDate($date, $type);
}
/**
* Set the list of non-ghosted fields for this message.
*
* @param array $fields The array of fields.
*/
public function setSupported(array $fields)
{
// See if we need to explicitly add the picture tag to the supported list.
parent::setSupported($fields);
if ($this->_device->hasQuirk(Horde_ActiveSync_Device::QUIRK_NEEDS_SUPPORTED_PICTURE_TAG) &&
!in_array($this->_mapping[self::PICTURE][self::KEY_ATTRIBUTE], $this->_supported)) {
$this->_supported[] = $this->_mapping[self::PICTURE][self::KEY_ATTRIBUTE];
}
}
}
@@ -128,8 +128,6 @@ protected function _handle()
$search_query = array();
switch (Horde_String::lower($search_name)) {
case 'documentlibrary':
$search_query['query'] = $this->_parseQuery();
break;
case 'mailbox':
$search_query['query'] = $this->_parseQuery();
break;
@@ -286,7 +286,7 @@ protected function _loadState($type)
}
if (empty($results)) {
$this->_logger->err(sprintf(
$this->_logger->warn(sprintf(
'[%s] Could not find state for synckey %s.',
$this->_procid,
$this->_syncKey));

0 comments on commit 1dfebf6

Please sign in to comment.
You can’t perform that action at this time.