Skip to content

Commit

Permalink
Merge branch 'master' into mnemo_4_2
Browse files Browse the repository at this point in the history
Conflicts:
	mnemo/docs/CHANGES
	mnemo/lib/Api.php
	mnemo/lib/Driver.php
	mnemo/package.xml
  • Loading branch information
mrubinsk committed Oct 28, 2013
2 parents 185fabb + ee6c576 commit 47bd475
Show file tree
Hide file tree
Showing 44 changed files with 454 additions and 119 deletions.
6 changes: 5 additions & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Imap/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,11 @@ public function getAttachmentsMimeParts()
$map = $this->_message->contentTypeMap();
foreach ($map as $id => $type) {
if ($this->isAttachment($id, $type)) {
$mime_parts[] = $this->getMimePart($id);
$part = $this->getMimePart($id);
if ($part->getType() == 'text/calendar') {
$part->setDisposition('inline');
}
$mime_parts[] = $part;
}
}

Expand Down
10 changes: 6 additions & 4 deletions framework/ActiveSync/lib/Horde/ActiveSync/State/Mongo.php
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ public function getLastSyncTimestamp($id = null, $user = null)
}

if (empty($results) || empty($results['ok'])) {
throw new Horde_ActiveSync_Exception('Error running aggregation.');
throw new Horde_ActiveSync_Exception(empty($results['errmsg']) ? 'Error running aggregation.' : $results['errmsg']);
}
if (empty($results) || empty($results['ok'])) {
return 0;
Expand Down Expand Up @@ -1237,8 +1237,8 @@ protected function _getPIMChangeTS(array $changes)
foreach ($changes as $change) {
$match['$or'][] = array(
'$and' => array(
'message_uid' => $change['id'],
'sync_deleted' => $change['type'] == Horde_ActiveSync::CHANGE_TYPE_DELETE
array('message_uid' => $change['id']),
array('sync_deleted' => $change['type'] == Horde_ActiveSync::CHANGE_TYPE_DELETE)
)
);
}
Expand All @@ -1257,7 +1257,9 @@ protected function _getPIMChangeTS(array $changes)
throw new Horde_ActiveSync_Exception($e);
}
if (empty($rows) || empty($rows['ok'])) {
throw new Horde_ActiveSync_Exception('Error running aggregation.');
throw new Horde_ActiveSync_Exception(sprintf(
'Error running aggregation: %s',
empty($rows['errmsg']) ? '' : $rows['errmsg']));
}
$results = array();
foreach ($rows as $row) {
Expand Down
2 changes: 1 addition & 1 deletion framework/Core/js/prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ Array.from = $A;
(function() {
var arrayProto = Array.prototype,
slice = arrayProto.slice,
_each = arrayProto.forEach; // use native browser JS 1.6 implementation if available
_each = Prototype.Browser.IE ? null : arrayProto.forEach; // use native browser JS 1.6 implementation if available (HORDE EDIT)

function each(iterator, context) {
for (var i = 0, length = this.length >>> 0; i < length; i++) {
Expand Down
28 changes: 15 additions & 13 deletions framework/Core/lib/Horde/Core/ActiveSync/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,21 +302,23 @@ public function contacts_getActionTimestamp($uid, $action)
*/
public function contacts_search($query, array $options = array())
{
$gal = $this->contacts_getGal();
if (!empty($gal)) {
$fields = array($gal => array('firstname', 'lastname', 'alias', 'name', 'email', 'office'));
if (!empty($options['pictures'])) {
$fields[$gal][] = 'photo';
}
$opts = array(
'fields' => $fields,
'matchBegin' => true,
'forceSource' => true,
'sources' => array($gal)
);
if (!$gal = $this->contacts_getGal()) {
return array();
}

return $this->_registry->contacts->search($query, $opts);
$fields = array($gal => array('firstname', 'lastname', 'alias', 'name', 'email', 'office'));
if (!empty($options['pictures'])) {
$fields[$gal][] = 'photo';
}
$opts = array(
'fields' => $fields,
'matchBegin' => true,
'forceSource' => true,
'sources' => array($gal)
);

return $this->_registry->contacts->search($query, $opts);

}

/**
Expand Down
4 changes: 2 additions & 2 deletions framework/Core/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [mms] Fix prototype.js issue in IE 9 regarding array iteration in a parent window.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -3209,7 +3209,7 @@
<date>2013-10-21</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [mms] Fix prototype.js issue in IE 9 regarding array iteration in a parent window.
</notes>
</release>
</changelog>
Expand Down
2 changes: 1 addition & 1 deletion framework/Form/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"version": "2.0.6",
"time": "2013-06-27",
"time": "2013-10-25",
"repositories": [
{
"type": "pear",
Expand Down
7 changes: 1 addition & 6 deletions framework/Form/lib/Horde/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Horde_Form {
protected $_enctype = null;
public $_help = false;

function Horde_Form($vars, $title = '', $name = null)
function __construct($vars, $title = '', $name = null)
{
if (empty($name)) {
$name = Horde_String::lower(get_class($this));
Expand All @@ -49,11 +49,6 @@ function Horde_Form($vars, $title = '', $name = null)
$this->_name = $name;
}

function __construct($vars, $title = '', $name = null)
{
$this->Horde_Form($vars, $title, $name);
}

function singleton($form, &$vars, $title = '', $name = null)
{
static $instances = array();
Expand Down
20 changes: 16 additions & 4 deletions framework/Form/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
<email>jan@horde.org</email>
<active>yes</active>
</lead>
<date>2013-06-27</date>
<time>10:05:42</time>
<date>2013-10-25</date>
<version>
<release>2.0.6</release>
<release>2.0.7</release>
<api>1.1.0</api>
</version>
<stability>
Expand Down Expand Up @@ -859,7 +858,20 @@ Converted to package.xml 2.0 for pear.horde.org
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-06-27</date>
<date>2013-10-25</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Remove duplicate constructor.
</notes>
</release>
<release>
<version>
<release>2.0.7</release>
<api>1.1.0</api></version>
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-10-24</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
Expand Down
4 changes: 2 additions & 2 deletions framework/Imap_Client/doc/Horde/Imap/Client/UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Upgrading to 2.16.0

- Horde_Imap_Client_Password_Xoauth2

Added the class to abstract production of the necessary authentication
token for XOAUTH2 SASL authentication.
Added class to abstract production of the necessary token for XOAUTH2 SASL
authentication.


Upgrading to 2.15.0
Expand Down
6 changes: 3 additions & 3 deletions framework/Imap_Client/lib/Horde/Imap/Client/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public function getNamespaces(array $additional = array())
$this->login();

$additional = array_map('strval', $additional);
$sig = hash('md5', serialize($additional));
$sig = hash('sha1', serialize($additional));

if (isset($this->_init['namespace'][$sig])) {
return $this->_init['namespace'][$sig];
Expand Down Expand Up @@ -2705,7 +2705,7 @@ private function _fetchWrapper($mailbox, $query, $options)
if (!empty($val['cache']) && !empty($val['peek'])) {
$cache_array[$k] = $v;
ksort($val);
$header_cache[$key] = hash('md5', serialize($val));
$header_cache[$key] = hash('sha1', serialize($val));
}
}
break;
Expand Down Expand Up @@ -3961,7 +3961,7 @@ protected function _getSearchCache($type, $options)
}

ksort($options);
$cache = hash('md5', $type . serialize($options));
$cache = hash('sha1', $type . serialize($options));
$cacheid = $this->getCacheId($this->_selected);
$ret = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function remove($criteria, $key)
*/
public function hash()
{
return hash('md5', serialize($this));
return hash('sha1', serialize($this));
}

/* ArrayAccess methods. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getPassword()
// ^A represents a Control+A (\001)
return base64_encode(
'user=' . $this->username . "\1" .
'auth=Bearer ' . $access_token . "\1\1"
'auth=Bearer ' . $this->access_token . "\1\1"
);
}

Expand Down
12 changes: 10 additions & 2 deletions framework/Imap_Client/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<email>slusarz@horde.org</email>
<active>yes</active>
</lead>
<date>2013-10-17</date>
<date>2013-10-25</date>
<version>
<release>2.16.0</release>
<api>2.16.0</api>
Expand All @@ -21,6 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Use SHA-1 instead of MD5 for internal hashing.
* [mms] Correctly handle untagged BAD IMAP responses.
* [mms] Added Horde_Imap_Client_Password_Xoauth2 class.
* [mms] Fix harmless PHP undefined error when using with an IMAP server that supports XOAUTH2.
Expand Down Expand Up @@ -124,6 +125,9 @@
<dir name="Mailbox">
<file name="List.php" role="php" />
</dir> <!-- /lib/Horde/Imap/Client/Mailbox -->
<dir name="Password">
<file name="Xoauth2.php" role="php" />
</dir> <!-- /lib/Horde/Imap/Client/Password -->
<dir name="Search">
<file name="Query.php" role="php" />
</dir> <!-- /lib/Horde/Imap/Client/Search -->
Expand Down Expand Up @@ -250,6 +254,7 @@
<file name="TokenizeTest.php" role="test" />
<file name="UrlParseTest.php" role="test" />
<file name="Utf7ConvertTest.php" role="test" />
<file name="Xoauth2Test.php" role="test" />
</dir> <!-- /test/Horde/Imap/Client -->
</dir> <!-- /test/Horde/Imap -->
</dir> <!-- /test/Horde -->
Expand Down Expand Up @@ -444,6 +449,7 @@
<install as="Horde/Imap/Client/Interaction/Server/Tagged.php" name="lib/Horde/Imap/Client/Interaction/Server/Tagged.php" />
<install as="Horde/Imap/Client/Interaction/Server/Untagged.php" name="lib/Horde/Imap/Client/Interaction/Server/Untagged.php" />
<install as="Horde/Imap/Client/Mailbox/List.php" name="lib/Horde/Imap/Client/Mailbox/List.php" />
<install as="Horde/Imap/Client/Password/Xoauth2.php" name="lib/Horde/Imap/Client/Password/Xoauth2.php" />
<install as="Horde/Imap/Client/Search/Query.php" name="lib/Horde/Imap/Client/Search/Query.php" />
<install as="Horde/Imap/Client/Socket/Catenate.php" name="lib/Horde/Imap/Client/Socket/Catenate.php" />
<install as="Horde/Imap/Client/Socket/ClientSort.php" name="lib/Horde/Imap/Client/Socket/ClientSort.php" />
Expand Down Expand Up @@ -486,6 +492,7 @@
<install as="Horde/Imap/Client/TokenizeTest.php" name="test/Horde/Imap/Client/TokenizeTest.php" />
<install as="Horde/Imap/Client/UrlParseTest.php" name="test/Horde/Imap/Client/UrlParseTest.php" />
<install as="Horde/Imap/Client/Utf7ConvertTest.php" name="test/Horde/Imap/Client/Utf7ConvertTest.php" />
<install as="Horde/Imap/Client/Xoauth2Test.php" name="test/Horde/Imap/Client/Xoauth2Test.php" />
<install as="Horde/Imap/Client/Cache/CacheTest.php" name="test/Horde/Imap/Client/Cache/CacheTest.php" />
<install as="Horde/Imap/Client/Cache/DbTest.php" name="test/Horde/Imap/Client/Cache/DbTest.php" />
<install as="Horde/Imap/Client/Cache/MongoTest.php" name="test/Horde/Imap/Client/Cache/MongoTest.php" />
Expand Down Expand Up @@ -2046,9 +2053,10 @@
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-10-17</date>
<date>2013-10-25</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Use SHA-1 instead of MD5 for internal hashing.
* [mms] Correctly handle untagged BAD IMAP responses.
* [mms] Added Horde_Imap_Client_Password_Xoauth2 class.
* [mms] Fix harmless PHP undefined error when using with an IMAP server that supports XOAUTH2.
Expand Down
43 changes: 43 additions & 0 deletions framework/Imap_Client/test/Horde/Imap/Client/Xoauth2Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Copyright 2013 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.
*
* @category Horde
* @copyright 2013 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Imap_Client
* @subpackage UnitTests
*/

/**
* Tests for the mailbox object.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2013 Horde LLC
* @ignore
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Imap_Client
* @subpackage UnitTests
*/
class Horde_Imap_Client_Xoauth2Test extends PHPUnit_Framework_TestCase
{

public function testTokenGeneration()
{
// Example from https://developers.google.com/gmail/xoauth2_protocol
$xoauth2 = new Horde_Imap_Client_Password_Xoauth2(
'someuser@example.com',
'vF9dft4qmTc2Nvb3RlckBhdHRhdmlzdGEuY29tCg=='
);

$this->assertEquals(
'dXNlcj1zb21ldXNlckBleGFtcGxlLmNvbQFhdXRoPUJlYXJlciB2RjlkZnQ0cW1UYzJOdmIzUmxja0JoZEhSaGRtbHpkR0V1WTI5dENnPT0BAQ==',
$xoauth2->getPassword()
);
}

}
2 changes: 1 addition & 1 deletion framework/Prefs/lib/Horde/Prefs/Scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function next()
*/
public function rewind()
{
return rewind($this->_prefs);
return reset($this->_prefs);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions framework/Prefs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [mms] Fix iteration of Horde_Prefs_Scope object.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -1069,7 +1069,7 @@ Initial release as a PEAR package
<date>2013-07-16</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [mms] Fix iteration of Horde_Prefs_Scope object.
</notes>
</release>
</changelog>
Expand Down
13 changes: 11 additions & 2 deletions framework/Smtp/doc/Horde/Smtp/UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,17 @@
This lists the API changes between releases of the package.


Upgrading to 1.3.0
==================

- Horde_Smtp_Password_Xoauth2

Added class to abstract production of the necessary token for XOAUTH2 SASL
authentication.


Upgrading to 1.2.0
===================
==================

- Horde_Smtp

Expand All @@ -23,7 +32,7 @@ Upgrading to 1.2.0


Upgrading to 1.1.0
===================
==================

- Horde_Smtp

Expand Down

0 comments on commit 47bd475

Please sign in to comment.