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 Oct 22, 2013
2 parents 3d6e4ae + 3bf7599 commit c0caa8a
Show file tree
Hide file tree
Showing 37 changed files with 917 additions and 623 deletions.
2 changes: 1 addition & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php
Expand Up @@ -458,6 +458,7 @@ protected function _handle()
$collection['mimesupport'] = 0;
}

$ensure_sent = array();
if ($statusCode == self::STATUS_SUCCESS) {
if (!empty($collection['clientids']) || !empty($collection['fetchids'])
|| !empty($collection['missing']) || !empty($collection['importfailures'])) {
Expand Down Expand Up @@ -510,7 +511,6 @@ protected function _handle()
}

// Output any SYNC_MODIFY failures
$ensure_sent = array();
if (!empty($collection['importfailures'])) {
foreach ($collection['importfailures'] as $id => $reason) {
$this->_encoder->startTag(Horde_ActiveSync::SYNC_MODIFY);
Expand Down
4 changes: 2 additions & 2 deletions framework/Alarm/lib/Horde/Alarm/Sql.php
Expand Up @@ -388,12 +388,12 @@ public function initialize()
switch ($this->_db->adapterName()) {
case 'PDO_Oci':
$query = "ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'";
$db->select($query);
$this->_db->select($query);
break;

case 'PDO_PostgreSQL':
$query = "SET datestyle TO 'iso'";
$db->select($query);
$this->_db->select($query);
break;
}
}
Expand Down
20 changes: 16 additions & 4 deletions framework/Alarm/package.xml
Expand Up @@ -10,10 +10,9 @@
<email>jan@horde.org</email>
<active>yes</active>
</lead>
<date>2013-03-05</date>
<time>14:19:48</time>
<date>2013-10-21</date>
<version>
<release>2.0.5</release>
<release>2.0.6</release>
<api>1.0.0</api>
</version>
<stability>
Expand Down Expand Up @@ -845,7 +844,20 @@
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-03-05</date>
<date>2013-10-21</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mjr] Fix initializing Alarms when using PDO_Oci or PDO_PostgreSQL.
</notes>
</release>
<release>
<version>
<release>2.0.6</release>
<api>1.0.0</api></version>
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-10-21</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
Expand Down
23 changes: 17 additions & 6 deletions framework/Core/package.xml
Expand Up @@ -28,9 +28,9 @@
<email>mrubinsk@horde.org</email>
<active>yes</active>
</developer>
<date>2013-10-15</date>
<date>2013-10-21</date>
<version>
<release>2.10.1</release>
<release>2.10.2</release>
<api>2.10.0</api>
</version>
<stability>
Expand All @@ -39,9 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mjr] Ensure Bcc is removed from headers when sent via ActiveSync (Bug #12771).
* [mjr] Fix calculating calendars to use for SOFTDELETE commands in certain configurations (Bug #12765).
* [mms] Upgrade jQuery Mobile to v1.3.2/jQuery Core to v1.9.1.
*
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -3193,13 +3191,26 @@
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-10-15</date>
<date>2013-10-21</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mjr] Ensure Bcc is removed from headers when sent via ActiveSync (Bug #12771).
* [mjr] Fix calculating calendars to use for SOFTDELETE commands in certain configurations (Bug #12765).
* [mms] Upgrade jQuery Mobile to v1.3.2/jQuery Core to v1.9.1.
</notes>
</release>
<release>
<version>
<release>2.10.2</release>
<api>2.10.0</api></version>
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-10-21</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
</notes>
</release>
</changelog>
</package>
9 changes: 9 additions & 0 deletions framework/Imap_Client/doc/Horde/Imap/Client/UPGRADING
Expand Up @@ -11,6 +11,15 @@
This lists the API changes between releases of the package.


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.


Upgrading to 2.15.0
===================

Expand Down
71 changes: 71 additions & 0 deletions framework/Imap_Client/lib/Horde/Imap/Client/Password/Xoauth2.php
@@ -0,0 +1,71 @@
<?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
*/

/**
* Generates an OAuth 2.0 authentication token as used in the Gmail XOAUTH2
* authentication mechanism.
*
* See: https://developers.google.com/gmail/xoauth2_protocol
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2013 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Imap_Client
* @since 2.16.0
*/
class Horde_Imap_Client_Password_Xoauth2
implements Horde_Imap_Client_Base_Password
{
/**
* Access token.
*
* @var string
*/
public $access_token;

/**
* Username.
*
* @var string
*/
public $username;

/**
* Constructor.
*
* @param string $username The username.
* @param string $access_token The access token.
*/
public function __construct($username, $access_token)
{
$this->username = $username;
$this->access_token = $access_token;
}

/**
* Return the password to use for the server connection.
*
* @return string The password.
*/
public function getPassword()
{
// base64("user=" {User} "^Aauth=Bearer " {Access Token} "^A^A")
// ^A represents a Control+A (\001)
return base64_encode(
'user=' . $this->username . "\1" .
'auth=Bearer ' . $access_token . "\1\1"
);
}

}
38 changes: 16 additions & 22 deletions framework/Imap_Client/lib/Horde/Imap/Client/Socket.php
Expand Up @@ -4151,15 +4151,24 @@ protected function _getLine(

switch ($server->status) {
case $server::BAD:
case $server::NO:
/* A tagged BAD response indicates that the tagged command caused
* the error. This information is unknown if untagged (RFC 3501
* [7.1.3]). */
throw new Horde_Imap_Client_Exception_ServerResponse(
Horde_Imap_Client_Translation::t("IMAP error reported by server."),
0,
$server,
$pipeline
);
* [7.1.3]) - ignore these untagged responses.
* An untagged NO response indicates a warning; ignore and assume
* that it also included response text code that is handled
* elsewhere. Throw exception if tagged; command handlers can
* catch this if able to workaround this issue (RFC 3501
* [7.1.2]). */
if ($server instanceof Horde_Imap_Client_Interaction_Server_Tagged) {
throw new Horde_Imap_Client_Exception_ServerResponse(
Horde_Imap_Client_Translation::t("IMAP error reported by server."),
0,
$server,
$pipeline
);
}
break;

case $server::BYE:
/* A BYE response received as part of a logout command should be
Expand All @@ -4175,21 +4184,6 @@ protected function _getLine(
}
break;

case $server::NO:
/* An untagged NO response indicates a warning; ignore and assume
* that it also included response text code that is handled
* elsewhere. Throw exception if tagged; command handlers can
* catch this if able to workaround this issue (RFC 3501
* [7.1.2]). */
if ($server instanceof Horde_Imap_Client_Interaction_Server_Tagged) {
throw new Horde_Imap_Client_Exception_ServerResponse(
Horde_Imap_Client_Translation::t("IMAP error reported by server."),
0,
$server,
$pipeline
);
}

case $server::PREAUTH:
/* The user was pre-authenticated. (RFC 3501 [7.1.4]) */
$this->_temp['preauth'] = true;
Expand Down
12 changes: 8 additions & 4 deletions framework/Imap_Client/package.xml
Expand Up @@ -12,15 +12,17 @@
</lead>
<date>2013-10-17</date>
<version>
<release>2.15.6</release>
<api>2.15.0</api>
<release>2.16.0</release>
<api>2.16.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [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.
</notes>
<contents>
Expand Down Expand Up @@ -2039,14 +2041,16 @@
</release>
<release>
<version>
<release>2.15.6</release>
<api>2.15.0</api></version>
<release>2.16.0</release>
<api>2.16.0</api></version>
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-10-17</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [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.
</notes>
</release>
Expand Down
3 changes: 2 additions & 1 deletion framework/Smtp/composer.json
Expand Up @@ -12,7 +12,7 @@
}
],
"version": "1.2.5",
"time": "2013-10-15",
"time": "2013-10-19",
"repositories": [
{
"type": "pear",
Expand All @@ -23,6 +23,7 @@
"php": ">=5.3.0",
"pear-pear.horde.org/Horde_Exception": ">=2.0.0@stable,<=3.0.0alpha1@stable",
"pear-pear.horde.org/Horde_Mail": ">=2.0.0@stable,<=3.0.0alpha1@stable",
"pear-pear.horde.org/Horde_Socket_Client": ">=1.0.0@stable,<=2.0.0alpha1@stable",
"pear-pear.horde.org/Horde_Support": ">=2.0.0@stable,<=3.0.0alpha1@stable"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion framework/Smtp/lib/Horde/Smtp/Filter/Data.php
Expand Up @@ -48,7 +48,7 @@ public function filter($in, $out, &$consumed, $closing)
// EOLs need to be CRLF; double leading periods.
$bucket->data = preg_replace(
array("/(?:\r\n|\n|\r(?!\n))/", "/\n\./"),
array("\r\n", '..'),
array("\r\n", "\n.."),
$bucket->data
);

Expand Down
21 changes: 18 additions & 3 deletions framework/Smtp/package.xml
Expand Up @@ -10,9 +10,9 @@
<email>slusarz@horde.org</email>
<active>yes</active>
</lead>
<date>2013-10-15</date>
<date>2013-10-19</date>
<version>
<release>1.2.5</release>
<release>1.2.6</release>
<api>1.2.0</api>
</version>
<stability>
Expand Down Expand Up @@ -59,6 +59,7 @@
<file name="AllTests.php" role="test" />
<file name="bootstrap.php" role="test" />
<file name="conf.php.dist" role="test" />
<file name="FilterDataTest.php" role="test" />
<file name="phpunit.xml" role="test" />
<file name="RemoteServerTest.php" role="test" />
</dir> <!-- /test/Horde/Smtp -->
Expand Down Expand Up @@ -142,6 +143,7 @@
<install as="Horde/Smtp/AllTests.php" name="test/Horde/Smtp/AllTests.php" />
<install as="Horde/Smtp/bootstrap.php" name="test/Horde/Smtp/bootstrap.php" />
<install as="Horde/Smtp/conf.php.dist" name="test/Horde/Smtp/conf.php.dist" />
<install as="Horde/Smtp/FilterDataTest.php" name="test/Horde/Smtp/FilterDataTest.php" />
<install as="Horde/Smtp/phpunit.xml" name="test/Horde/Smtp/phpunit.xml" />
<install as="Horde/Smtp/RemoteServerTest.php" name="test/Horde/Smtp/RemoteServerTest.php" />
</filelist>
Expand Down Expand Up @@ -253,7 +255,20 @@
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-10-15</date>
<date>2013-10-19</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Fix escaping periods that begin a line of DATA input.
</notes>
</release>
<release>
<version>
<release>1.2.6</release>
<api>1.2.0</api></version>
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-10-18</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
Expand Down

0 comments on commit c0caa8a

Please sign in to comment.