Skip to content

Commit

Permalink
Merge branch 'master' into turba_4_2
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Oct 22, 2013
2 parents e552500 + 3bf7599 commit 91dacdd
Show file tree
Hide file tree
Showing 11 changed files with 147 additions and 42 deletions.
2 changes: 1 addition & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion framework/Test/lib/Horde/Test/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static function addPrefix($prefix, $path)
*/
public static function resolve($class)
{
$filename = str_replace(array('::', '_'), '/', $class);
$filename = str_replace(array('::', '_', '\\'), '/', $class);

foreach (self::$_mappings as $prefix => $path) {
if ((strpos($filename, "/") === false) && ($filename == $prefix)) {
Expand Down
4 changes: 2 additions & 2 deletions framework/Test/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [mms] Fix autoloading from a PHP-defined namespace.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -438,7 +438,7 @@
<date>2013-08-27</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [mms] Fix autoloading from a PHP-defined namespace.
</notes>
</release>
</changelog>
Expand Down
4 changes: 4 additions & 0 deletions horde/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ function _addAnchor($url, $type, $vars, $url_anchor = null)
$logout_reason = null;
}
break;

case Horde_Core_Auth_Application::REASON_SESSIONMAXTIME:
$is_auth = false;
break;
}

/* Change language. */
Expand Down

0 comments on commit 91dacdd

Please sign in to comment.