Skip to content

Commit

Permalink
Merge branch 'master' into kronolith_4_2
Browse files Browse the repository at this point in the history
Conflicts:
	kronolith/lib/Kronolith.php
  • Loading branch information
mrubinsk committed Nov 8, 2013
2 parents 2b70904 + d58e1c6 commit 7c67066
Show file tree
Hide file tree
Showing 26 changed files with 332 additions and 118 deletions.
Expand Up @@ -324,9 +324,6 @@ public function importFolderChange($uid, $displayname, $parent = Horde_ActiveSyn

try {
$new_uid = $this->_as->driver->changeFolder($folderid, $displayname, $parent_sid, $uid, $type);
} catch (Horde_Exception_PermissionDenied $e) {
$this->_logger->err($e->getMessage());
throw new Horde_ActiveSync_Exception($e->getMessage(), Horde_ActiveSync_Exception::UNSUPPORTED);
} catch (Horde_ActiveSync_Exception $e) {
$this->_logger->err($e->getMessage());
throw $e;
Expand Down
20 changes: 0 additions & 20 deletions framework/Core/doc/Horde/Core/UPGRADING

This file was deleted.

4 changes: 2 additions & 2 deletions framework/Core/js/horde.js
Expand Up @@ -67,8 +67,8 @@ Object.extend(String.prototype, {
// prototype's evalScripts().
evalScripts: function()
{
// TODO: Prototypejs seems to be triggering an evalScripts on the
// window object. Remove when this is fixed upstream.
// Prototypejs seems to be triggering an evalScripts on the
// window object.
if (!Object.isString(this)) {
return;
}
Expand Down
67 changes: 56 additions & 11 deletions framework/Core/js/hordecore.js
Expand Up @@ -390,9 +390,7 @@ var HordeCore = {
});
}
}.bindAsEventListener(this))
.observe('click', function(e) {
e.stop();
});
.observe('click', Event.stop);
message.down('input[type=button]').observe('click', function(e) {
var ajax_params = $H({
alarm: alarm.id,
Expand Down Expand Up @@ -544,14 +542,31 @@ var HordeCore = {

initHandler: function(type)
{
var h, t;

if (!this.handlers[type]) {
switch (type) {
case 'click':
case 'dblclick':
this.handlers[type] = this.clickHandler.bindAsEventListener(this);
document.observe(type, this.handlers[type]);
h = this.clickHandler;
t = [ type ];
break;

case 'mousewheelY':
h = this.mousewheelYHandler;
t = ('onwheel' in document || (document.documentMode >= 9))
? [ 'wheel' ]
: [ 'mousewheel', 'DomMouseScroll' ];
break;

default:
return;
}

this.handlers[type] = h.bindAsEventListener(this);
t.each(function(e) {
document.observe(e, this.handlers[type]);
}, this);
}
},

Expand All @@ -577,6 +592,33 @@ var HordeCore = {
}
},

// 'HordeCore:mousewheelY' is fired on a vertical mouse wheel scroll event
// for every element up to the document root. The memo attribute is
// an integer: either -1 or 1.
//
// @since 2.11.0
mousewheelYHandler: function(e)
{
var delta = 0;

if (e.wheelDelta) {
delta = e.wheelDelta;
}
if (e.detail) {
delta = e.detail * -1;
}
if (e.deltaY) {
delta = e.deltaY * -1;
}
if (!Object.isUndefined(e.wheelDeltaY)) {
delta = e.wheelDeltaY;
}

if (delta) {
e.element().fire('HordeCore:mousewheelY', (delta > 0) ? 1 : -1);
}
},

tasksHandler: function(e)
{
var t = e.tasks || {};
Expand All @@ -590,6 +632,14 @@ var HordeCore = {
}
},

onGrowlerDestroy: function(e)
{
var id = e.element().retrieve('alarm');
if (id) {
this.alarms = this.alarms.without(id);
}
},

onDomLoad: function()
{
/* Determine base window. Need a try/catch block here since, if the
Expand Down Expand Up @@ -621,12 +671,7 @@ var HordeCore = {
};

document.observe('dom:loaded', HordeCore.onDomLoad.bind(HordeCore));
document.observe('Growler:destroyed', function(e) {
var id = e.element().retrieve('alarm');
if (id) {
this.alarms = this.alarms.without(id);
}
}.bindAsEventListener(HordeCore));
document.observe('Growler:destroyed', HordeCore.onGrowlerDestroy.bindAsEventListener(HordeCore));
document.observe('Growler:linkClick', function(e) {
window.location.assign(e.memo.href);
});
Expand Down
20 changes: 14 additions & 6 deletions framework/Core/lib/Horde/Core/Prefs/Ui.php
Expand Up @@ -173,28 +173,36 @@ public function getChangeablePrefs($group = null)
continue;
}

$todo = array();

if ($p['type'] == 'container') {
if (isset($p['value']) && is_array($p['value'])) {
$cprefs = array_merge($cprefs, $p['value']);
foreach ($p['value'] as $val) {
$todo[$val] = $this->prefs[$val];
}
}
} else {
if (isset($p['requires'])) {
foreach ($p['requires'] as $val) {
$todo[$pref] = $p;
}

foreach ($todo as $k2 => $p2) {
if (isset($p2['requires'])) {
foreach ($p2['requires'] as $val) {
if (!$prefs->getValue($val)) {
continue 2;
}
}
}

if (isset($p['requires_nolock'])) {
foreach ($p['requires_nolock'] as $val) {
if (isset($p2['requires_nolock'])) {
foreach ($p2['requires_nolock'] as $val) {
if ($prefs->isLocked($val)) {
continue 2;
}
}
}

$cprefs[] = $pref;
$cprefs[] = $k2;
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions framework/Core/package.xml
Expand Up @@ -28,7 +28,7 @@
<email>mrubinsk@horde.org</email>
<active>yes</active>
</developer>
<date>2013-10-29</date>
<date>2013-11-06</date>
<version>
<release>2.11.0</release>
<api>2.11.0</api>
Expand All @@ -39,6 +39,8 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Fix hiding preferences if they are contained within a prefs container.
* [mms] Added standardized/normalized mousewheelY javascript event handling to HordeCore.
* [mms] Add nonce generation/checking to Horde_Session.
* [mms] Application hook methods moved from Horde:: to Horde_Core_Hooks::.
* [mms] Add &apos;fallback&apos; option for the Horde_Registry#appInit() &apos;authentication&apos; parameter.
Expand All @@ -50,7 +52,6 @@
<dir name="Horde">
<dir name="Core">
<file name="COPYING" role="doc" />
<file name="UPGRADING" role="doc" />
</dir> <!-- /doc/Horde/Core -->
</dir> <!-- /doc/Horde -->
</dir> <!-- /doc -->
Expand Down Expand Up @@ -1442,7 +1443,6 @@
<phprelease>
<filelist>
<install as="COPYING" name="doc/Horde/Core/COPYING" />
<install as="UPGRADING" name="doc/Horde/Core/UPGRADING" />
<install as="js/accesskeys.js" name="js/accesskeys.js" />
<install as="js/addressbooksprefs.js" name="js/addressbooksprefs.js" />
<install as="js/alarmprefs.js" name="js/alarmprefs.js" />
Expand Down Expand Up @@ -3224,9 +3224,11 @@
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-10-29</date>
<date>2013-11-06</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Fix hiding preferences if they are contained within a prefs container.
* [mms] Added standardized/normalized mousewheelY javascript event handling to HordeCore.
* [mms] Add nonce generation/checking to Horde_Session.
* [mms] Application hook methods moved from Horde:: to Horde_Core_Hooks::.
* [mms] Add &apos;fallback&apos; option for the Horde_Registry#appInit() &apos;authentication&apos; parameter.
Expand Down
25 changes: 16 additions & 9 deletions framework/Crypt/lib/Horde/Crypt/Pgp.php
Expand Up @@ -693,16 +693,16 @@ public function verifyPassphrase($public_key, $private_key, $passphrase)
/**
* Parses a message into text and PGP components.
*
* @param string $text The text to parse.
* @param mixed $text Either the text to parse or a Horde_Stream object
* (@since 2.3.0).
*
* @return array An array with the parsed text, returned in blocks of
* text corresponding to their actual order. Keys:
* <pre>
* 'type' - (integer) The type of data contained in block.
* Valid types are defined at the top of this class
* (the ARMOR_* constants).
* 'data' - (array) The data for each section. Each line has been stripped
* of EOL characters.
* - data: (array) The data for each section. Each line has been
* stripped of EOL characters.
* - type: (integer) The type of data contained in block. Valid types
* are the class ARMOR_* constants.
* </pre>
*/
public function parsePGPData($text)
Expand All @@ -712,9 +712,16 @@ public function parsePGPData($text)
'type' => self::ARMOR_TEXT
);

$buffer = explode("\n", $text);
while (list(,$val) = each($buffer)) {
$val = rtrim($val, "\r");
if ($text instanceof Horde_Stream) {
$stream = $text;
$stream->rewind();
} else {
$stream = new Horde_Stream_Temp();
$stream->add($text, true);
}

while (!$stream->eof()) {
$val = rtrim($stream->getToChar("\n", false), "\r");
if (preg_match('/^-----(BEGIN|END) PGP ([^-]+)-----\s*$/', $val, $matches)) {
if (isset($temp['data'])) {
$data[] = $temp;
Expand Down
19 changes: 13 additions & 6 deletions framework/Crypt/package.xml
Expand Up @@ -19,16 +19,16 @@
<date>2013-08-27</date>
<time>14:14:17</time>
<version>
<release>2.2.3</release>
<api>2.2.0</api>
<release>2.3.0</release>
<api>2.3.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] Horde_Crypt_Pgp#parsePGPData() now accepts a Horde_Stream object as an argument.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -362,6 +362,13 @@
<max>3.0.0alpha1</max>
<exclude>3.0.0alpha1</exclude>
</package>
<package>
<name>Horde_Stream</name>
<channel>pear.horde.org</channel>
<min>1.5.0</min>
<max>2.0.0alpha1</max>
<exclude>2.0.0alpha1</exclude>
</package>
<package>
<name>Horde_Stream_Filter</name>
<channel>pear.horde.org</channel>
Expand Down Expand Up @@ -925,15 +932,15 @@ Initial release as a PEAR package
</release>
<release>
<version>
<release>2.2.3</release>
<api>2.2.0</api></version>
<release>2.3.0</release>
<api>2.3.0</api></version>
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2013-08-27</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [mms] Horde_Crypt_Pgp#parsePGPData() now accepts a Horde_Stream object as an argument.
</notes>
</release>
</changelog>
Expand Down
12 changes: 11 additions & 1 deletion framework/Crypt/test/Horde/Crypt/PgpTest.php
Expand Up @@ -212,7 +212,17 @@ public function testGetSignersKeyID()

public function testParsePGPData()
{
$out = $this->_pgp->parsePGPData(file_get_contents(__DIR__ . '/fixtures/pgp_signed.txt'));
$data = file_get_contents(__DIR__ . '/fixtures/pgp_signed.txt');
$this->_testParsePGPData($data);

$stream = new Horde_Stream_Temp();
$stream->add($data, true);
$this->_testParsePGPData($stream);
}

protected function _testParsePGPData($data)
{
$out = $this->_pgp->parsePGPData($data);

$this->assertEquals(
2,
Expand Down
33 changes: 33 additions & 0 deletions framework/Pack/composer.json
@@ -0,0 +1,33 @@
{
"name": "horde/horde-pack",
"description": "Horde Pack Utility",
"type": "library",
"homepage": "http://pear.horde.org",
"license": "LGPL-2.1",
"authors": [
{
"name": "Michael Slusarz",
"email": "slusarz@horde.org",
"role": "lead"
}
],
"version": "1.0.0",
"time": "2013-11-06",
"repositories": [
{
"type": "pear",
"url": "http://pear.horde.org"
}
],
"require": {
"php": ">=5.3.0",
"pear-pear.horde.org/Horde_Compress_Fast": ">=1.0.0@stable,<=2.0.0alpha1@stable",
"pear-pear.horde.org/Horde_Exception": ">=2.0.0@stable,<=3.0.0alpha1@stable"
},
"suggest": {
"pear-pear.horde.org/Horde_Test": ">=2.0.0@stable,<=3.0.0alpha1@stable",
"pear-pecl.php.net/igbinary": "*",
"pear-pecl.php.net/msgpack": "*",
"ext-json": "*"
}
}

0 comments on commit 7c67066

Please sign in to comment.