Projects
Kolab:Winterfell
roundcubemail-selfcontained
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
roundcubemail.spec
Changed
@@ -48,7 +48,7 @@ %global logdir /var/log/roundcubemail %global tmpdir /var/lib/roundcubemail -%global rc_version 1.4.11.20 +%global rc_version 1.4.13 %global plugin_version 3.5.9 #%%global rc_rel_suffix rc2.12 %global dot_rel_suffix %{?rc_rel_suffix:.%{rc_rel_suffix}}
View file
buildroundcubemailtarball.sh
Changed
@@ -2,11 +2,16 @@ set -e -VERSION=1.4.11.20 -GIT_REF=1.4.11-20-g4e1358b4d +VERSION=1.4.13 +GIT_REF=1.4.13 NAME=roundcubemail-$VERSION PLESK_SKIN="roundcubemail-skin-plesk-0.4.0" -LESSC=~/node_modules/less/bin/lessc + +if [ -x "/usr/local/bin/lessc" ]; then + LESSC=/usr/local/bin/lessc +else + LESSC=~/node_modules/less/bin/lessc +fi ROOT_DIR=$(pwd) @@ -42,6 +47,13 @@ }, { "type": "path", + "url": "$PWD/roundcubemail-plugins-kolab-latest/plugins/kolab_auth", + "options": { + "symlink": false + } + }, + { + "type": "path", "url": "$PWD/roundcubemail-plugins-kolab-latest/plugins/kolab_config", "options": { "symlink": false @@ -145,16 +157,19 @@ "kolab/calendar": "~3.5.9", "kolab/kolab_activesync": "~3.5.6", "kolab/kolab_addressbook": "~3.5.6", - "kolab/kolab_config": "~3.4.0", + "kolab/kolab_auth": "~3.5.6", "kolab/kolab_chat": "~3.5.2", + "kolab/kolab_config": "~3.4.0", "kolab/kolab_files": "~3.5.2", "kolab/kolab_folders": "~3.5.2", "kolab/kolab_notes": "~3.5.5", "kolab/kolab_tags": "~3.5.2", + "kolab/net_ldap3": "~1.1.1", "kolab/odfviewer": "~3.4.0", "kolab/pdfviewer": "~3.4.0", "kolab/tasklist": "~3.5.9", "johndoh/contextmenu": "~3.2.1", + "zf1/zend-json": "~1.12.11", "zf1/zend-log": "~1.12.11", "zf1/zend-controller": "~1.12.11", "sabre/dav" : "~2.1.6", @@ -165,7 +180,6 @@ "phpunit/phpunit": "^4.8.36 || ^5.7.21" }, "suggest": { - "kolab/net_ldap3": "~1.1.1 required for connecting to LDAP", "mkopinsky/zxcvbn-php": "^4.4.2 required for Zxcvbn password strength driver" } } @@ -255,7 +269,6 @@ popd - tar --exclude="$NAME/.git" -czf "$ROOT_DIR/$NAME.tar.gz" $NAME cd "$PWD"
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +roundcubemail (1.4.13-0~kolab1) unstable; urgency=low + + * Check in 1.4.13 + + -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Fri, 14 Jan 2022 11:11:11 +0200 + roundcubemail (1.4.11.20-0~kolab1) unstable; urgency=low * Check in 1.4.11.20
View file
roundcubemail-1.4.11.20.tar.gz/CHANGELOG -> roundcubemail-1.4.13.tar.gz/CHANGELOG
Changed
@@ -1,7 +1,12 @@ CHANGELOG Roundcube Webmail =========================== -- Disable the default spellchecker option using spell.roundcube.net (#8182) +RELEASE 1.4.13 +-------------- +- Security: Fix cross-site scripting (XSS) via HTML messages with malicious CSS content + +RELEASE 1.4.12 +-------------- - Enigma: Fix bug where signature verification could fail for non-ascii bodies (#7919) - Fix bug where contacts search didn't work with addressbook_search_mods set to an empty array (#7974) - Fix bug causing some HTML message content to be not centered in Elastic skin (#7911)
View file
roundcubemail-1.4.11.20.tar.gz/composer.json -> roundcubemail-1.4.13.tar.gz/composer.json
Changed
@@ -10,98 +10,105 @@ "repositories": [ { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_activesync", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_activesync", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_addressbook", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_addressbook", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_config", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_auth", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_files", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_config", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_folders", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_files", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_notes", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_folders", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_tags", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_notes", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_chat", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_tags", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/odfviewer", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_chat", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/pdfviewer", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/odfviewer", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/tasklist", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/pdfviewer", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/calendar", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/tasklist", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/libcalendaring", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/calendar", "options": { "symlink": false } }, { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/libkolab", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/libcalendaring", + "options": { + "symlink": false + } + }, + { + "type": "path", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/libkolab", "options": { "symlink": false } @@ -127,16 +134,19 @@ "kolab/calendar": "~3.5.9", "kolab/kolab_activesync": "~3.5.6", "kolab/kolab_addressbook": "~3.5.6", - "kolab/kolab_config": "~3.4.0", + "kolab/kolab_auth": "~3.5.6", "kolab/kolab_chat": "~3.5.2", + "kolab/kolab_config": "~3.4.0", "kolab/kolab_files": "~3.5.2", "kolab/kolab_folders": "~3.5.2", "kolab/kolab_notes": "~3.5.5", "kolab/kolab_tags": "~3.5.2", + "kolab/net_ldap3": "~1.1.1", "kolab/odfviewer": "~3.4.0", "kolab/pdfviewer": "~3.4.0", "kolab/tasklist": "~3.5.9", "johndoh/contextmenu": "~3.2.1", + "zf1/zend-json": "~1.12.11", "zf1/zend-log": "~1.12.11", "zf1/zend-controller": "~1.12.11", "sabre/dav" : "~2.1.6", @@ -147,7 +157,6 @@ "phpunit/phpunit": "^4.8.36 || ^5.7.21" }, "suggest": { - "kolab/net_ldap3": "~1.1.1 required for connecting to LDAP", "mkopinsky/zxcvbn-php": "^4.4.2 required for Zxcvbn password strength driver" } }
View file
roundcubemail-1.4.11.20.tar.gz/composer.lock -> roundcubemail-1.4.13.tar.gz/composer.lock
Changed
@@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7d3579392baf5b35c391ae0ae452a2ba", + "content-hash": "e65d5f8b63e0f2575bc85a12dfffc054", "packages": [ { "name": "caxy/php-htmldiff", @@ -224,7 +224,7 @@ "version": "3.5.10", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/calendar", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/calendar", "reference": "45103d5bdee63f976c918f8cfcf20b400310bcb0" }, "require": { @@ -267,7 +267,7 @@ "version": "3.5.6", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_activesync", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_activesync", "reference": "7e8c46290074fe6c1ab72bc9f6b90aa271ee16ef" }, "require": { @@ -303,7 +303,7 @@ "version": "3.5.10", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_addressbook", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_addressbook", "reference": "29195279f672640ffe38f70ddabe87b56172e889" }, "require": { @@ -335,11 +335,47 @@ } }, { + "name": "kolab/kolab_auth", + "version": "3.5.8", + "dist": { + "type": "path", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_auth", + "reference": "ab0ed459f74a03f8eab6822652e084f0430a4f07" + }, + "require": { + "kolab/libkolab": ">=3.5.1", + "php": ">=5.3.0", + "roundcube/plugin-installer": ">=0.1.3" + }, + "type": "roundcube-plugin", + "license": [ + "AGPLv3" + ], + "authors": [ + { + "name": "Thomas Bruederli", + "email": "bruederli@kolabsys.com", + "role": "Lead" + }, + { + "name": "Aleksander Machniak", + "email": "machniak@kolabsys.com", + "role": "Lead" + } + ], + "description": "Kolab authentication", + "homepage": "https://git.kolab.org/diffusion/RPK/", + "transport-options": { + "symlink": false, + "relative": false + } + }, + { "name": "kolab/kolab_chat", "version": "3.5.4", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_chat", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_chat", "reference": "b2f85fcb8324b9961dd02fb3e3acd92be33b558e" }, "require": { @@ -370,7 +406,7 @@ "version": "3.4.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_config", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_config", "reference": "b31a76c1700679249fc222c46582ecbd1215f117" }, "require": { @@ -401,7 +437,7 @@ "version": "3.5.2", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_files", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_files", "reference": "0439d3783b59d6e52f23e86046881fd0ca8c0bd5" }, "require": { @@ -432,7 +468,7 @@ "version": "3.5.2", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_folders", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_folders", "reference": "c70560fcfe40bf1582ea79debf3ae2aebbe94688" }, "require": { @@ -463,7 +499,7 @@ "version": "3.5.5", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_notes", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_notes", "reference": "07297b8ea8b3827d0ba46801760854b0db560576" }, "require": { @@ -499,7 +535,7 @@ "version": "3.5.2", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_tags", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_tags", "reference": "62ffa5279d9f351941be6b23b0d0478aeff91bfd" }, "require": { @@ -530,7 +566,7 @@ "version": "3.5.10", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/libcalendaring", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/libcalendaring", "reference": "b9ab21ae1a5b134a06c66d55372712630171a590" }, "require": { @@ -566,7 +602,7 @@ "version": "3.5.10", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/libkolab", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/libkolab", "reference": "a8abbba8039ee3bdde7be1b6758893aeff0287d8" }, "require": { @@ -599,11 +635,65 @@ } }, { + "name": "kolab/net_ldap3", + "version": "v1.1.3", + "source": { + "type": "git", + "url": "https://gitlab.com/roundcube/net_ldap3.git", + "reference": "e1835e36fa5d3434f9804670fc3cdd16992ec66a" + }, + "dist": { + "type": "zip", + "url": "https://gitlab.com/api/v4/projects/roundcube%2Fnet_ldap3/repository/archive.zip?sha=e1835e36fa5d3434f9804670fc3cdd16992ec66a", + "reference": "e1835e36fa5d3434f9804670fc3cdd16992ec66a", + "shasum": "" + }, + "require": { + "pear/net_ldap2": ">=2.0.12", + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0+" + ], + "authors": [ + { + "name": "Jeroen van Meeuwen", + "email": "vanmeeuwen@kolabsys.com", + "role": "Lead" + }, + { + "name": "Aleksander Machniak", + "email": "machniak@kolabsys.com", + "role": "Developer" + }, + { + "name": "Thomas Bruederli", + "email": "roundcube@gmail.com", + "role": "Developer" + } + ], + "description": "A successor of the PEAR:Net_LDAP2 module providing advanced functionality for accessing LDAP directories", + "homepage": "http://git.kolab.org/pear/Net_LDAP3/", + "keywords": [ + "PEAR",
View file
roundcubemail-1.4.11.20.tar.gz/config/defaults.inc.php -> roundcubemail-1.4.13.tar.gz/config/defaults.inc.php
Changed
@@ -784,25 +784,28 @@ // if in your system 0 quota means no limit set this option to true $config['quota_zero_as_unlimited'] = false; -// Make use of the built-in spell checker. It is based on GoogieSpell. -$config['enable_spellcheck'] = false; +// Make use of the built-in spell checker. +$config['enable_spellcheck'] = true; // Enables spellchecker exceptions dictionary. // Setting it to 'shared' will make the dictionary shared by all users. $config['spellcheck_dictionary'] = false; // Set the spell checking engine. Possible values: -// - 'googie' - requires 'spellcheck_uri' option to be set (also used for connecting to Nox Spell Server) +// - 'googie' - the default (also used for connecting to Nox Spell Server, see 'spellcheck_uri' setting) // - 'pspell' - requires the PHP Pspell module and aspell installed // - 'enchant' - requires the PHP Enchant module // - 'atd' - install your own After the Deadline server or check with the people at http://www.afterthedeadline.com before using their API +// Since Google shut down their public spell checking service, the default settings +// connect to http://spell.roundcube.net which is a hosted service provided by Roundcube. // You can connect to any other googie-compliant service by setting 'spellcheck_uri' accordingly. $config['spellcheck_engine'] = 'googie'; // For locally installed Nox Spell Server or After the Deadline services, // please specify the URI to call it. -// Get Nox Spell Server from https://github.com/handwritingio/nox_spell_server or -// the After the Deadline package from http://www.afterthedeadline.com +// Get Nox Spell Server from http://orangoo.com/labs/?page_id=72 or +// the After the Deadline package from http://www.afterthedeadline.com. +// Leave empty to use the public API of service.afterthedeadline.com $config['spellcheck_uri'] = ''; // These languages can be selected for spell checking.
View file
roundcubemail-1.4.11.20.tar.gz/index.php -> roundcubemail-1.4.13.tar.gz/index.php
Changed
@@ -2,7 +2,7 @@ /** +-------------------------------------------------------------------------+ | Roundcube Webmail IMAP Client | - | Version 1.4.11 | + | Version 1.4.13 | | | | Copyright (C) The Roundcube Dev Team | | |
View file
roundcubemail-1.4.11.20.tar.gz/installer/index.php -> roundcubemail-1.4.13.tar.gz/installer/index.php
Changed
@@ -3,7 +3,7 @@ /** +-------------------------------------------------------------------------+ | Roundcube Webmail setup tool | - | Version 1.4.11 | + | Version 1.4.13 | | | | Copyright (C) The Roundcube Dev Team | | |
View file
roundcubemail-1.4.11.20.tar.gz/plugins/calendar/calendar.php -> roundcubemail-1.4.13.tar.gz/plugins/calendar/calendar.php
Changed
@@ -2349,7 +2349,7 @@ } $attachments = []; - $eventid = 'cal-' . (!empty($event['id']) ? $event['id'] : 'new-event'); + $eventid = 'cal-' . (!empty($event['id']) ? $event['id'] : 'new'); if (!empty($_SESSION[self::SESSION_KEY]) && $_SESSION[self::SESSION_KEY]['id'] == $eventid) { if (!empty($_SESSION[self::SESSION_KEY]['attachments'])) {
View file
roundcubemail-1.4.11.20.tar.gz/plugins/calendar/calendar_ui.js -> roundcubemail-1.4.13.tar.gz/plugins/calendar/calendar_ui.js
Changed
@@ -399,7 +399,7 @@ $('#event-alarm').show().find('.event-text').html(Q(event.alarms_text).replace(',', ',<br>')); if (calendar.name) $('#event-calendar').show().find('.event-text').html(Q(calendar.name)).addClass('cal-'+calendar.id); - if (event.categories) + if (event.categories && String(event.categories).length) $('#event-category').show().find('.event-text').text(event.categories).addClass('cat-'+String(event.categories).toLowerCase().replace(rcmail.identifier_expr, '')); if (event.free_busy) $('#event-free-busy').show().find('.event-text').text(rcmail.gettext(event.free_busy, 'calendar'));
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/LICENSE
Added
@@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/composer.json
Added
@@ -0,0 +1,31 @@ +{ + "name": "kolab/kolab_auth", + "type": "roundcube-plugin", + "description": "Kolab authentication", + "homepage": "https://git.kolab.org/diffusion/RPK/", + "license": "AGPLv3", + "version": "3.5.8", + "authors": [ + { + "name": "Thomas Bruederli", + "email": "bruederli@kolabsys.com", + "role": "Lead" + }, + { + "name": "Aleksander Machniak", + "email": "machniak@kolabsys.com", + "role": "Lead" + } + ], + "repositories": [ + { + "type": "composer", + "url": "https://plugins.roundcube.net" + } + ], + "require": { + "php": ">=5.3.0", + "roundcube/plugin-installer": ">=0.1.3", + "kolab/libkolab": ">=3.5.1" + } +}
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/config.inc.php
Added
@@ -0,0 +1,97 @@ +<?php + +// The id of the LDAP address book (which refers to the $rcmail_config['ldap_public']) +// or complete addressbook definition array. +// -------------------------------------------------------------------- +// Note: Multi-domain (hosted) installations can resolve domain aliases +// by adding following settings in kolab_auth_addressbook spec.: +// +// 'domain_base_dn' => 'cn=kolab,cn=config', +// 'domain_filter' => '(&(objectclass=domainrelatedobject)(associateddomain=%s))', +// 'domain_name_attr' => 'associateddomain', +// +// With this %dc variable in base_dn and groups/base_dn will be +// replaced with DN string of resolved domain +//--------------------------------------------------------------------- +$config['kolab_auth_addressbook'] = ''; + +// This will overwrite defined filter +$config['kolab_auth_filter'] = '(&(objectClass=kolabInetOrgPerson)(|(uid=%u)(mail=%fu)(alias=%fu)))'; + +// Use this field (from fieldmap configuration) to get authentication ID. Don't use an array here! +$config['kolab_auth_login'] = 'email'; + +// Use these fields (from fieldmap configuration) for default identity. +// If the value array contains more than one field, first non-empty will be used +// Note: These aren't LDAP attributes, but field names in config +// Note: If there's more than one email address, as many identities will be created +$config['kolab_auth_name'] = array('name', 'cn'); +$config['kolab_auth_email'] = array('email'); +$config['kolab_auth_organization'] = array('organization'); + +// Role field (from fieldmap configuration) +$config['kolab_auth_role'] = 'role'; + +// Template for user names displayed in the UI. +// You can use all attributes from the 'fieldmap' property of the 'kolab_auth_addressbook' configuration +$config['kolab_auth_user_displayname'] = '{name} ({ou})'; + +// Login and password of the admin user. Enables "Login As" feature. +$config['kolab_auth_admin_login'] = ''; +$config['kolab_auth_admin_password'] = ''; + +// Enable audit logging for abuse of administrative privileges. +$config['kolab_auth_auditlog'] = false; + +// As set of rules to define the required rights on the target entry +// which allow an admin user to login as another user (the target). +// The effective rights value refers to either entry level attribute level rights: +// * entry:[read|add|delete] +// * attrib:<attribute-name>:[read|write|delete] +$config['kolab_auth_admin_rights'] = array( + // Roundcube task => required effective right + 'settings' => 'entry:read', + 'mail' => 'entry:delete', + 'addressbook' => 'entry:delete', + // or use a wildcard entry like this: + '*' => 'entry:read', +); + +// Enable plugins on a role-by-role basis. In this example, the 'acl' plugin +// is enabled for people with a 'cn=professional-user,dc=mykolab,dc=ch' role. +// +// Note that this does NOT mean the 'acl' plugin is disabled for other people. +$config['kolab_auth_role_plugins'] = Array( + 'cn=professional-user,dc=mykolab,dc=ch' => Array( + 'acl', + ), + ); + +// Settings on a role-by-role basis. In this example, the 'htmleditor' setting +// is enabled(1) for people with a 'cn=professional-user,dc=mykolab,dc=ch' role, +// and it cannot be overridden. Sample use-case: disable htmleditor for normal people, +// do not allow the setting to be controlled through the preferences, enable the +// html editor for professional users and allow them to override the setting in +// the preferences. +$config['kolab_auth_role_settings'] = Array( + 'cn=professional-user,dc=mykolab,dc=ch' => Array( + 'htmleditor' => Array( + 'mode' => 'override', + 'value' => 1, + 'allow_override' => true + ), + ), + ); + +// List of LDAP addressbooks (keys of ldap_public configuration array) +// for which base_dn variables (%dc, etc.) will be replaced according to authenticated user DN +// Note: special name '*' for all LDAP addressbooks +$config['kolab_auth_ldap_addressbooks'] = array('*'); + +// Enables storing/updating session tokens for free-busy token authentication +// See httpauth.allow_token option in Free-Busy service config. +// The option can be set to a number of seconds after which the token-session +// expires or to true (to get the configured Roundcube session time) +$config['freebusy_session_auth'] = null; + +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/config.inc.php.dist
Added
@@ -0,0 +1,97 @@ +<?php + +// The id of the LDAP address book (which refers to the $rcmail_config['ldap_public']) +// or complete addressbook definition array. +// -------------------------------------------------------------------- +// Note: Multi-domain (hosted) installations can resolve domain aliases +// by adding following settings in kolab_auth_addressbook spec.: +// +// 'domain_base_dn' => 'cn=kolab,cn=config', +// 'domain_filter' => '(&(objectclass=domainrelatedobject)(associateddomain=%s))', +// 'domain_name_attr' => 'associateddomain', +// +// With this %dc variable in base_dn and groups/base_dn will be +// replaced with DN string of resolved domain +//--------------------------------------------------------------------- +$config['kolab_auth_addressbook'] = ''; + +// This will overwrite defined filter +$config['kolab_auth_filter'] = '(&(objectClass=kolabInetOrgPerson)(|(uid=%u)(mail=%fu)(alias=%fu)))'; + +// Use this field (from fieldmap configuration) to get authentication ID. Don't use an array here! +$config['kolab_auth_login'] = 'email'; + +// Use these fields (from fieldmap configuration) for default identity. +// If the value array contains more than one field, first non-empty will be used +// Note: These aren't LDAP attributes, but field names in config +// Note: If there's more than one email address, as many identities will be created +$config['kolab_auth_name'] = array('name', 'cn'); +$config['kolab_auth_email'] = array('email'); +$config['kolab_auth_organization'] = array('organization'); + +// Role field (from fieldmap configuration) +$config['kolab_auth_role'] = 'role'; + +// Template for user names displayed in the UI. +// You can use all attributes from the 'fieldmap' property of the 'kolab_auth_addressbook' configuration +$config['kolab_auth_user_displayname'] = '{name} ({ou})'; + +// Login and password of the admin user. Enables "Login As" feature. +$config['kolab_auth_admin_login'] = ''; +$config['kolab_auth_admin_password'] = ''; + +// Enable audit logging for abuse of administrative privileges. +$config['kolab_auth_auditlog'] = false; + +// As set of rules to define the required rights on the target entry +// which allow an admin user to login as another user (the target). +// The effective rights value refers to either entry level attribute level rights: +// * entry:[read|add|delete] +// * attrib:<attribute-name>:[read|write|delete] +$config['kolab_auth_admin_rights'] = array( + // Roundcube task => required effective right + 'settings' => 'entry:read', + 'mail' => 'entry:delete', + 'addressbook' => 'entry:delete', + // or use a wildcard entry like this: + '*' => 'entry:read', +); + +// Enable plugins on a role-by-role basis. In this example, the 'acl' plugin +// is enabled for people with a 'cn=professional-user,dc=mykolab,dc=ch' role. +// +// Note that this does NOT mean the 'acl' plugin is disabled for other people. +$config['kolab_auth_role_plugins'] = Array( + 'cn=professional-user,dc=mykolab,dc=ch' => Array( + 'acl', + ), + ); + +// Settings on a role-by-role basis. In this example, the 'htmleditor' setting +// is enabled(1) for people with a 'cn=professional-user,dc=mykolab,dc=ch' role, +// and it cannot be overridden. Sample use-case: disable htmleditor for normal people, +// do not allow the setting to be controlled through the preferences, enable the +// html editor for professional users and allow them to override the setting in +// the preferences. +$config['kolab_auth_role_settings'] = Array( + 'cn=professional-user,dc=mykolab,dc=ch' => Array( + 'htmleditor' => Array( + 'mode' => 'override', + 'value' => 1, + 'allow_override' => true + ), + ), + ); + +// List of LDAP addressbooks (keys of ldap_public configuration array) +// for which base_dn variables (%dc, etc.) will be replaced according to authenticated user DN +// Note: special name '*' for all LDAP addressbooks +$config['kolab_auth_ldap_addressbooks'] = array('*'); + +// Enables storing/updating session tokens for free-busy token authentication +// See httpauth.allow_token option in Free-Busy service config. +// The option can be set to a number of seconds after which the token-session +// expires or to true (to get the configured Roundcube session time) +$config['freebusy_session_auth'] = null; + +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/kolab_auth.php
Added
@@ -0,0 +1,890 @@ +<?php + +/** + * Kolab Authentication (based on ldap_authentication plugin) + * + * Authenticates on LDAP server, finds canonized authentication ID for IMAP + * and for new users creates identity based on LDAP information. + * + * Supports impersonate feature (login as another user). To use this feature + * imap_auth_type/smtp_auth_type must be set to DIGEST-MD5 or PLAIN. + * + * @version @package_version@ + * @author Aleksander Machniak <machniak@kolabsys.com> + * + * Copyright (C) 2011-2013, Kolab Systems AG <contact@kolabsys.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +class kolab_auth extends rcube_plugin +{ + static $ldap; + private $username; + private $data = array(); + + public function init() + { + $rcmail = rcube::get_instance(); + + $this->load_config(); + $this->require_plugin('libkolab'); + + $this->add_hook('authenticate', array($this, 'authenticate')); + $this->add_hook('startup', array($this, 'startup')); + $this->add_hook('ready', array($this, 'ready')); + $this->add_hook('user_create', array($this, 'user_create')); + + // Hook for password change + $this->add_hook('password_ldap_bind', array($this, 'password_ldap_bind')); + + // Hooks related to "Login As" feature + $this->add_hook('template_object_loginform', array($this, 'login_form')); + $this->add_hook('storage_connect', array($this, 'imap_connect')); + $this->add_hook('managesieve_connect', array($this, 'imap_connect')); + $this->add_hook('smtp_connect', array($this, 'smtp_connect')); + $this->add_hook('identity_form', array($this, 'identity_form')); + + // Hook to modify some configuration, e.g. ldap + $this->add_hook('config_get', array($this, 'config_get')); + + // Hook to modify logging directory + $this->add_hook('write_log', array($this, 'write_log')); + $this->username = $_SESSION['username']; + + // Enable debug logs (per-user), when logged as another user + if (!empty($_SESSION['kolab_auth_admin']) && $rcmail->config->get('kolab_auth_auditlog')) { + $rcmail->config->set('debug_level', 1); + $rcmail->config->set('smtp_log', true); + $rcmail->config->set('log_logins', true); + $rcmail->config->set('log_session', true); + $rcmail->config->set('memcache_debug', true); + $rcmail->config->set('imap_debug', true); + $rcmail->config->set('ldap_debug', true); + $rcmail->config->set('smtp_debug', true); + $rcmail->config->set('sql_debug', true); + + // SQL debug need to be set directly on DB object + // setting config variable will not work here because + // the object is already initialized/configured + if ($db = $rcmail->get_dbh()) { + $db->set_debug(true); + } + } + } + + /** + * Ready hook handler + */ + public function ready($args) + { + $rcmail = rcube::get_instance(); + + // Store user unique identifier for freebusy_session_auth feature + if (!($uniqueid = $rcmail->config->get('kolab_uniqueid'))) { + $uniqueid = $_SESSION['kolab_auth_uniqueid']; + + if (!$uniqueid) { + // Find user record in LDAP + if (($ldap = self::ldap()) && $ldap->ready) { + if ($record = $ldap->get_user_record($rcmail->get_user_name(), $_SESSION['kolab_host'])) { + $uniqueid = $record['uniqueid']; + } + } + } + + if ($uniqueid) { + $uniqueid = md5($uniqueid); + $rcmail->user->save_prefs(array('kolab_uniqueid' => $uniqueid)); + } + } + + // Set/update freebusy_session_auth entry + if ($uniqueid && empty($_SESSION['kolab_auth_admin']) + && ($ttl = $rcmail->config->get('freebusy_session_auth')) + ) { + if ($ttl === true) { + $ttl = $rcmail->config->get('session_lifetime', 0) * 60; + + if (!$ttl) { + $ttl = 10 * 60; + } + } + + $rcmail->config->set('freebusy_auth_cache', 'db'); + $rcmail->config->set('freebusy_auth_cache_ttl', $ttl); + + if ($cache = $rcmail->get_cache_shared('freebusy_auth', false)) { + $key = md5($uniqueid . ':' . rcube_utils::remote_addr() . ':' . $rcmail->get_user_name()); + $value = $cache->get($key); + $deadline = new DateTime('now', new DateTimeZone('UTC')); + + // We don't want to do the cache update on every request + // do it once in a 1/10 of the ttl + if ($value) { + $value = new DateTime($value); + $value->sub(new DateInterval('PT' . intval($ttl * 9/10) . 'S')); + if ($value > $deadline) { + return; + } + } + + $deadline->add(new DateInterval('PT' . $ttl . 'S')); + + $cache->set($key, $deadline->format(DateTime::ISO8601)); + } + } + } + + /** + * Startup hook handler + */ + public function startup($args) + { + // Check access rights when logged in as another user + if (!empty($_SESSION['kolab_auth_admin']) && $args['task'] != 'login' && $args['task'] != 'logout') { + // access to specified task is forbidden, + // redirect to the first task on the list + if (!empty($_SESSION['kolab_auth_allowed_tasks'])) { + $tasks = (array)$_SESSION['kolab_auth_allowed_tasks']; + if (!in_array($args['task'], $tasks) && !in_array('*', $tasks)) { + header('Location: ?_task=' . array_shift($tasks)); + die; + } + + // add script that will remove disabled taskbar buttons + if (!in_array('*', $tasks)) { + $this->add_hook('render_page', array($this, 'render_page')); + } + } + } + + // load per-user settings + $this->load_user_role_plugins_and_settings(); + + return $args; + } + + /** + * Modify some configuration according to LDAP user record + */ + public function config_get($args) + { + // Replaces ldap_vars (%dc, etc) in public kolab ldap addressbooks + // config based on the users base_dn. (for multi domain support) + if ($args['name'] == 'ldap_public' && !empty($args['result'])) { + $rcmail = rcube::get_instance(); + $kolab_books = (array) $rcmail->config->get('kolab_auth_ldap_addressbooks'); + + foreach ($args['result'] as $name => $config) { + if (in_array($name, $kolab_books) || in_array('*', $kolab_books)) { + $args['result'][$name] = $this->patch_ldap_config($config); + } + } + } + else if ($args['name'] == 'kolab_users_directory' && !empty($args['result'])) { + $args['result'] = $this->patch_ldap_config($args['result']); + } +
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/bg_BG.inc
Added
@@ -0,0 +1,10 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Влизане като'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/cs_CZ.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Přihlásit se jako'; +$labels['loginasnotallowed'] = 'Žádná práva pro přihlášení se jako $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/da_DK.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Log ind som'; +$labels['loginasnotallowed'] = 'Har ikke privilegier til at logge ind som $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/de.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Anmelden als'; +$labels['loginasnotallowed'] = 'Keine Privilegien zum Anmelden als $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/de_CH.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Anmelden als'; +$labels['loginasnotallowed'] = 'Keine Privilegien zum Anmelden als $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/de_DE.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Anmelden als'; +$labels['loginasnotallowed'] = 'Keine Privilegien zum Anmelden als $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/el.inc
Added
@@ -0,0 +1,10 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Είσοδος ως'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/en_US.inc
Added
@@ -0,0 +1,14 @@ +<?php + +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ + +$labels['loginas'] = 'Login As'; +$labels['loginasnotallowed'] = 'No privileges to login as $user'; + +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/es_AR.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Ingresar como'; +$labels['loginasnotallowed'] = 'No tiene privilegios para ingresar como $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/es_ES.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Iniciar sesión como'; +$labels['loginasnotallowed'] = 'No hay privilegios para iniciar sesión como $usuario'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/et_EE.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Logi sisse kui'; +$labels['loginasnotallowed'] = 'Pole õigusi, et logida sisse kui $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/fi_FI.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Kirjaudu tilillä'; +$labels['loginasnotallowed'] = 'Ei oikeuksia kirjautua käyttäjänä $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/fr_FR.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Se connecter en tant que'; +$labels['loginasnotallowed'] = 'Pas d\'autorisation de se connecter en tant que $utilisateur'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/hu_HU.inc
Added
@@ -0,0 +1,10 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Bejelentkezés mint'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/it_IT.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Login come'; +$labels['loginasnotallowed'] = 'Nessun privilegio al login come $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/ja_JP.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'ログイン'; +$labels['loginasnotallowed'] = '$user としてログインする権限がありません'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/nl_NL.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Aanmelden als'; +$labels['loginasnotallowed'] = 'Geen bevoegdheden om aan te melden als $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/pl_PL.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Zaloguj jako'; +$labels['loginasnotallowed'] = 'Brak uprawnień do zalogowania jako $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/pt_BR.inc
Added
@@ -0,0 +1,10 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Logar como'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/ru_RU.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Войти как'; +$labels['loginasnotallowed'] = 'Нет привилегий войти как $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/sv_SE.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Logga in som'; +$labels['loginasnotallowed'] = 'Du har inte befogenhet att logga in som $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/th_TH.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'เข้าระบบด้วยชื่อ..'; +$labels['loginasnotallowed'] = 'ไม่มีสิทธิเข้าระบบด้วยชื่อผู้ใช้ $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/uk_UA.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = 'Увійти як користувач'; +$labels['loginasnotallowed'] = 'Немає привілеїв, увійти як $user'; +?>
View file
roundcubemail-1.4.13.tar.gz/plugins/kolab_auth/localization/zh_CN.inc
Added
@@ -0,0 +1,11 @@ +<?php +/** + * Localizations for the Kolab Auth plugin + * + * Copyright (C) 2014, Kolab Systems AG + * + * For translation see https://www.transifex.com/projects/p/kolab/resource/kolab_auth/ + */ +$labels['loginas'] = '以xxx登录'; +$labels['loginasnotallowed'] = '无权限以 $user 登录'; +?>
View file
roundcubemail-1.4.11.20.tar.gz/plugins/libkolab/lib/kolab_attachments_handler.php -> roundcubemail-1.4.13.tar.gz/plugins/libkolab/lib/kolab_attachments_handler.php
Changed
@@ -114,8 +114,9 @@ $this->rc->upload_progress(); } - $recid = $id_prefix . rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC); + $id = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC); $uploadid = rcube_utils::get_input_value('_uploadid', rcube_utils::INPUT_GPC); + $recid = $id_prefix . ($id ?: 'new'); if (empty($_SESSION[$session_key]) || $_SESSION[$session_key]['id'] != $recid) { $_SESSION[$session_key] = array();
View file
roundcubemail-1.4.11.20.tar.gz/program/include/iniset.php -> roundcubemail-1.4.13.tar.gz/program/include/iniset.php
Changed
@@ -24,7 +24,7 @@ } // application constants -define('RCMAIL_VERSION', '1.4.11'); +define('RCMAIL_VERSION', '1.4.13'); define('RCMAIL_START', microtime(true)); if (!defined('INSTALL_PATH')) {
View file
roundcubemail-1.4.11.20.tar.gz/program/lib/Roundcube/bootstrap.php -> roundcubemail-1.4.13.tar.gz/program/lib/Roundcube/bootstrap.php
Changed
@@ -58,7 +58,7 @@ } // framework constants -define('RCUBE_VERSION', '1.4.11'); +define('RCUBE_VERSION', '1.4.13'); define('RCUBE_CHARSET', 'UTF-8'); define('RCUBE_TEMP_FILE_PREFIX', 'RCMTEMP');
View file
roundcubemail-1.4.11.20.tar.gz/program/lib/Roundcube/rcube_washtml.php -> roundcubemail-1.4.13.tar.gz/program/lib/Roundcube/rcube_washtml.php
Changed
@@ -338,7 +338,7 @@ if ($url = $this->wash_uri($match[2])) { $result .= ' ' . $attr->nodeName . '="' . $match[1] . '(' . htmlspecialchars($url, ENT_QUOTES, $this->config['charset']) . ')' - . substr($val, strlen($match[0])) . '"'; + . htmlspecialchars(substr($val, strlen($match[0])), ENT_QUOTES, $this->config['charset']) . '"'; continue; } }
View file
roundcubemail-1.4.11.20.tar.gz/program/lib/Roundcube/spellchecker/googie.php -> roundcubemail-1.4.13.tar.gz/program/lib/Roundcube/spellchecker/googie.php
Changed
@@ -26,6 +26,9 @@ */ class rcube_spellchecker_googie extends rcube_spellchecker_engine { + const GOOGIE_HOST = 'ssl://spell.roundcube.net'; + const GOOGIE_PORT = 443; + private $matches = array(); private $content; @@ -68,8 +71,9 @@ $path = $a_uri['path'] . ($a_uri['query'] ? '?'.$a_uri['query'] : '') . $this->lang; } else { - $this->error = "Missing 'spellcheck_uri' config option"; - return $this->matches = array(); + $host = self::GOOGIE_HOST; + $port = self::GOOGIE_PORT; + $path = '/tbproxy/spell?lang=' . $this->lang; } $path .= sprintf('&key=%06d', $_SESSION['user_id']);
View file
roundcubemail-1.4.11.20.tar.gz/public_html/index.php -> roundcubemail-1.4.13.tar.gz/public_html/index.php
Changed
@@ -3,7 +3,7 @@ /* +-----------------------------------------------------------------------+ | Roundcube Webmail IMAP Client | - | Version 1.4.11 | + | Version 1.4.13 | | | | Copyright (C) The Roundcube Dev Team | | |
View file
roundcubemail-1.4.11.20.tar.gz/tests/Framework/Washtml.php -> roundcubemail-1.4.13.tar.gz/tests/Framework/Washtml.php
Changed
@@ -448,6 +448,10 @@ '<!-- html ignored --><body x-washed="background"></body>' ], [ + '<html><body><img fill=\'asd:url(#asd)" src="x" onerror="alert(1)\' />', + '<body><img fill="asd:url(#asd)" src="x" onerror="alert(1)" /></body>' + ], + [ '<html><math href="javascript:alert(location);"><mi>clickme</mi></math>', '<!-- html ignored --><body><math x-washed="href"><mi>clickme</mi></math></body>', ],
View file
roundcubemail-1.4.11.20.tar.gz/vendor/autoload.php -> roundcubemail-1.4.13.tar.gz/vendor/autoload.php
Changed
@@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit9bb1f3e4f7cfef6c404d641f234e8092::getLoader(); +return ComposerAutoloaderInitd89bf3a6fb4183211eaea1c21a92faae::getLoader();
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/ClassLoader.php -> roundcubemail-1.4.13.tar.gz/vendor/composer/ClassLoader.php
Changed
@@ -42,75 +42,30 @@ */ class ClassLoader { - /** @var ?string */ private $vendorDir; // PSR-4 - /** - * @var array[] - * @psalm-var array<string, array<string, int>> - */ private $prefixLengthsPsr4 = array(); - /** - * @var array[] - * @psalm-var array<string, array<int, string>> - */ private $prefixDirsPsr4 = array(); - /** - * @var array[] - * @psalm-var array<string, string> - */ private $fallbackDirsPsr4 = array(); // PSR-0 - /** - * @var array[] - * @psalm-var array<string, array<string, string[]>> - */ private $prefixesPsr0 = array(); - /** - * @var array[] - * @psalm-var array<string, string> - */ private $fallbackDirsPsr0 = array(); - /** @var bool */ private $useIncludePath = false; - - /** - * @var string[] - * @psalm-var array<string, string> - */ private $classMap = array(); - - /** @var bool */ private $classMapAuthoritative = false; - - /** - * @var bool[] - * @psalm-var array<string, bool> - */ private $missingClasses = array(); - - /** @var ?string */ private $apcuPrefix; - /** - * @var self[] - */ private static $registeredLoaders = array(); - /** - * @param ?string $vendorDir - */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; } - /** - * @return string[] - */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -120,47 +75,28 @@ return array(); } - /** - * @return array[] - * @psalm-return array<string, array<int, string>> - */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } - /** - * @return array[] - * @psalm-return array<string, string> - */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } - /** - * @return array[] - * @psalm-return array<string, string> - */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } - /** - * @return string[] Array of classname => path - * @psalm-var array<string, string> - */ public function getClassMap() { return $this->classMap; } /** - * @param string[] $classMap Class to filename map - * @psalm-param array<string, string> $classMap - * - * @return void + * @param array $classMap Class to filename map */ public function addClassMap(array $classMap) { @@ -175,11 +111,9 @@ * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories */ public function add($prefix, $paths, $prepend = false) { @@ -222,13 +156,11 @@ * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException - * - * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -272,10 +204,8 @@ * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories - * - * @return void + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories */ public function set($prefix, $paths) { @@ -290,12 +220,10 @@ * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException - * - * @return void */ public function setPsr4($prefix, $paths) { @@ -315,8 +243,6 @@ * Turns on searching the include path for class files. * * @param bool $useIncludePath - * - * @return void */ public function setUseIncludePath($useIncludePath) { @@ -339,8 +265,6 @@ * that have not been registered with the class map. * * @param bool $classMapAuthoritative - * - * @return void
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/InstalledVersions.php -> roundcubemail-1.4.13.tar.gz/vendor/composer/InstalledVersions.php
Changed
@@ -20,25 +20,784 @@ * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * - * To require its presence, you can require `composer-runtime-api ^2.0` + * To require it's presence, you can require `composer-runtime-api ^2.0` */ class InstalledVersions { - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ + private static $installed = array ( + 'root' => + array ( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'aliases' => + array ( + ), + 'reference' => '784eb80e67a3f47290e42cef12da8696cba60272', + 'name' => 'roundcube/roundcubemail', + ), + 'versions' => + array ( + 'caxy/php-htmldiff' => + array ( + 'pretty_version' => 'v0.1.9', + 'version' => '0.1.9.0', + 'aliases' => + array ( + ), + 'reference' => '4bad5c6a4ecc76954d37764e6a29273b6b7bf1f8', + ), + 'doctrine/instantiator' => + array ( + 'pretty_version' => '1.4.0', + 'version' => '1.4.0.0', + 'aliases' => + array ( + ), + 'reference' => 'd56bf6102915de5702778fe20f2de3b2fe570b5b', + ), + 'endroid/qr-code' => + array ( + 'pretty_version' => '1.6.6', + 'version' => '1.6.6.0', + 'aliases' => + array ( + ), + 'reference' => 'cef5d5b7b904d7bb0708eb744c35316364b65fa0', + ), + 'ezyang/htmlpurifier' => + array ( + 'pretty_version' => 'v4.14.0', + 'version' => '4.14.0.0', + 'aliases' => + array ( + ), + 'reference' => '12ab42bd6e742c70c0a52f7b82477fcd44e64b75', + ), + 'johndoh/contextmenu' => + array ( + 'pretty_version' => '3.2.1', + 'version' => '3.2.1.0', + 'aliases' => + array ( + ), + 'reference' => '602a3812922fb8f71814eb3b8d91e9b7859aab7e', + ), + 'kolab/calendar' => + array ( + 'pretty_version' => '3.5.10', + 'version' => '3.5.10.0', + 'aliases' => + array ( + ), + 'reference' => '45103d5bdee63f976c918f8cfcf20b400310bcb0', + ), + 'kolab/kolab_activesync' => + array ( + 'pretty_version' => '3.5.6', + 'version' => '3.5.6.0', + 'aliases' => + array ( + ), + 'reference' => '7e8c46290074fe6c1ab72bc9f6b90aa271ee16ef', + ), + 'kolab/kolab_addressbook' => + array ( + 'pretty_version' => '3.5.10', + 'version' => '3.5.10.0', + 'aliases' => + array ( + ), + 'reference' => '29195279f672640ffe38f70ddabe87b56172e889', + ), + 'kolab/kolab_auth' => + array ( + 'pretty_version' => '3.5.8', + 'version' => '3.5.8.0', + 'aliases' => + array ( + ), + 'reference' => 'ab0ed459f74a03f8eab6822652e084f0430a4f07', + ), + 'kolab/kolab_chat' => + array ( + 'pretty_version' => '3.5.4', + 'version' => '3.5.4.0', + 'aliases' => + array ( + ), + 'reference' => 'b2f85fcb8324b9961dd02fb3e3acd92be33b558e', + ), + 'kolab/kolab_config' => + array ( + 'pretty_version' => '3.4.0', + 'version' => '3.4.0.0', + 'aliases' => + array ( + ), + 'reference' => 'b31a76c1700679249fc222c46582ecbd1215f117', + ), + 'kolab/kolab_files' => + array ( + 'pretty_version' => '3.5.2', + 'version' => '3.5.2.0', + 'aliases' => + array ( + ), + 'reference' => '0439d3783b59d6e52f23e86046881fd0ca8c0bd5', + ), + 'kolab/kolab_folders' => + array ( + 'pretty_version' => '3.5.2', + 'version' => '3.5.2.0', + 'aliases' => + array ( + ), + 'reference' => 'c70560fcfe40bf1582ea79debf3ae2aebbe94688', + ), + 'kolab/kolab_notes' => + array ( + 'pretty_version' => '3.5.5', + 'version' => '3.5.5.0', + 'aliases' => + array ( + ), + 'reference' => '07297b8ea8b3827d0ba46801760854b0db560576', + ), + 'kolab/kolab_tags' => + array ( + 'pretty_version' => '3.5.2', + 'version' => '3.5.2.0', + 'aliases' => + array ( + ), + 'reference' => '62ffa5279d9f351941be6b23b0d0478aeff91bfd', + ), + 'kolab/libcalendaring' => + array ( + 'pretty_version' => '3.5.10', + 'version' => '3.5.10.0', + 'aliases' => + array ( + ), + 'reference' => 'b9ab21ae1a5b134a06c66d55372712630171a590', + ), + 'kolab/libkolab' => + array ( + 'pretty_version' => '3.5.10', + 'version' => '3.5.10.0', + 'aliases' => + array ( + ), + 'reference' => 'a8abbba8039ee3bdde7be1b6758893aeff0287d8', + ), + 'kolab/net_ldap3' => + array ( + 'pretty_version' => 'v1.1.3', + 'version' => '1.1.3.0', + 'aliases' => + array ( + ), + 'reference' => 'e1835e36fa5d3434f9804670fc3cdd16992ec66a', + ), + 'kolab/odfviewer' => + array ( + 'pretty_version' => '3.4.0', + 'version' => '3.4.0.0', + 'aliases' => + array ( + ),
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/LICENSE -> roundcubemail-1.4.13.tar.gz/vendor/composer/LICENSE
Changed
@@ -1,4 +1,3 @@ - Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,4 +17,3 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/autoload_classmap.php -> roundcubemail-1.4.13.tar.gz/vendor/composer/autoload_classmap.php
Changed
@@ -32,6 +32,19 @@ 'File_Iterator' => $vendorDir . '/phpunit/php-file-iterator/src/Iterator.php', 'File_Iterator_Facade' => $vendorDir . '/phpunit/php-file-iterator/src/Facade.php', 'File_Iterator_Factory' => $vendorDir . '/phpunit/php-file-iterator/src/Factory.php', + 'Net_LDAP2' => $vendorDir . '/pear/net_ldap2/Net/LDAP2.php', + 'Net_LDAP2_Entry' => $vendorDir . '/pear/net_ldap2/Net/LDAP2/Entry.php', + 'Net_LDAP2_Error' => $vendorDir . '/pear/net_ldap2/Net/LDAP2.php', + 'Net_LDAP2_Filter' => $vendorDir . '/pear/net_ldap2/Net/LDAP2/Filter.php', + 'Net_LDAP2_LDIF' => $vendorDir . '/pear/net_ldap2/Net/LDAP2/LDIF.php', + 'Net_LDAP2_RootDSE' => $vendorDir . '/pear/net_ldap2/Net/LDAP2/RootDSE.php', + 'Net_LDAP2_Schema' => $vendorDir . '/pear/net_ldap2/Net/LDAP2/Schema.php', + 'Net_LDAP2_SchemaCache' => $vendorDir . '/pear/net_ldap2/Net/LDAP2/SchemaCache.interface.php', + 'Net_LDAP2_Search' => $vendorDir . '/pear/net_ldap2/Net/LDAP2/Search.php', + 'Net_LDAP2_SimpleFileSchemaCache' => $vendorDir . '/pear/net_ldap2/Net/LDAP2/SimpleFileSchemaCache.php', + 'Net_LDAP2_Util' => $vendorDir . '/pear/net_ldap2/Net/LDAP2/Util.php', + 'Net_LDAP3' => $vendorDir . '/kolab/net_ldap3/lib/Net/LDAP3.php', + 'Net_LDAP3_Result' => $vendorDir . '/kolab/net_ldap3/lib/Net/LDAP3/Result.php', 'Net_Sieve' => $vendorDir . '/pear/net_sieve/Sieve.php', 'Net_URL2' => $vendorDir . '/pear/net_url2/Net/URL2.php', 'PEAR_Exception' => $vendorDir . '/pear/pear_exception/PEAR/Exception.php',
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/autoload_namespaces.php -> roundcubemail-1.4.13.tar.gz/vendor/composer/autoload_namespaces.php
Changed
@@ -10,10 +10,12 @@ 'Zend_View' => array($vendorDir . '/zf1/zend-view/library'), 'Zend_Validate' => array($vendorDir . '/zf1/zend-validate/library'), 'Zend_Uri' => array($vendorDir . '/zf1/zend-uri/library'), + 'Zend_Server' => array($vendorDir . '/zf1/zend-server/library'), 'Zend_Registry' => array($vendorDir . '/zf1/zend-registry/library'), 'Zend_Log' => array($vendorDir . '/zf1/zend-log/library'), 'Zend_Locale' => array($vendorDir . '/zf1/zend-locale/library'), 'Zend_Loader' => array($vendorDir . '/zf1/zend-loader/library'), + 'Zend_Json' => array($vendorDir . '/zf1/zend-json/library'), 'Zend_Exception' => array($vendorDir . '/zf1/zend-exception/library'), 'Zend_Controller' => array($vendorDir . '/zf1/zend-controller/library'), 'Zend_Config' => array($vendorDir . '/zf1/zend-config/library'), @@ -24,7 +26,7 @@ 'KubAT\\PhpSimple\\HtmlDomParser' => array($vendorDir . '/kub-at/php-simple-html-dom-parser/src'), 'HTTP_Request2' => array($vendorDir . '/pear/http_request2'), 'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'), - 'Console' => array($vendorDir . '/pear/console_commandline', $vendorDir . '/pear/console_getopt'), + 'Console' => array($vendorDir . '/pear/console_getopt', $vendorDir . '/pear/console_commandline'), 'Caxy\\HtmlDiff' => array($vendorDir . '/caxy/php-htmldiff/lib'), 'Auth' => array($vendorDir . '/pear/auth_sasl'), '' => array($vendorDir . '/pear/pear-core-minimal/src'),
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/autoload_real.php -> roundcubemail-1.4.13.tar.gz/vendor/composer/autoload_real.php
Changed
@@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit9bb1f3e4f7cfef6c404d641f234e8092 +class ComposerAutoloaderInitd89bf3a6fb4183211eaea1c21a92faae { private static $loader; @@ -24,9 +24,9 @@ require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit9bb1f3e4f7cfef6c404d641f234e8092', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitd89bf3a6fb4183211eaea1c21a92faae', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInit9bb1f3e4f7cfef6c404d641f234e8092', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitd89bf3a6fb4183211eaea1c21a92faae', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; $includePaths[] = get_include_path(); @@ -36,7 +36,7 @@ if ($useStaticLoader) { require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit9bb1f3e4f7cfef6c404d641f234e8092::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitd89bf3a6fb4183211eaea1c21a92faae::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -57,19 +57,19 @@ $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit9bb1f3e4f7cfef6c404d641f234e8092::$files; + $includeFiles = Composer\Autoload\ComposerStaticInitd89bf3a6fb4183211eaea1c21a92faae::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire9bb1f3e4f7cfef6c404d641f234e8092($fileIdentifier, $file); + composerRequired89bf3a6fb4183211eaea1c21a92faae($fileIdentifier, $file); } return $loader; } } -function composerRequire9bb1f3e4f7cfef6c404d641f234e8092($fileIdentifier, $file) +function composerRequired89bf3a6fb4183211eaea1c21a92faae($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file;
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/autoload_static.php -> roundcubemail-1.4.13.tar.gz/vendor/composer/autoload_static.php
Changed
@@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit9bb1f3e4f7cfef6c404d641f234e8092 +class ComposerStaticInitd89bf3a6fb4183211eaea1c21a92faae { public static $files = array ( '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', @@ -140,6 +140,10 @@ array ( 0 => __DIR__ . '/..' . '/zf1/zend-uri/library', ), + 'Zend_Server' => + array ( + 0 => __DIR__ . '/..' . '/zf1/zend-server/library', + ), 'Zend_Registry' => array ( 0 => __DIR__ . '/..' . '/zf1/zend-registry/library', @@ -156,6 +160,10 @@ array ( 0 => __DIR__ . '/..' . '/zf1/zend-loader/library', ), + 'Zend_Json' => + array ( + 0 => __DIR__ . '/..' . '/zf1/zend-json/library', + ), 'Zend_Exception' => array ( 0 => __DIR__ . '/..' . '/zf1/zend-exception/library', @@ -218,8 +226,8 @@ array ( 'Console' => array ( - 0 => __DIR__ . '/..' . '/pear/console_commandline', - 1 => __DIR__ . '/..' . '/pear/console_getopt', + 0 => __DIR__ . '/..' . '/pear/console_getopt', + 1 => __DIR__ . '/..' . '/pear/console_commandline', ), 'Caxy\\HtmlDiff' => array ( @@ -266,6 +274,19 @@ 'File_Iterator' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Iterator.php', 'File_Iterator_Facade' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Facade.php', 'File_Iterator_Factory' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Factory.php', + 'Net_LDAP2' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2.php', + 'Net_LDAP2_Entry' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2/Entry.php', + 'Net_LDAP2_Error' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2.php', + 'Net_LDAP2_Filter' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2/Filter.php', + 'Net_LDAP2_LDIF' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2/LDIF.php', + 'Net_LDAP2_RootDSE' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2/RootDSE.php', + 'Net_LDAP2_Schema' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2/Schema.php', + 'Net_LDAP2_SchemaCache' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2/SchemaCache.interface.php', + 'Net_LDAP2_Search' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2/Search.php', + 'Net_LDAP2_SimpleFileSchemaCache' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2/SimpleFileSchemaCache.php', + 'Net_LDAP2_Util' => __DIR__ . '/..' . '/pear/net_ldap2/Net/LDAP2/Util.php', + 'Net_LDAP3' => __DIR__ . '/..' . '/kolab/net_ldap3/lib/Net/LDAP3.php', + 'Net_LDAP3_Result' => __DIR__ . '/..' . '/kolab/net_ldap3/lib/Net/LDAP3/Result.php', 'Net_Sieve' => __DIR__ . '/..' . '/pear/net_sieve/Sieve.php', 'Net_URL2' => __DIR__ . '/..' . '/pear/net_url2/Net/URL2.php', 'PEAR_Exception' => __DIR__ . '/..' . '/pear/pear_exception/PEAR/Exception.php', @@ -910,11 +931,11 @@ public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit9bb1f3e4f7cfef6c404d641f234e8092::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit9bb1f3e4f7cfef6c404d641f234e8092::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit9bb1f3e4f7cfef6c404d641f234e8092::$prefixesPsr0; - $loader->fallbackDirsPsr0 = ComposerStaticInit9bb1f3e4f7cfef6c404d641f234e8092::$fallbackDirsPsr0; - $loader->classMap = ComposerStaticInit9bb1f3e4f7cfef6c404d641f234e8092::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitd89bf3a6fb4183211eaea1c21a92faae::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitd89bf3a6fb4183211eaea1c21a92faae::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInitd89bf3a6fb4183211eaea1c21a92faae::$prefixesPsr0; + $loader->fallbackDirsPsr0 = ComposerStaticInitd89bf3a6fb4183211eaea1c21a92faae::$fallbackDirsPsr0; + $loader->classMap = ComposerStaticInitd89bf3a6fb4183211eaea1c21a92faae::$classMap; }, null, ClassLoader::class); }
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/include_paths.php -> roundcubemail-1.4.13.tar.gz/vendor/composer/include_paths.php
Changed
@@ -9,11 +9,12 @@ $vendorDir . '/pear/pear_exception', $vendorDir . '/pear/net_url2', $vendorDir . '/pear/http_request2', + $vendorDir . '/pear/console_getopt', + $vendorDir . '/pear/pear-core-minimal/src', + $vendorDir . '/pear/net_ldap2', $vendorDir . '/pear/auth_sasl', $vendorDir . '/pear/console_commandline', $vendorDir . '/pear/crypt_gpg', - $vendorDir . '/pear/console_getopt', - $vendorDir . '/pear/pear-core-minimal/src', $vendorDir . '/pear/mail_mime', $vendorDir . '/pear/net_idna2', $vendorDir . '/pear/net_socket',
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/installed.json -> roundcubemail-1.4.13.tar.gz/vendor/composer/installed.json
Changed
@@ -303,7 +303,7 @@ "version_normalized": "3.5.10.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/calendar", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/calendar", "reference": "45103d5bdee63f976c918f8cfcf20b400310bcb0" }, "require": { @@ -349,7 +349,7 @@ "version_normalized": "3.5.6.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_activesync", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_activesync", "reference": "7e8c46290074fe6c1ab72bc9f6b90aa271ee16ef" }, "require": { @@ -388,7 +388,7 @@ "version_normalized": "3.5.10.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_addressbook", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_addressbook", "reference": "29195279f672640ffe38f70ddabe87b56172e889" }, "require": { @@ -422,12 +422,51 @@ "install-path": "../../plugins/kolab_addressbook" }, { + "name": "kolab/kolab_auth", + "version": "3.5.8", + "version_normalized": "3.5.8.0", + "dist": { + "type": "path", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_auth", + "reference": "ab0ed459f74a03f8eab6822652e084f0430a4f07" + }, + "require": { + "kolab/libkolab": ">=3.5.1", + "php": ">=5.3.0", + "roundcube/plugin-installer": ">=0.1.3" + }, + "type": "roundcube-plugin", + "installation-source": "dist", + "license": [ + "AGPLv3" + ], + "authors": [ + { + "name": "Thomas Bruederli", + "email": "bruederli@kolabsys.com", + "role": "Lead" + }, + { + "name": "Aleksander Machniak", + "email": "machniak@kolabsys.com", + "role": "Lead" + } + ], + "description": "Kolab authentication", + "homepage": "https://git.kolab.org/diffusion/RPK/", + "transport-options": { + "symlink": false, + "relative": false + }, + "install-path": "../../plugins/kolab_auth" + }, + { "name": "kolab/kolab_chat", "version": "3.5.4", "version_normalized": "3.5.4.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_chat", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_chat", "reference": "b2f85fcb8324b9961dd02fb3e3acd92be33b558e" }, "require": { @@ -461,7 +500,7 @@ "version_normalized": "3.4.0.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_config", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_config", "reference": "b31a76c1700679249fc222c46582ecbd1215f117" }, "require": { @@ -495,7 +534,7 @@ "version_normalized": "3.5.2.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_files", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_files", "reference": "0439d3783b59d6e52f23e86046881fd0ca8c0bd5" }, "require": { @@ -529,7 +568,7 @@ "version_normalized": "3.5.2.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_folders", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_folders", "reference": "c70560fcfe40bf1582ea79debf3ae2aebbe94688" }, "require": { @@ -563,7 +602,7 @@ "version_normalized": "3.5.5.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_notes", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_notes", "reference": "07297b8ea8b3827d0ba46801760854b0db560576" }, "require": { @@ -602,7 +641,7 @@ "version_normalized": "3.5.2.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/kolab_tags", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/kolab_tags", "reference": "62ffa5279d9f351941be6b23b0d0478aeff91bfd" }, "require": { @@ -636,7 +675,7 @@ "version_normalized": "3.5.10.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/libcalendaring", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/libcalendaring", "reference": "b9ab21ae1a5b134a06c66d55372712630171a590" }, "require": { @@ -675,7 +714,7 @@ "version_normalized": "3.5.10.0", "dist": { "type": "path", - "url": "/tmp/roundcubemail-1.4.11.20/roundcubemail-plugins-kolab-latest/plugins/libkolab", + "url": "/tmp/roundcubemail-1.4.13/roundcubemail-plugins-kolab-latest/plugins/libkolab", "reference": "a8abbba8039ee3bdde7be1b6758893aeff0287d8" }, "require": { @@ -710,12 +749,69 @@ "install-path": "../../plugins/libkolab" }, { + "name": "kolab/net_ldap3", + "version": "v1.1.3", + "version_normalized": "1.1.3.0", + "source": { + "type": "git", + "url": "https://gitlab.com/roundcube/net_ldap3.git", + "reference": "e1835e36fa5d3434f9804670fc3cdd16992ec66a" + }, + "dist": { + "type": "zip", + "url": "https://gitlab.com/api/v4/projects/roundcube%2Fnet_ldap3/repository/archive.zip?sha=e1835e36fa5d3434f9804670fc3cdd16992ec66a", + "reference": "e1835e36fa5d3434f9804670fc3cdd16992ec66a", + "shasum": "" + }, + "require": { + "pear/net_ldap2": ">=2.0.12", + "php": ">=5.3.3" + }, + "time": "2019-10-21T11:18:59+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0+" + ], + "authors": [ + { + "name": "Jeroen van Meeuwen", + "email": "vanmeeuwen@kolabsys.com", + "role": "Lead" + }, + { + "name": "Aleksander Machniak", + "email": "machniak@kolabsys.com", + "role": "Developer" + }, + { + "name": "Thomas Bruederli", + "email": "roundcube@gmail.com", + "role": "Developer" + } + ], + "description": "A successor of the PEAR:Net_LDAP2 module providing advanced functionality for accessing LDAP directories", + "homepage": "http://git.kolab.org/pear/Net_LDAP3/", + "keywords": [ + "PEAR", + "ldap", + "vlv"
View file
roundcubemail-1.4.11.20.tar.gz/vendor/composer/installed.php -> roundcubemail-1.4.13.tar.gz/vendor/composer/installed.php
Changed
@@ -1,725 +1,773 @@ -<?php return array( - 'root' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'reference' => '4e1358b4dc1a8116357657ae5c8738e855aea85a', - 'name' => 'roundcube/roundcubemail', - 'dev' => true, - ), - 'versions' => array( - 'caxy/php-htmldiff' => array( - 'pretty_version' => 'v0.1.9', - 'version' => '0.1.9.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../caxy/php-htmldiff', - 'aliases' => array(), - 'reference' => '4bad5c6a4ecc76954d37764e6a29273b6b7bf1f8', - 'dev_requirement' => false, - ), - 'doctrine/instantiator' => array( - 'pretty_version' => '1.4.0', - 'version' => '1.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../doctrine/instantiator', - 'aliases' => array(), - 'reference' => 'd56bf6102915de5702778fe20f2de3b2fe570b5b', - 'dev_requirement' => true, - ), - 'endroid/qr-code' => array( - 'pretty_version' => '1.6.6', - 'version' => '1.6.6.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../endroid/qr-code', - 'aliases' => array(), - 'reference' => 'cef5d5b7b904d7bb0708eb744c35316364b65fa0', - 'dev_requirement' => false, - ), - 'ezyang/htmlpurifier' => array( - 'pretty_version' => 'v4.14.0', - 'version' => '4.14.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ezyang/htmlpurifier', - 'aliases' => array(), - 'reference' => '12ab42bd6e742c70c0a52f7b82477fcd44e64b75', - 'dev_requirement' => false, - ), - 'johndoh/contextmenu' => array( - 'pretty_version' => '3.2.1', - 'version' => '3.2.1.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/contextmenu', - 'aliases' => array(), - 'reference' => '602a3812922fb8f71814eb3b8d91e9b7859aab7e', - 'dev_requirement' => false, - ), - 'kolab/calendar' => array( - 'pretty_version' => '3.5.10', - 'version' => '3.5.10.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/calendar', - 'aliases' => array(), - 'reference' => '45103d5bdee63f976c918f8cfcf20b400310bcb0', - 'dev_requirement' => false, - ), - 'kolab/kolab_activesync' => array( - 'pretty_version' => '3.5.6', - 'version' => '3.5.6.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/kolab_activesync', - 'aliases' => array(), - 'reference' => '7e8c46290074fe6c1ab72bc9f6b90aa271ee16ef', - 'dev_requirement' => false, - ), - 'kolab/kolab_addressbook' => array( - 'pretty_version' => '3.5.10', - 'version' => '3.5.10.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/kolab_addressbook', - 'aliases' => array(), - 'reference' => '29195279f672640ffe38f70ddabe87b56172e889', - 'dev_requirement' => false, - ), - 'kolab/kolab_chat' => array( - 'pretty_version' => '3.5.4', - 'version' => '3.5.4.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/kolab_chat', - 'aliases' => array(), - 'reference' => 'b2f85fcb8324b9961dd02fb3e3acd92be33b558e', - 'dev_requirement' => false, - ), - 'kolab/kolab_config' => array( - 'pretty_version' => '3.4.0', - 'version' => '3.4.0.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/kolab_config', - 'aliases' => array(), - 'reference' => 'b31a76c1700679249fc222c46582ecbd1215f117', - 'dev_requirement' => false, - ), - 'kolab/kolab_files' => array( - 'pretty_version' => '3.5.2', - 'version' => '3.5.2.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/kolab_files', - 'aliases' => array(), - 'reference' => '0439d3783b59d6e52f23e86046881fd0ca8c0bd5', - 'dev_requirement' => false, - ), - 'kolab/kolab_folders' => array( - 'pretty_version' => '3.5.2', - 'version' => '3.5.2.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/kolab_folders', - 'aliases' => array(), - 'reference' => 'c70560fcfe40bf1582ea79debf3ae2aebbe94688', - 'dev_requirement' => false, - ), - 'kolab/kolab_notes' => array( - 'pretty_version' => '3.5.5', - 'version' => '3.5.5.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/kolab_notes', - 'aliases' => array(), - 'reference' => '07297b8ea8b3827d0ba46801760854b0db560576', - 'dev_requirement' => false, - ), - 'kolab/kolab_tags' => array( - 'pretty_version' => '3.5.2', - 'version' => '3.5.2.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/kolab_tags', - 'aliases' => array(), - 'reference' => '62ffa5279d9f351941be6b23b0d0478aeff91bfd', - 'dev_requirement' => false, - ), - 'kolab/libcalendaring' => array( - 'pretty_version' => '3.5.10', - 'version' => '3.5.10.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/libcalendaring', - 'aliases' => array(), - 'reference' => 'b9ab21ae1a5b134a06c66d55372712630171a590', - 'dev_requirement' => false, - ), - 'kolab/libkolab' => array( - 'pretty_version' => '3.5.10', - 'version' => '3.5.10.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/libkolab', - 'aliases' => array(), - 'reference' => 'a8abbba8039ee3bdde7be1b6758893aeff0287d8', - 'dev_requirement' => false, - ), - 'kolab/odfviewer' => array( - 'pretty_version' => '3.4.0', - 'version' => '3.4.0.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/odfviewer', - 'aliases' => array(), - 'reference' => '43f3c0cf314cb818f9bc96d6bd378793e22a4ed4', - 'dev_requirement' => false, - ), - 'kolab/pdfviewer' => array( - 'pretty_version' => '3.4.0', - 'version' => '3.4.0.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/pdfviewer', - 'aliases' => array(), - 'reference' => '3437085223a60d929fbf076c232008e4377407c1', - 'dev_requirement' => false, - ), - 'kolab/tasklist' => array( - 'pretty_version' => '3.5.10', - 'version' => '3.5.10.0', - 'type' => 'roundcube-plugin', - 'install_path' => __DIR__ . '/../../plugins/tasklist', - 'aliases' => array(), - 'reference' => '7ae02f72964925d19fb244754f9d3e9b20af677c', - 'dev_requirement' => false, - ), - 'kub-at/php-simple-html-dom-parser' => array( - 'pretty_version' => '1.9.1', - 'version' => '1.9.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../kub-at/php-simple-html-dom-parser', - 'aliases' => array(), - 'reference' => 'ff22f98bfd9235115c128059076f3eb740d66913', - 'dev_requirement' => false, - ), - 'masterminds/html5' => array( - 'pretty_version' => '2.5.0', - 'version' => '2.5.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../masterminds/html5', - 'aliases' => array(), - 'reference' => 'b5d892a4bd058d61f736935d32a9c248f11ccc93',
View file
roundcubemail-1.4.13.tar.gz/vendor/kolab/net_ldap3
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/kolab/net_ldap3/.arcconfig
Added
@@ -0,0 +1,3 @@ +{ + "phabricator.uri": "https://git.kolab.org" +}
View file
roundcubemail-1.4.13.tar.gz/vendor/kolab/net_ldap3/LICENSE
Added
@@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice;
View file
roundcubemail-1.4.13.tar.gz/vendor/kolab/net_ldap3/composer.json
Added
@@ -0,0 +1,32 @@ +{ + "name": "kolab/net_ldap3", + "description": "A successor of the PEAR:Net_LDAP2 module providing advanced functionality for accessing LDAP directories", + "type": "library", + "keywords": ["pear", "ldap", "vlv"], + "homepage": "http://git.kolab.org/pear/Net_LDAP3/", + "license": "GPL-3.0+", + "authors": [ + { + "name": "Jeroen van Meeuwen", + "email": "vanmeeuwen@kolabsys.com", + "role": "Lead" + }, + { + "name": "Aleksander Machniak", + "email": "machniak@kolabsys.com", + "role": "Developer" + }, + { + "name": "Thomas Bruederli", + "email": "roundcube@gmail.com", + "role": "Developer" + } + ], + "require": { + "php": ">=5.3.3", + "pear/net_ldap2": ">=2.0.12" + }, + "autoload": { + "classmap": ["lib/"] + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/kolab/net_ldap3/lib
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/kolab/net_ldap3/lib/Net
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/kolab/net_ldap3/lib/Net/LDAP3
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/kolab/net_ldap3/lib/Net/LDAP3.php
Added
@@ -0,0 +1,3209 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | Net/LDAP3.php | + | | + | Based on code created by the Roundcube Webmail team. | + | | + | Copyright (C) 2006-2014, The Roundcube Dev Team | + | Copyright (C) 2012-2014, Kolab Systems AG | + | | + | This program is free software: you can redistribute it and/or modify | + | it under the terms of the GNU General Public License as published by | + | the Free Software Foundation, either version 3 of the License, or | + | (at your option) any later version. | + | | + | This program is distributed in the hope that it will be useful, | + | but WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | + | GNU General Public License for more details. | + | | + | You should have received a copy of the GNU General Public License | + | along with this program. If not, see <http://www.gnu.org/licenses/>. | + | | + | PURPOSE: | + | Provide advanced functionality for accessing LDAP directories | + | | + +-----------------------------------------------------------------------+ + | Authors: Thomas Bruederli <roundcube@gmail.com> | + | Aleksander Machniak <machniak@kolabsys.com> | + | Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> | + +-----------------------------------------------------------------------+ +*/ + +require_once __DIR__ . '/LDAP3/Result.php'; + +/** + * Model class to access a LDAP directories + * + * @package Net_LDAP3 + */ +class Net_LDAP3 +{ + const CONTROL_EFFECTIVE_RIGHTS = '1.3.6.1.4.1.42.2.27.9.5.2'; + const CONTROL_SORT_REQUEST = '1.2.840.113556.1.4.473'; + const CONTROL_VLV_REQUEST = '2.16.840.1.113730.3.4.9'; + const CONTROL_VLV_RESPONSE = '2.16.840.1.113730.3.4.10'; + + public $conn; + public $vlv_active = false; + + private $attribute_level_rights_map = array( + "r" => "read", + "s" => "search", + "w" => "write", + "o" => "delete", + "c" => "compare", + "W" => "write", + "O" => "delete" + ); + + private $entry_level_rights_map = array( + "a" => "add", + "d" => "delete", + "n" => "modrdn", + "v" => "read" + ); + + /* + * Manipulate configuration through the config_set and config_get methods. + * Available options: + * 'debug' => false, + * 'hosts' => array(), + * 'port' => 389, + * 'use_tls' => false, + * 'ldap_version' => 3, // using LDAPv3 + * 'auth_method' => '', // SASL authentication method (for proxy auth), e.g. DIGEST-MD5 + * 'gssapi_cn' => null // Kerberos cache name (KRB5CCNAME) for SASL GSSAPI authentication + * 'numsub_filter' => '(objectClass=organizationalUnit)', // with VLV, we also use numSubOrdinates to query the total number of records. Set this filter to get all numSubOrdinates attributes for counting + * 'referrals' => false, // Sets the LDAP_OPT_REFERRALS option. Mostly used in multi-domain Active Directory setups + * 'network_timeout' => 10, // The timeout (in seconds) for connect + bind arrempts. This is only supported in PHP >= 5.3.0 with OpenLDAP 2.x + * 'sizelimit' => 0, // Enables you to limit the count of entries fetched. Setting this to 0 means no limit. + * 'timelimit' => 0, // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit. + * 'vlv' => false, // force VLV off + * 'config_root_dn' => 'cn=config', // Root DN to read config (e.g. vlv indexes) from + * 'service_bind_dn' => 'uid=kolab-service,ou=Special Users,dc=example,dc=org', + * 'service_bind_pw' => 'Welcome2KolabSystems', + * 'root_dn' => 'dc=example,dc=org', + */ + protected $config = array( + 'sizelimit' => 0, + 'timelimit' => 0, + 'config_root_dn' => 'cn=config', + ); + + protected $debug_level = false; + protected $list_page = 1; + protected $page_size = 10; + protected $icache = array(); + protected $cache; + + // Use public method config_set('log_hook', $callback) to have $callback be + // call_user_func'ed instead of the local log functions. + protected $_log_hook; + + // Use public method config_set('config_get_hook', $callback) to have + // $callback be call_user_func'ed instead of the local config_get function. + protected $_config_get_hook; + + // Use public method config_set('config_set_hook', $callback) to have + // $callback be call_user_func'ed instead of the local config_set function. + protected $_config_set_hook; + + // Not Yet Implemented + // Intended to allow hooking in for the purpose of caching. + protected $_result_hook; + + // Runtime. These are not the variables you're looking for. + protected $_current_bind_dn; + protected $_current_bind_pw; + protected $_current_host; + protected $_metadata; + protected $_vlv_indexes_and_searches; + + + /** + * Constructor + * + * @param array $config Configuration parameters. After initialization use + * the config_set() method. + */ + public function __construct($config = array()) + { + if (!empty($config) && is_array($config)) { + foreach ($config as $key => $value) { + $setter = 'config_set_' . $key; + if (method_exists($this, $setter)) { + $this->$setter($value); + } + else if (isset($this->$key)) { + $this->$key = $value; + } + else { + $this->config[$key] = $value; + } + } + } + } + + /** + * Add multiple entries to the directory information tree in one go. + */ + public function add_entries($entries, $attributes = array()) + { + // If $entries is an associative array, it's keys are DNs and its + // values are the attributes for that DN. + // + // If $entries is a non-associative array, the attributes are expected + // to be positional in $attributes. + + $result_set = array(); + + if (array_keys($entries) == range(0, count($entries) - 1)) { + // $entries is sequential + if (count($entries) !== count($attributes)) { + $this->_error("LDAP: Wrong entry/attribute count in " . __FUNCTION__); + return false; + } + + for ($i = 0; $i < count($entries); $i++) { + $result_set[$i] = $this->add_entry($entries[$i], $attributes[$i]); + } + } + else { + // $entries is associative + foreach ($entries as $entry_dn => $entry_attributes) { + if (array_keys($attributes) !== range(0, count($attributes)-1)) { + // $attributes is associative as well, let's merge these + // + // $entry_attributes takes precedence, so is in the second + // position in array_merge() + $entry_attributes = array_merge($attributes, $entry_attributes); + } + + $result_set[$entry_dn] = $this->add_entry($entry_dn, $entry_attributes); + } + } + + return $result_set; + } + + /** + * Add an entry to the directory information tree. + */ + public function add_entry($entry_dn, $attributes) + { + // TODO: + // - Get entry rdn attribute value from entry_dn and see if it exists in + // attributes -> issue warning if so (but not block the operation).
View file
roundcubemail-1.4.13.tar.gz/vendor/kolab/net_ldap3/lib/Net/LDAP3/Result.php
Added
@@ -0,0 +1,179 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | Net/LDAP3/Result.php | + | | + | Based on code created by the Roundcube Webmail team. | + | | + | Copyright (C) 2006-2014, The Roundcube Dev Team | + | Copyright (C) 2012-2014, Kolab Systems AG | + | | + | This program is free software: you can redistribute it and/or modify | + | it under the terms of the GNU General Public License as published by | + | the Free Software Foundation, either version 3 of the License, or | + | (at your option) any later version. | + | | + | This program is distributed in the hope that it will be useful, | + | but WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | + | GNU General Public License for more details. | + | | + | You should have received a copy of the GNU General Public License | + | along with this program. If not, see <http://www.gnu.org/licenses/>. | + | | + | PURPOSE: | + | Provide advanced functionality for accessing LDAP directories | + | | + +-----------------------------------------------------------------------+ + | Authors: Thomas Bruederli <roundcube@gmail.com> | + | Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> | + +-----------------------------------------------------------------------+ +*/ + +/** + * Model class representing an LDAP search result + * + * @package LDAP + */ +class Net_LDAP3_Result implements Iterator +{ + protected $conn; + protected $base_dn; + protected $filter; + protected $scope; + protected $result; + + private $count; + private $current; + private $iteratorkey = 0; + + /** + * Default constructor + * + * @param resource $conn LDAP link identifier + * @param string $base_dn Base DN used to get this result + * @param string $filter Filter query used to get this result + * @param string $scope Scope of the result + * @param resource $result LDAP result entry identifier + */ + function __construct($conn, $base_dn, $filter, $scope, $result) + { + $this->conn = $conn; + $this->base_dn = $base_dn; + $this->filter = $filter; + $this->scope = $scope; + $this->result = $result; + } + + /** + * Property value getter + * + * @param string $property Property name + * @param mixed $default Return value if proprty is not set + * + * @return mixed Property value + */ + public function get($property, $default = null) + { + return isset($this->$property) ? $this->$property : $default; + } + + /** + * Property value setter + * + * @param string $property Property name + * @param mixed $value Property value + */ + public function set($property, $value) + { + $this->$property = $value; + } + + /** + * Wrapper for ldap_sort() + * + * @param string $attr The attribute to use as a key in the sort + * + * @return bool True on success, False on failure + */ + public function sort($attr) + { + // @TODO: Don't use ldap_sort() it's deprecated since PHP7 + // and will be removed in future + return @ldap_sort($this->conn, $this->result, $attr); + } + + /** + * Get entries count + * + * @return int Number of entries in the result + */ + public function count() + { + if (!isset($this->count)) { + $this->count = ldap_count_entries($this->conn, $this->result); + } + + return $this->count; + } + + /** + * Wrapper for ldap_get_entries() + * + * @param bool $normalize Optionally normalize the entries to a list of hash arrays + * + * @return array List of LDAP entries + */ + public function entries($normalize = false) + { + $entries = ldap_get_entries($this->conn, $this->result); + + if ($normalize) { + return Net_LDAP3::normalize_result($entries); + } + + return $entries; + } + + /** + * Wrapper for ldap_get_dn() using the current entry pointer + */ + public function get_dn() + { + return $this->current ? ldap_get_dn($this->conn, $this->current) : null; + } + + + /*** Implement PHP 5 Iterator interface to make foreach work ***/ + + function current() + { + $attrib = ldap_get_attributes($this->conn, $this->current); + $attrib['dn'] = ldap_get_dn($this->conn, $this->current); + + return $attrib; + } + + function key() + { + return $this->iteratorkey; + } + + function rewind() + { + $this->iteratorkey = 0; + $this->current = ldap_first_entry($this->conn, $this->result); + } + + function next() + { + $this->iteratorkey++; + $this->current = ldap_next_entry($this->conn, $this->current); + } + + function valid() + { + return (bool)$this->current; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/.gitignore
Added
@@ -0,0 +1,2 @@ +/tests/ldapconfig.ini +/dist
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/.travis.yml
Added
@@ -0,0 +1,25 @@ +language: php +sudo: false +php: + - 7 + - 5.6 + - 5.5 + - 5.4 +addons: + apt: + packages: + - ldap-utils + - slapd +before_script: + - phpenv config-add tests/travis/enable-ldap.ini + - pear upgrade pear-1.10.1 + - cat tests/ldapconfig.ini.dist | sed s/389/3389/ > tests/ldapconfig.ini + - mkdir /tmp/slapd + - slapd -f tests/ldif_data/slapd.conf -h ldap://localhost:3389 & + - sleep 3 + - ldapadd -h localhost:3389 -D cn=admin,dc=example,dc=com -w test -f tests/ldif_data/base.ldif + - ldapadd -h localhost:3389 -D cn=admin,dc=example,dc=com -w test -f tests/ldif_data/INITIAL_TESTDATA.ldif + +script: + - cd tests + - phpunit .
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/LICENSE
Added
@@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2.php
Added
@@ -0,0 +1,1802 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the Net_LDAP2 interface class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Tarjej Huse <tarjei@bergfald.no> +* @author Jan Wagner <wagner@netsols.de> +* @author Del <del@babel.com.au> +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2003-2007 Tarjej Huse, Jan Wagner, Del Elson, Benedikt Hallinger +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +*/ + +/** +* Package includes. +*/ +require_once 'PEAR.php'; +require_once 'Net/LDAP2/RootDSE.php'; +require_once 'Net/LDAP2/Schema.php'; +require_once 'Net/LDAP2/Entry.php'; +require_once 'Net/LDAP2/Search.php'; +require_once 'Net/LDAP2/Util.php'; +require_once 'Net/LDAP2/Filter.php'; +require_once 'Net/LDAP2/LDIF.php'; +require_once 'Net/LDAP2/SchemaCache.interface.php'; +require_once 'Net/LDAP2/SimpleFileSchemaCache.php'; + +/** +* Error constants for errors that are not LDAP errors. +*/ +define('NET_LDAP2_ERROR', 1000); + +/** +* Net_LDAP2 Version +*/ +define('NET_LDAP2_VERSION', '2.1.0'); + +/** +* Net_LDAP2 - manipulate LDAP servers the right way! +* +* @category Net +* @package Net_LDAP2 +* @author Tarjej Huse <tarjei@bergfald.no> +* @author Jan Wagner <wagner@netsols.de> +* @author Del <del@babel.com.au> +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2003-2007 Tarjej Huse, Jan Wagner, Del Elson, Benedikt Hallinger +* @license http://www.gnu.org/copyleft/lesser.html LGPL +* @link http://pear.php.net/package/Net_LDAP2/ +*/ +class Net_LDAP2 extends PEAR +{ + /** + * Class configuration array + * + * host = the ldap host to connect to + * (may be an array of several hosts to try) + * port = the server port + * version = ldap version (defaults to v 3) + * starttls = when set, ldap_start_tls() is run after connecting. + * bindpw = no explanation needed + * binddn = the DN to bind as. + * basedn = ldap base + * options = hash of ldap options to set (opt => val) + * filter = default search filter + * scope = default search scope + * + * Newly added in 2.0.0RC4, for auto-reconnect: + * auto_reconnect = if set to true then the class will automatically + * attempt to reconnect to the LDAP server in certain + * failure conditionswhen attempting a search, or other + * LDAP operation. Defaults to false. Note that if you + * set this to true, calls to search() may block + * indefinitely if there is a catastrophic server failure. + * min_backoff = minimum reconnection delay period (in seconds). + * current_backoff = initial reconnection delay period (in seconds). + * max_backoff = maximum reconnection delay period (in seconds). + * + * @access protected + * @var array + */ + protected $_config = array('host' => 'localhost', + 'port' => 389, + 'version' => 3, + 'starttls' => false, + 'binddn' => '', + 'bindpw' => '', + 'basedn' => '', + 'options' => array(), + 'filter' => '(objectClass=*)', + 'scope' => 'sub', + 'auto_reconnect' => false, + 'min_backoff' => 1, + 'current_backoff' => 1, + 'max_backoff' => 32); + + /** + * List of hosts we try to establish a connection to + * + * @access protected + * @var array + */ + protected $_host_list = array(); + + /** + * List of hosts that are known to be down. + * + * @access protected + * @var array + */ + protected $_down_host_list = array(); + + /** + * LDAP resource link. + * + * @access protected + * @var resource + */ + protected $_link = false; + + /** + * Net_LDAP2_Schema object + * + * This gets set and returned by {@link schema()} + * + * @access protected + * @var object Net_LDAP2_Schema + */ + protected $_schema = null; + + /** + * Schema cacher function callback + * + * @see registerSchemaCache() + * @var string + */ + protected $_schema_cache = null; + + /** + * Cache for attribute encoding checks + * + * @access protected + * @var array Hash with attribute names as key and boolean value + * to determine whether they should be utf8 encoded or not. + */ + protected $_schemaAttrs = array(); + + /** + * Cache for rootDSE objects + * + * Hash with requested rootDSE attr names as key and rootDSE object as value + * + * Since the RootDSE object itself may request a rootDSE object, + * {@link rootDse()} caches successful requests. + * Internally, Net_LDAP2 needs several lookups to this object, so + * caching increases performance significally. + * + * @access protected + * @var array + */ + protected $_rootDSE_cache = array(); + + /** + * Returns the Net_LDAP2 Release version, may be called statically + * + * @static + * @return string Net_LDAP2 version + */ + public static function getVersion() + { + return NET_LDAP2_VERSION; + } + + /** + * Configure Net_LDAP2, connect and bind + * + * Use this method as starting point of using Net_LDAP2 + * to establish a connection to your LDAP server. + * + * Static function that returns either an error object or the new Net_LDAP2 + * object. Something like a factory. Takes a config array with the needed + * parameters. + * + * @param array $config Configuration array + * + * @access public + * @return Net_LDAP2_Error|Net_LDAP2 Net_LDAP2_Error or Net_LDAP2 object + */ + public static function connect($config = array()) + { + $ldap_check = self::checkLDAPExtension(); + if (self::iserror($ldap_check)) { + return $ldap_check;
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2/Entry.php
Added
@@ -0,0 +1,1096 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the Net_LDAP2_Entry interface class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Jan Wagner <wagner@netsols.de> +* @author Tarjej Huse <tarjei@bergfald.no> +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2009 Tarjej Huse, Jan Wagner, Benedikt Hallinger +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +*/ + +/** +* Includes +*/ +require_once 'PEAR.php'; +require_once 'Net/LDAP2/Util.php'; + +/** +* Object representation of a directory entry +* +* This class represents a directory entry. You can add, delete, replace +* attributes and their values, rename the entry, delete the entry. +* +* @category Net +* @package Net_LDAP2 +* @author Jan Wagner <wagner@netsols.de> +* @author Tarjej Huse <tarjei@bergfald.no> +* @author Benedikt Hallinger <beni@php.net> +* @license http://www.gnu.org/copyleft/lesser.html LGPL +* @link http://pear.php.net/package/Net_LDAP2/ +*/ +class Net_LDAP2_Entry extends PEAR +{ + /** + * Entry ressource identifier + * + * @access protected + * @var ressource + */ + protected $_entry = null; + + /** + * LDAP ressource identifier + * + * @access protected + * @var ressource + */ + protected $_link = null; + + /** + * Net_LDAP2 object + * + * This object will be used for updating and schema checking + * + * @access protected + * @var object Net_LDAP2 + */ + protected $_ldap = null; + + /** + * Distinguished name of the entry + * + * @access protected + * @var string + */ + protected $_dn = null; + + /** + * Attributes + * + * @access protected + * @var array + */ + protected $_attributes = array(); + + /** + * Original attributes before any modification + * + * @access protected + * @var array + */ + protected $_original = array(); + + + /** + * Map of attribute names + * + * @access protected + * @var array + */ + protected $_map = array(); + + + /** + * Is this a new entry? + * + * @access protected + * @var boolean + */ + protected $_new = true; + + /** + * New distinguished name + * + * @access protected + * @var string + */ + protected $_newdn = null; + + /** + * Shall the entry be deleted? + * + * @access protected + * @var boolean + */ + protected $_delete = false; + + /** + * Map with changes to the entry + * + * @access protected + * @var array + */ + protected $_changes = array("add" => array(), + "delete" => array(), + "replace" => array() + ); + /** + * Internal Constructor + * + * Constructor of the entry. Sets up the distinguished name and the entries + * attributes. + * You should not call this method manually! Use {@link Net_LDAP2_Entry::createFresh()} + * or {@link Net_LDAP2_Entry::createConnected()} instead! + * + * @param Net_LDAP2|ressource|array $ldap Net_LDAP2 object, ldap-link ressource or array of attributes + * @param string|ressource $entry Either a DN or a LDAP-Entry ressource + * + * @access protected + * @return none + */ + public function __construct($ldap, $entry = null) + { + parent::__construct('Net_LDAP2_Error'); + + // set up entry resource or DN + if (is_resource($entry)) { + $this->_entry = $entry; + } else { + $this->_dn = $entry; + } + + // set up LDAP link + if ($ldap instanceof Net_LDAP2) { + $this->_ldap = $ldap; + $this->_link = $ldap->getLink(); + } elseif (is_resource($ldap)) { + $this->_link = $ldap; + } elseif (is_array($ldap)) { + // Special case: here $ldap is an array of attributes, + // this means, we have no link. This is a "virtual" entry. + // We just set up the attributes so one can work with the object + // as expected, but an update() fails unless setLDAP() is called. + $this->setAttributes($ldap); + } + + // if this is an entry existing in the directory, + // then set up as old and fetch attrs + if (is_resource($this->_entry) && is_resource($this->_link)) { + $this->_new = false; + $this->_dn = @ldap_get_dn($this->_link, $this->_entry); + $this->setAttributes(); // fetch attributes from server + } + } + + /** + * Creates a fresh entry that may be added to the directory later on + * + * Use this method, if you want to initialize a fresh entry. + * + * The method should be called statically: $entry = Net_LDAP2_Entry::createFresh(); + * You should put a 'objectClass' attribute into the $attrs so the directory server + * knows which object you want to create. However, you may omit this in case you + * don't want to add this entry to a directory server. + * + * The attributes parameter is as following: + * <code> + * $attrs = array( 'attribute1' => array('value1', 'value2'), + * 'attribute2' => 'single value' + * ); + * </code> + *
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2/Filter.php
Added
@@ -0,0 +1,675 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the Net_LDAP2_Filter interface class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2009 Benedikt Hallinger +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +*/ + +/** +* Includes +*/ +require_once 'PEAR.php'; +require_once 'Net/LDAP2/Util.php'; +require_once 'Net/LDAP2/Entry.php'; + +/** +* Object representation of a part of a LDAP filter. +* +* This Class is not completely compatible to the PERL interface! +* +* The purpose of this class is, that users can easily build LDAP filters +* without having to worry about right escaping etc. +* A Filter is built using several independent filter objects +* which are combined afterwards. This object works in two +* modes, depending how the object is created. +* If the object is created using the {@link create()} method, then this is a leaf-object. +* If the object is created using the {@link combine()} method, then this is a container object. +* +* LDAP filters are defined in RFC-2254 and can be found under +* {@link http://www.ietf.org/rfc/rfc2254.txt} +* +* Here a quick copy&paste example: +* <code> +* $filter0 = Net_LDAP2_Filter::create('stars', 'equals', '***'); +* $filter_not0 = Net_LDAP2_Filter::combine('not', $filter0); +* +* $filter1 = Net_LDAP2_Filter::create('gn', 'begins', 'bar'); +* $filter2 = Net_LDAP2_Filter::create('gn', 'ends', 'baz'); +* $filter_comp = Net_LDAP2_Filter::combine('or',array($filter_not0, $filter1, $filter2)); +* +* echo $filter_comp->asString(); +* // This will output: (|(!(stars=\0x5c0x2a\0x5c0x2a\0x5c0x2a))(gn=bar*)(gn=*baz)) +* // The stars in $filter0 are treaten as real stars unless you disable escaping. +* </code> +* +* @category Net +* @package Net_LDAP2 +* @author Benedikt Hallinger <beni@php.net> +* @license http://www.gnu.org/copyleft/lesser.html LGPL +* @link http://pear.php.net/package/Net_LDAP2/ +*/ +class Net_LDAP2_Filter extends PEAR +{ + /** + * Storage for combination of filters + * + * This variable holds a array of filter objects + * that should be combined by this filter object. + * + * @access protected + * @var array + */ + protected $_subfilters = array(); + + /** + * Match of this filter + * + * If this is a leaf filter, then a matching rule is stored, + * if it is a container, then it is a logical operator + * + * @access protected + * @var string + */ + protected $_match; + + /** + * Single filter + * + * If we operate in leaf filter mode, + * then the constructing method stores + * the filter representation here + * + * @acces private + * @var string + */ + protected $_filter; + + /** + * Create a new Net_LDAP2_Filter object and parse $filter. + * + * This is for PERL Net::LDAP interface. + * Construction of Net_LDAP2_Filter objects should happen through either + * {@link create()} or {@link combine()} which give you more control. + * However, you may use the perl iterface if you already have generated filters. + * + * @param string $filter LDAP filter string + * + * @see parse() + */ + public function __construct($filter = false) + { + // The optional parameter must remain here, because otherwise create() crashes + if (false !== $filter) { + $filter_o = self::parse($filter); + if (PEAR::isError($filter_o)) { + $this->_filter = $filter_o; // assign error, so asString() can report it + } else { + $this->_filter = $filter_o->asString(); + } + } + } + + /** + * Constructor of a new part of a LDAP filter. + * + * The following matching rules exists: + * - equals: One of the attributes values is exactly $value + * Please note that case sensitiviness is depends on the + * attributes syntax configured in the server. + * - begins: One of the attributes values must begin with $value + * - ends: One of the attributes values must end with $value + * - contains: One of the attributes values must contain $value + * - present | any: The attribute can contain any value but must be existent + * - greater: The attributes value is greater than $value + * - less: The attributes value is less than $value + * - greaterOrEqual: The attributes value is greater or equal than $value + * - lessOrEqual: The attributes value is less or equal than $value + * - approx: One of the attributes values is similar to $value + * + * Negation ("not") can be done by prepending the above operators with the + * "not" or "!" keyword, see example below. + * + * If $escape is set to true (default) then $value will be escaped + * properly. If it is set to false then $value will be treaten as raw filter value string. + * You should escape yourself using {@link Net_LDAP2_Util::escape_filter_value()}! + * + * Examples: + * <code> + * // This will find entries that contain an attribute "sn" that ends with "foobar": + * $filter = Net_LDAP2_Filter::create('sn', 'ends', 'foobar'); + * + * // This will find entries that contain an attribute "sn" that has any value set: + * $filter = Net_LDAP2_Filter::create('sn', 'any'); + * + * // This will build a negated equals filter: + * $filter = Net_LDAP2_Filter::create('sn', 'not equals', 'foobar'); + * </code> + * + * @param string $attr_name Name of the attribute the filter should apply to + * @param string $match Matching rule (equals, begins, ends, contains, greater, less, greaterOrEqual, lessOrEqual, approx, any) + * @param string $value (optional) if given, then this is used as a filter + * @param boolean $escape Should $value be escaped? (default: yes, see {@link Net_LDAP2_Util::escape_filter_value()} for detailed information) + * + * @return Net_LDAP2_Filter|Net_LDAP2_Error + */ + public static function create($attr_name, $match, $value = '', $escape = true) + { + $leaf_filter = new Net_LDAP2_Filter(); + if ($escape) { + $array = Net_LDAP2_Util::escape_filter_value(array($value)); + $value = $array[0]; + } + + $match = strtolower($match); + + // detect negation + $neg_matches = array(); + $negate_filter = false; + if (preg_match('/^(?:not|!)[\s_-](.+)/', $match, $neg_matches)) { + $negate_filter = true; + $match = $neg_matches[1]; + } + + // build basic filter + switch ($match) { + case 'equals': + case '=': + case '==': + $leaf_filter->_filter = '(' . $attr_name . '=' . $value . ')'; + break; + case 'begins': + $leaf_filter->_filter = '(' . $attr_name . '=' . $value . '*)'; + break; + case 'ends': + $leaf_filter->_filter = '(' . $attr_name . '=*' . $value . ')'; + break; + case 'contains': + $leaf_filter->_filter = '(' . $attr_name . '=*' . $value . '*)'; + break; + case 'greater': + case '>':
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2/LDIF.php
Added
@@ -0,0 +1,925 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the Net_LDAP2_LDIF interface class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2009 Benedikt Hallinger +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +*/ + +/** +* Includes +*/ +require_once 'PEAR.php'; +require_once 'Net/LDAP2.php'; +require_once 'Net/LDAP2/Entry.php'; +require_once 'Net/LDAP2/Util.php'; + +/** +* LDIF capabilitys for Net_LDAP2, closely taken from PERLs Net::LDAP +* +* It provides a means to convert between Net_LDAP2_Entry objects and LDAP entries +* represented in LDIF format files. Reading and writing are supported and may +* manipulate single entries or lists of entries. +* +* Usage example: +* <code> +* // Read and parse an ldif-file into Net_LDAP2_Entry objects +* // and print out the DNs. Store the entries for later use. +* require 'Net/LDAP2/LDIF.php'; +* $options = array( +* 'onerror' => 'die' +* ); +* $entries = array(); +* $ldif = new Net_LDAP2_LDIF('test.ldif', 'r', $options); +* do { +* $entry = $ldif->read_entry(); +* $dn = $entry->dn(); +* echo " done building entry: $dn\n"; +* array_push($entries, $entry); +* } while (!$ldif->eof()); +* $ldif->done(); +* +* +* // write those entries to another file +* $ldif = new Net_LDAP2_LDIF('test.out.ldif', 'w', $options); +* $ldif->write_entry($entries); +* $ldif->done(); +* </code> +* +* @category Net +* @package Net_LDAP2 +* @author Benedikt Hallinger <beni@php.net> +* @license http://www.gnu.org/copyleft/lesser.html LGPL +* @link http://pear.php.net/package/Net_LDAP22/ +* @see http://www.ietf.org/rfc/rfc2849.txt +* @todo Error handling should be PEARified +* @todo LDAPv3 controls are not implemented yet +*/ +class Net_LDAP2_LDIF extends PEAR +{ + /** + * Options + * + * @access protected + * @var array + */ + protected $_options = array('encode' => 'base64', + 'onerror' => null, + 'change' => 0, + 'lowercase' => 0, + 'sort' => 0, + 'version' => null, + 'wrap' => 78, + 'raw' => '' + ); + + /** + * Errorcache + * + * @access protected + * @var array + */ + protected $_error = array('error' => null, + 'line' => 0 + ); + + /** + * Filehandle for read/write + * + * @access protected + * @var array + */ + protected $_FH = null; + + /** + * Says, if we opened the filehandle ourselves + * + * @access protected + * @var array + */ + protected $_FH_opened = false; + + /** + * Linecounter for input file handle + * + * @access protected + * @var array + */ + protected $_input_line = 0; + + /** + * counter for processed entries + * + * @access protected + * @var int + */ + protected $_entrynum = 0; + + /** + * Mode we are working in + * + * Either 'r', 'a' or 'w' + * + * @access protected + * @var string + */ + protected $_mode = false; + + /** + * Tells, if the LDIF version string was already written + * + * @access protected + * @var boolean + */ + protected $_version_written = false; + + /** + * Cache for lines that have build the current entry + * + * @access protected + * @var boolean + */ + protected $_lines_cur = array(); + + /** + * Cache for lines that will build the next entry + * + * @access protected + * @var boolean + */ + protected $_lines_next = array(); + + /** + * Open LDIF file for reading or for writing + * + * new (FILE): + * Open the file read-only. FILE may be the name of a file + * or an already open filehandle. + * If the file doesn't exist, it will be created if in write mode. + * + * new (FILE, MODE, OPTIONS): + * Open the file with the given MODE (see PHPs fopen()), eg "w" or "a". + * FILE may be the name of a file or an already open filehandle. + * PERLs Net_LDAP2 "FILE|" mode does not work curently. + * + * OPTIONS is an associative array and may contain: + * encode => 'none' | 'canonical' | 'base64' + * Some DN values in LDIF cannot be written verbatim and have to be encoded in some way: + * 'none' No encoding. + * 'canonical' See "canonical_dn()" in Net::LDAP::Util. + * 'base64' Use base64. (default, this differs from the Perl interface. + * The perl default is "none"!) + * + * onerror => 'die' | 'warn' | NULL + * Specify what happens when an error is detected. + * 'die' Net_LDAP2_LDIF will croak with an appropriate message. + * 'warn' Net_LDAP2_LDIF will warn (echo) with an appropriate message. + * NULL Net_LDAP2_LDIF will not warn (default), use error(). + * + * change => 1 + * Write entry changes to the LDIF file instead of the entries itself. I.e. write LDAP + * operations acting on the entries to the file instead of the entries contents. + * This writes the changes usually carried out by an update() to the LDIF file. + * + * lowercase => 1 + * Convert attribute names to lowercase when writing. + * + * sort => 1 + * Sort attribute names when writing entries according to the rule: + * objectclass first then all other attributes alphabetically sorted by attribute name + * + * version => '1'
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2/RootDSE.php
Added
@@ -0,0 +1,240 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the Net_LDAP2_RootDSE interface class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Jan Wagner <wagner@netsols.de> +* @copyright 2009 Jan Wagner +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +*/ + +/** +* Includes +*/ +require_once 'PEAR.php'; + +/** +* Getting the rootDSE entry of a LDAP server +* +* @category Net +* @package Net_LDAP2 +* @author Jan Wagner <wagner@netsols.de> +* @license http://www.gnu.org/copyleft/lesser.html LGPL +* @link http://pear.php.net/package/Net_LDAP22/ +*/ +class Net_LDAP2_RootDSE extends PEAR +{ + /** + * @access protected + * @var object Net_LDAP2_Entry + **/ + protected $_entry; + + /** + * Class constructor + * + * @param Net_LDAP2_Entry &$entry Net_LDAP2_Entry object of the RootDSE + */ + public function __construct(&$entry) + { + $this->_entry = $entry; + } + + /** + * Fetches a RootDSE object from an LDAP connection + * + * @param Net_LDAP2 $ldap Directory from which the RootDSE should be fetched + * @param array $attrs Array of attributes to search for + * + * @access static + * @return Net_LDAP2_RootDSE|Net_LDAP2_Error + */ + public static function fetch($ldap, $attrs = null) + { + if (!$ldap instanceof Net_LDAP2) { + return PEAR::raiseError("Unable to fetch Schema: Parameter \$ldap must be a Net_LDAP2 object!"); + } + + if (is_array($attrs) && count($attrs) > 0 ) { + $attributes = $attrs; + } else { + $attributes = array('vendorName', + 'vendorVersion', + 'namingContexts', + 'altServer', + 'supportedExtension', + 'supportedControl', + 'supportedSASLMechanisms', + 'supportedLDAPVersion', + 'subschemaSubentry' ); + } + $result = $ldap->search('', '(objectClass=*)', array('attributes' => $attributes, 'scope' => 'base')); + if (self::isError($result)) { + return $result; + } + $entry = $result->shiftEntry(); + if (false === $entry) { + return PEAR::raiseError('Could not fetch RootDSE entry'); + } + $ret = new Net_LDAP2_RootDSE($entry); + return $ret; + } + + /** + * Gets the requested attribute value + * + * Same usuage as {@link Net_LDAP2_Entry::getValue()} + * + * @param string $attr Attribute name + * @param array $options Array of options + * + * @access public + * @return mixed Net_LDAP2_Error object or attribute values + * @see Net_LDAP2_Entry::get_value() + */ + public function getValue($attr = '', $options = '') + { + return $this->_entry->get_value($attr, $options); + } + + /** + * Alias function of getValue() for perl-ldap interface + * + * @see getValue() + * @return mixed + */ + public function get_value() + { + $args = func_get_args(); + return call_user_func_array(array( &$this, 'getValue' ), $args); + } + + /** + * Determines if the extension is supported + * + * @param array $oids Array of oids to check + * + * @access public + * @return boolean + */ + public function supportedExtension($oids) + { + return $this->checkAttr($oids, 'supportedExtension'); + } + + /** + * Alias function of supportedExtension() for perl-ldap interface + * + * @see supportedExtension() + * @return boolean + */ + public function supported_extension() + { + $args = func_get_args(); + return call_user_func_array(array( &$this, 'supportedExtension'), $args); + } + + /** + * Determines if the version is supported + * + * @param array $versions Versions to check + * + * @access public + * @return boolean + */ + public function supportedVersion($versions) + { + return $this->checkAttr($versions, 'supportedLDAPVersion'); + } + + /** + * Alias function of supportedVersion() for perl-ldap interface + * + * @see supportedVersion() + * @return boolean + */ + public function supported_version() + { + $args = func_get_args(); + return call_user_func_array(array(&$this, 'supportedVersion'), $args); + } + + /** + * Determines if the control is supported + * + * @param array $oids Control oids to check + * + * @access public + * @return boolean + */ + public function supportedControl($oids) + { + return $this->checkAttr($oids, 'supportedControl'); + } + + /** + * Alias function of supportedControl() for perl-ldap interface + * + * @see supportedControl() + * @return boolean + */ + public function supported_control() + { + $args = func_get_args(); + return call_user_func_array(array(&$this, 'supportedControl' ), $args); + } + + /** + * Determines if the sasl mechanism is supported + * + * @param array $mechlist SASL mechanisms to check + * + * @access public + * @return boolean
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2/Schema.php
Added
@@ -0,0 +1,622 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the Net_LDAP2_Schema interface class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Jan Wagner <wagner@netsols.de> +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2009 Jan Wagner, Benedikt Hallinger +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +* @todo see the comment at the end of the file +*/ + +/** +* Includes +*/ +require_once 'PEAR.php'; + +/** +* Syntax definitions +* +* Please don't forget to add binary attributes to isBinary() below +* to support proper value fetching from Net_LDAP2_Entry +*/ +define('NET_LDAP2_SYNTAX_BOOLEAN', '1.3.6.1.4.1.1466.115.121.1.7'); +define('NET_LDAP2_SYNTAX_DIRECTORY_STRING', '1.3.6.1.4.1.1466.115.121.1.15'); +define('NET_LDAP2_SYNTAX_DISTINGUISHED_NAME', '1.3.6.1.4.1.1466.115.121.1.12'); +define('NET_LDAP2_SYNTAX_INTEGER', '1.3.6.1.4.1.1466.115.121.1.27'); +define('NET_LDAP2_SYNTAX_JPEG', '1.3.6.1.4.1.1466.115.121.1.28'); +define('NET_LDAP2_SYNTAX_NUMERIC_STRING', '1.3.6.1.4.1.1466.115.121.1.36'); +define('NET_LDAP2_SYNTAX_OID', '1.3.6.1.4.1.1466.115.121.1.38'); +define('NET_LDAP2_SYNTAX_OCTET_STRING', '1.3.6.1.4.1.1466.115.121.1.40'); + +/** +* Load an LDAP Schema and provide information +* +* This class takes a Subschema entry, parses this information +* and makes it available in an array. Most of the code has been +* inspired by perl-ldap( http://perl-ldap.sourceforge.net). +* You will find portions of their implementation in here. +* +* @category Net +* @package Net_LDAP2 +* @author Jan Wagner <wagner@netsols.de> +* @author Benedikt Hallinger <beni@php.net> +* @license http://www.gnu.org/copyleft/lesser.html LGPL +* @link http://pear.php.net/package/Net_LDAP22/ +*/ +class Net_LDAP2_Schema extends PEAR +{ + /** + * Map of entry types to ldap attributes of subschema entry + * + * @access public + * @var array + */ + public $types = array( + 'attribute' => 'attributeTypes', + 'ditcontentrule' => 'dITContentRules', + 'ditstructurerule' => 'dITStructureRules', + 'matchingrule' => 'matchingRules', + 'matchingruleuse' => 'matchingRuleUse', + 'nameform' => 'nameForms', + 'objectclass' => 'objectClasses', + 'syntax' => 'ldapSyntaxes' + ); + + /** + * Array of entries belonging to this type + * + * @access protected + * @var array + */ + protected $_attributeTypes = array(); + protected $_matchingRules = array(); + protected $_matchingRuleUse = array(); + protected $_ldapSyntaxes = array(); + protected $_objectClasses = array(); + protected $_dITContentRules = array(); + protected $_dITStructureRules = array(); + protected $_nameForms = array(); + + + /** + * hash of all fetched oids + * + * @access protected + * @var array + */ + protected $_oids = array(); + + /** + * Tells if the schema is initialized + * + * @access protected + * @var boolean + * @see parse(), get() + */ + protected $_initialized = false; + + + /** + * Constructor of the class + * + * @access protected + */ + public function __construct() + { + parent::__construct('Net_LDAP2_Error'); // default error class + } + + /** + * Fetch the Schema from an LDAP connection + * + * @param Net_LDAP2 $ldap LDAP connection + * @param string $dn (optional) Subschema entry dn + * + * @access public + * @return Net_LDAP2_Schema|NET_LDAP2_Error + */ + public static function fetch($ldap, $dn = null) + { + if (!$ldap instanceof Net_LDAP2) { + return PEAR::raiseError("Unable to fetch Schema: Parameter \$ldap must be a Net_LDAP2 object!"); + } + + $schema_o = new Net_LDAP2_Schema(); + + if (is_null($dn)) { + // get the subschema entry via root dse + $dse = $ldap->rootDSE(array('subschemaSubentry')); + if (false == Net_LDAP2::isError($dse)) { + $base = $dse->getValue('subschemaSubentry', 'single'); + if (!Net_LDAP2::isError($base)) { + $dn = $base; + } + } + } + + // Support for buggy LDAP servers (e.g. Siemens DirX 6.x) that incorrectly + // call this entry subSchemaSubentry instead of subschemaSubentry. + // Note the correct case/spelling as per RFC 2251. + if (is_null($dn)) { + // get the subschema entry via root dse + $dse = $ldap->rootDSE(array('subSchemaSubentry')); + if (false == Net_LDAP2::isError($dse)) { + $base = $dse->getValue('subSchemaSubentry', 'single'); + if (!Net_LDAP2::isError($base)) { + $dn = $base; + } + } + } + + // Final fallback case where there is no subschemaSubentry attribute + // in the root DSE (this is a bug for an LDAP v3 server so report this + // to your LDAP vendor if you get this far). + if (is_null($dn)) { + $dn = 'cn=Subschema'; + } + + // fetch the subschema entry + $result = $ldap->search($dn, '(objectClass=*)', + array('attributes' => array_values($schema_o->types), + 'scope' => 'base')); + if (Net_LDAP2::isError($result)) { + return PEAR::raiseError('Could not fetch Subschema entry: '.$result->getMessage()); + } + + $entry = $result->shiftEntry(); + if (!$entry instanceof Net_LDAP2_Entry) { + if ($entry instanceof Net_LDAP2_Error) { + return PEAR::raiseError('Could not fetch Subschema entry: '.$entry->getMessage()); + } else { + return PEAR::raiseError('Could not fetch Subschema entry (search returned '.$result->count().' entries. Check parameter \'basedn\')'); + } + } + + $schema_o->parse($entry); + return $schema_o; + } + + /** + * Return a hash of entries for the given type + * + * Returns a hash of entry for the givene type. Types may be: + * objectclasses, attributes, ditcontentrules, ditstructurerules, matchingrules, + * matchingruleuses, nameforms, syntaxes + * + * @param string $type Type to fetch + * + * @access public + * @return array|Net_LDAP2_Error Array or Net_LDAP2_Error + */ + public function &getAll($type)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2/SchemaCache.interface.php
Added
@@ -0,0 +1,59 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the Net_LDAP2_SchemaCache interface class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2009 Benedikt Hallinger +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +*/ + +/** +* Interface describing a custom schema cache object +* +* To implement a custom schema cache, one must implement this interface and +* pass the instanciated object to Net_LDAP2s registerSchemaCache() method. +*/ +interface Net_LDAP2_SchemaCache +{ + /** + * Return the schema object from the cache + * + * Net_LDAP2 will consider anything returned invalid, except + * a valid Net_LDAP2_Schema object. + * In case you return a Net_LDAP2_Error, this error will be routed + * to the return of the $ldap->schema() call. + * If you return something else, Net_LDAP2 will + * fetch a fresh Schema object from the LDAP server. + * + * You may want to implement a cache aging mechanism here too. + * + * @return Net_LDAP2_Schema|Net_LDAP2_Error|false + */ + public function loadSchema(); + + /** + * Store a schema object in the cache + * + * This method will be called, if Net_LDAP2 has fetched a fresh + * schema object from LDAP and wants to init or refresh the cache. + * + * In case of errors you may return a Net_LDAP2_Error which will + * be routet to the client. + * Note that doing this prevents, that the schema object fetched from LDAP + * will be given back to the client, so only return errors if storing + * of the cache is something crucial (e.g. for doing something else with it). + * Normaly you dont want to give back errors in which case Net_LDAP2 needs to + * fetch the schema once per script run and instead use the error + * returned from loadSchema(). + * + * @return true|Net_LDAP2_Error + */ + public function storeSchema($schema); +}
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2/Search.php
Added
@@ -0,0 +1,631 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the Net_LDAP2_Search interface class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Tarjej Huse <tarjei@bergfald.no> +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2009 Tarjej Huse, Benedikt Hallinger +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +*/ + +/** +* Includes +*/ +require_once 'PEAR.php'; + +/** +* Result set of an LDAP search +* +* @category Net +* @package Net_LDAP2 +* @author Tarjej Huse <tarjei@bergfald.no> +* @author Benedikt Hallinger <beni@php.net> +* @license http://www.gnu.org/copyleft/lesser.html LGPL +* @link http://pear.php.net/package/Net_LDAP22/ +*/ +class Net_LDAP2_Search extends PEAR implements Iterator +{ + /** + * Search result identifier + * + * @access protected + * @var resource + */ + protected $_search; + + /** + * LDAP resource link + * + * @access protected + * @var resource + */ + protected $_link; + + /** + * Net_LDAP2 object + * + * A reference of the Net_LDAP2 object for passing to Net_LDAP2_Entry + * + * @access protected + * @var object Net_LDAP2 + */ + protected $_ldap; + + /** + * Result entry identifier + * + * @access protected + * @var resource + */ + protected $_entry = null; + + /** + * The errorcode the search got + * + * Some errorcodes might be of interest, but might not be best handled as errors. + * examples: 4 - LDAP_SIZELIMIT_EXCEEDED - indicates a huge search. + * Incomplete results are returned. If you just want to check if there's anything in the search. + * than this is a point to handle. + * 32 - no such object - search here returns a count of 0. + * + * @access protected + * @var int + */ + protected $_errorCode = 0; // if not set - sucess! + + /** + * Cache for all entries already fetched from iterator interface + * + * @access protected + * @var array + */ + protected $_iteratorCache = array(); + + /** + * What attributes we searched for + * + * The $attributes array contains the names of the searched attributes and gets + * passed from $Net_LDAP2->search() so the Net_LDAP2_Search object can tell + * what attributes was searched for ({@link searchedAttrs()) + * + * This variable gets set from the constructor and returned + * from {@link searchedAttrs()} + * + * @access protected + * @var array + */ + protected $_searchedAttrs = array(); + + /** + * Cache variable for storing entries fetched internally + * + * This currently is not used by all functions and need consolidation. + * + * @access protected + * @var array + */ + protected $_entry_cache = false; + + /** + * Cache variable for count() + * + * @see count() + * @access protected + * @var int + */ + protected $_count_cache = null; + + /** + * Constructor + * + * @param resource $search Search result identifier + * @param Net_LDAP2|resource $ldap Net_LDAP2 object or just a LDAP-Link resource + * @param array $attributes (optional) Array with searched attribute names. (see {@link $_searchedAttrs}) + * + * @access public + */ + public function __construct($search, $ldap, $attributes = array()) + { + parent::__construct('Net_LDAP2_Error'); + + $this->setSearch($search); + + if ($ldap instanceof Net_LDAP2) { + $this->_ldap = $ldap; + $this->setLink($this->_ldap->getLink()); + } else { + $this->setLink($ldap); + } + + $this->_errorCode = @ldap_errno($this->_link); + + if (is_array($attributes) && !empty($attributes)) { + $this->_searchedAttrs = $attributes; + } + } + + /** + * Returns an array of entry objects. + * + * @return array Array of entry objects. + */ + public function entries() + { + $entries = array(); + + if (false === $this->_entry_cache) { + // cache is empty: fetch from LDAP + while ($entry = $this->shiftEntry()) { + $entries[] = $entry; + } + $this->_entry_cache = $entries; // store result in cache + } + + return $this->_entry_cache; + } + + /** + * Get the next entry in the searchresult from LDAP server. + * + * This will return a valid Net_LDAP2_Entry object or false, so + * you can use this method to easily iterate over the entries inside + * a while loop. + * + * @return Net_LDAP2_Entry|false Reference to Net_LDAP2_Entry object or false + */ + public function shiftEntry() + { + if (is_null($this->_entry)) { + if(!$this->_entry = @ldap_first_entry($this->_link, $this->_search)) { + $false = false; + return $false; + } + $entry = Net_LDAP2_Entry::createConnected($this->_ldap, $this->_entry); + if ($entry instanceof PEAR_Error) $entry = false; + } else { + if (!$this->_entry = @ldap_next_entry($this->_link, $this->_entry)) { + $false = false; + return $false; + } + $entry = Net_LDAP2_Entry::createConnected($this->_ldap, $this->_entry); + if ($entry instanceof PEAR_Error) $entry = false; + }
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2/SimpleFileSchemaCache.php
Added
@@ -0,0 +1,97 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the example simple file based Schema Caching class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2009 Benedikt Hallinger +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +*/ + +/** +* A simple file based schema cacher with cache aging. +* +* Once the cache is too old, the loadSchema() method will return false, so +* Net_LDAP2 will fetch a fresh object from the LDAP server that will +* overwrite the current (outdated) old cache. +*/ +class Net_LDAP2_SimpleFileSchemaCache implements Net_LDAP2_SchemaCache +{ + /** + * Internal config of this cache + * + * @see Net_LDAP2_SimpleFileSchemaCache() + * @var array + */ + protected $config = array( + 'path' => '/tmp/Net_LDAP_Schema.cache', + 'max_age' => 1200 + ); + + /** + * Initialize the simple cache + * + * Config is as following: + * path Complete path to the cache file. + * max_age Maximum age of cache in seconds, 0 means "endlessly". + * + * @param array $cfg Config array + */ + public function __construct($cfg) + { + foreach ($cfg as $key => $value) { + if (array_key_exists($key, $this->config)) { + if (gettype($this->config[$key]) != gettype($value)) { + $this->getCore()->dropFatalError(__CLASS__.": Could not set config! Key $key does not match type ".gettype($this->config[$key])."!"); + } + $this->config[$key] = $value; + } else { + $this->getCore()->dropFatalError(__CLASS__.": Could not set config! Key $key is not defined!"); + } + } + } + + /** + * Return the schema object from the cache + * + * If file is existent and cache has not expired yet, + * then the cache is deserialized and returned. + * + * @return Net_LDAP2_Schema|Net_LDAP2_Error|false + */ + public function loadSchema() + { + $return = false; // Net_LDAP2 will load schema from LDAP + if (file_exists($this->config['path'])) { + $cache_maxage = filemtime($this->config['path']) + $this->config['max_age']; + if (time() <= $cache_maxage || $this->config['max_age'] == 0) { + $return = unserialize(file_get_contents($this->config['path'])); + } + } + return $return; + } + + /** + * Store a schema object in the cache + * + * This method will be called, if Net_LDAP2 has fetched a fresh + * schema object from LDAP and wants to init or refresh the cache. + * + * To invalidate the cache and cause Net_LDAP2 to refresh the cache, + * you can call this method with null or false as value. + * The next call to $ldap->schema() will then refresh the caches object. + * + * @param mixed $schema The object that should be cached + * @return true|Net_LDAP2_Error|false + */ + public function storeSchema($schema) { + file_put_contents($this->config['path'], serialize($schema)); + return true; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/Net/LDAP2/Util.php
Added
@@ -0,0 +1,620 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** +* File containing the Net_LDAP2_Util interface class. +* +* PHP version 5 +* +* @category Net +* @package Net_LDAP2 +* @author Benedikt Hallinger <beni@php.net> +* @copyright 2009 Benedikt Hallinger +* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3 +* @version SVN: $Id$ +* @link http://pear.php.net/package/Net_LDAP2/ +*/ + +/** +* Includes +*/ +require_once 'PEAR.php'; + +/** +* Utility Class for Net_LDAP2 +* +* This class servers some functionality to the other classes of Net_LDAP2 but most of +* the methods can be used separately as well. +* +* @category Net +* @package Net_LDAP2 +* @author Benedikt Hallinger <beni@php.net> +* @license http://www.gnu.org/copyleft/lesser.html LGPL +* @link http://pear.php.net/package/Net_LDAP22/ +*/ +class Net_LDAP2_Util extends PEAR +{ + /** + * Constructor + * + * @access public + */ + public function __construct() + { + // We do nothing here, since all methods can be called statically. + // In Net_LDAP <= 0.7, we needed a instance of Util, because + // it was possible to do utf8 encoding and decoding, but this + // has been moved to the LDAP class. The constructor remains only + // here to document the downward compatibility of creating an instance. + } + + /** + * Explodes the given DN into its elements + * + * {@link http://www.ietf.org/rfc/rfc2253.txt RFC 2253} says, a Distinguished Name is a sequence + * of Relative Distinguished Names (RDNs), which themselves + * are sets of Attributes. For each RDN a array is constructed where the RDN part is stored. + * + * For example, the DN 'OU=Sales+CN=J. Smith,DC=example,DC=net' is exploded to: + * <kbd>array( [0] => array([0] => 'OU=Sales', [1] => 'CN=J. Smith'), [2] => 'DC=example', [3] => 'DC=net' )</kbd> + * + * [NOT IMPLEMENTED] DNs might also contain values, which are the bytes of the BER encoding of + * the X.500 AttributeValue rather than some LDAP string syntax. These values are hex-encoded + * and prefixed with a #. To distinguish such BER values, ldap_explode_dn uses references to + * the actual values, e.g. '1.3.6.1.4.1.1466.0=#04024869,DC=example,DC=com' is exploded to: + * [ { '1.3.6.1.4.1.1466.0' => "\004\002Hi" }, { 'DC' => 'example' }, { 'DC' => 'com' } ]; + * See {@link http://www.vijaymukhi.com/vmis/berldap.htm} for more information on BER. + * + * It also performs the following operations on the given DN: + * - Unescape "\" followed by ",", "+", """, "\", "<", ">", ";", "#", "=", " ", or a hexpair + * and strings beginning with "#". + * - Removes the leading 'OID.' characters if the type is an OID instead of a name. + * - If an RDN contains multiple parts, the parts are re-ordered so that the attribute type names are in alphabetical order. + * + * OPTIONS is a list of name/value pairs, valid options are: + * casefold Controls case folding of attribute types names. + * Attribute values are not affected by this option. + * The default is to uppercase. Valid values are: + * lower Lowercase attribute types names. + * upper Uppercase attribute type names. This is the default. + * none Do not change attribute type names. + * reverse If TRUE, the RDN sequence is reversed. + * onlyvalues If TRUE, then only attributes values are returned ('foo' instead of 'cn=foo') + * + + * @param string $dn The DN that should be exploded + * @param array $options Options to use + * + * @static + * @return array Parts of the exploded DN + * @todo implement BER + */ + public static function ldap_explode_dn($dn, $options = array('casefold' => 'upper')) + { + if (!isset($options['onlyvalues'])) $options['onlyvalues'] = false; + if (!isset($options['reverse'])) $options['reverse'] = false; + if (!isset($options['casefold'])) $options['casefold'] = 'upper'; + + // Escaping of DN and stripping of "OID." + $dn = self::canonical_dn($dn, array('casefold' => $options['casefold'])); + + // splitting the DN + $dn_array = preg_split('/(?<=[^\\\\]),/', $dn); + + // clear wrong splitting (possibly we have split too much) + // /!\ Not clear, if this is neccessary here + //$dn_array = self::correct_dn_splitting($dn_array, ','); + + // construct subarrays for multivalued RDNs and unescape DN value + // also convert to output format and apply casefolding + foreach ($dn_array as $key => $value) { + $value_u = self::unescape_dn_value($value); + $rdns = self::split_rdn_multival($value_u[0]); + if (count($rdns) > 1) { + // MV RDN! + foreach ($rdns as $subrdn_k => $subrdn_v) { + // Casefolding + if ($options['casefold'] == 'upper') { + $subrdn_v = preg_replace_callback( + "/^\w+=/", + function ($matches) { + return strtoupper($matches[0]); + }, + $subrdn_v + ); + } else if ($options['casefold'] == 'lower') { + $subrdn_v = preg_replace_callback( + "/^\w+=/", + function ($matches) { + return strtolower($matches[0]); + }, + $subrdn_v + ); + } + + if ($options['onlyvalues']) { + preg_match('/(.+?)(?<!\\\\)=(.+)/', $subrdn_v, $matches); + $rdn_ocl = $matches[1]; + $rdn_val = $matches[2]; + $unescaped = self::unescape_dn_value($rdn_val); + $rdns[$subrdn_k] = $unescaped[0]; + } else { + $unescaped = self::unescape_dn_value($subrdn_v); + $rdns[$subrdn_k] = $unescaped[0]; + } + } + + $dn_array[$key] = $rdns; + } else { + // normal RDN + + // Casefolding + if ($options['casefold'] == 'upper') { + $value = preg_replace_callback( + "/^\w+=/", + function ($matches) { + return strtoupper($matches[0]); + }, + $value + ); + } else if ($options['casefold'] == 'lower') { + $value = preg_replace_callback( + "/^\w+=/", + function ($matches) { + return strtolower($matches[0]); + }, + $value + ); + } + + if ($options['onlyvalues']) { + preg_match('/(.+?)(?<!\\\\)=(.+)/', $value, $matches); + $dn_ocl = $matches[1]; + $dn_val = $matches[2]; + $unescaped = self::unescape_dn_value($dn_val); + $dn_array[$key] = $unescaped[0]; + } else { + $unescaped = self::unescape_dn_value($value); + $dn_array[$key] = $unescaped[0]; + } + } + } + + if ($options['reverse']) { + return array_reverse($dn_array); + } else { + return $dn_array; + } + } + + /** + * Escapes a DN value according to RFC 2253 + * + * Escapes the given VALUES according to RFC 2253 so that they can be safely used in LDAP DNs. + * The characters ",", "+", """, "\", "<", ">", ";", "#", "=" with a special meaning in RFC 2252 + * are preceeded by ba backslash. Control characters with an ASCII code < 32 are represented as \hexpair. + * Finally all leading and trailing spaces are converted to sequences of \20. + * + * @param array $values An array containing the DN values that should be escaped + * + * @static
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/composer.json
Added
@@ -0,0 +1,25 @@ +{ + "name": "pear/net_ldap2", + "description": "Object oriented interface for searching and manipulating LDAP-entries", + "license": "LGPL-3.0", + "type": "library", + "keywords": [ + "pear", + "ldap" + ], + "homepage": "http://pear.php.net/package/Net_LDAP2", + "support": { + "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Net_LDAP2", + "source": "https://github.com/pear/Net_LDAP2" + }, + "require": { + "pear/pear-core-minimal": "^1.10.1", + "ext-ldap": "*" + }, + "include-path": ["."], + "autoload": { + "classmap": [ + "Net/" + ] + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/README.txt
Added
@@ -0,0 +1,17 @@ +This is my own implementation of some classes for manipulation LDAP-entries in +a directory. + +The classes methods and structure are based on Perls Net::LDAP +(see perl-ldap.sf.net). The test.php file shuld provide you with enough +examples to do the most basic things. + +The largest difference between the perl implementation and this one (apart +from the fact that all array/list structures are different due to differences +in the two languages) is that instead of the method new you'll have to use the +method connect() instead. + +Patches and comments are most welcome! +Please submit them via PEARS Bug tracking feature or via mail +to one of Net_LDAP2s developers. Use unified context diffs if possible! + +The Net_LDAP2 Team \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/RootDSE.txt
Added
@@ -0,0 +1,57 @@ +First of all connect as usual. (Some servers require authentication to get the +RootDSE entry) + +$config = array( 'host' => 'localhost' ); +$ldap = Net_LDAP2::connect( $config ); +if( Net_LDAP2::isError( $ldap ) ) die( $ldap->getMessage() ); + +Now we can get the entry: + +$dse = $ldap->rootDSE(); +if( Net_LDAP2::isError( $dse ) die( $dse->getMessage() ); + +You can give an array of attributes to fetch as an parameter ro rootDSE(). +If none are given these ones are fetched: + +namingContexts +altServer +supportedExtension +supportedControl +supportedSASLMechanisms +supportedLDAPVersion +subschemaSubentry + +Then you can work with the object: + +$basedn = $dse->getValue( 'namingContexts' ); + +if( $dse->supportedVersion( 3 ) == 3 ) { + do_something_only_ldap_v3_can_do(); +} + +Public functions: + +getValue( string ) + +get the value of this attribute. same syntax as Net_LDAP2_Entry::get_value() + +supportedControl( oid ) +supportedExtension( oid ) + +check if the given control/extension is supported by the server + +supportedSASLMechanism( mechanism ) + +check if the given sasl mechanism is supported by the server + +supportedVersion( version ) + +check if the given ldap version is supported by the serve + +These are alias functions of the above, to make the api perl-ldap compatible. + +get_value() +supported_control() +supported_extension() +supported_sasl_mechanism() +supported_version()
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/Schema.txt
Added
@@ -0,0 +1,64 @@ +Examples: + +First of all connect to your server as usual. (Some servers require +authentication to get the Subschema entry) + +$config = array( 'host' => 'localhost' ); +$ldap = Net_LDAP2::connect( $config ); +if( Net_LDAP2::isError( $ldap ) ) die ( $ldap->getMessage() ) + +Then we can get the schema. + +$schema = $ldap->schema(); +if( Net_LDAP2::isError( $schema ) ) die ( $schema->getMessage() ); + +You can give a parameter to $ldap->schema() which sets the Subschema Entry dn. +If it is omitted, the entry dn will be fetched internally via rootDSE(). +If that fails it will be set to "cn=Subschema". + +$schema = $ldap->schema( 'cn=Subschema' ); + +Now you can work with the schema and retrieve information: + +$attrs = $schema->getAll( 'attributes' ); + +This returns an array with all attributes and their information such as syntax, +equality, max_length etc. Look at the returned array to see what information was +passed. + +Valid options to getAll() are: + +objectclasses +attributes +ditcontentrules +ditstructurerules +matchingrules +matchingruleuses +nameforms +syntaxes + +If you know the the name of an attribute or objectclass you can get the +information directly. + +$attr = $schema->get('attribute', 'userPassword'); +$oc = $schema->get('objectclass', 'posixAccount'); + +The first parameter determines the type of entry to be fetched and can be one +of: + +attribute +ditcontentrule +ditstructurerule +matchingrule +matchingruleuse +nameform +objectclass +syntax + +The second parameter can be the name or the oid of the entry. + +You can retrieve a list of required and optional attributes of an object class +via must( $oc ) or may( $oc ). Both return a list of attributes in an array. + +$required = $schema->must( 'posixAccount' ); +$optional = $schema->may( 'posixAccount' );
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/examples
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/examples/add_entry.php
Added
@@ -0,0 +1,53 @@ +<?php +/** +* This is a short example on how to add a new entry to your +* directory using Net_LDAP2. +*/ + +// We use the connecting.php example to get a link to our server. +// This file will also include all required basic Net_LDAP2 classes. +include_once 'connecting.php'; + +// Okay, we should have a valid link now. +// We must define the DN of the new entry. The DN is the +// global unique path to the data in the directory server, +// similar to a path name in your filesystem. +// Since we want to be a little flexible, we make the base +// dynamic, so it is enough to change the base-dn in your +// $ldap_config array. +$dn = 'cn=Foo Bar,'.$ldap_config['base']; + + +// It is a good idea to first look if the entry, that should be added, +// is already present: +if ($ldap->dnExists($dn)) { + die('Could not add entry! Entry already exists!'); +} + +// The entry does not exist so far, we can safely add him. +// But first, we must construct the entry. +// This is, because Net_LDAP2 was build to make changes only +// locally (in your script), not directly on the server. +$attributes = array( + 'sn' => 'Foo', + 'gn' => 'Bar', + 'mail' => array('foo@example.org', 'bar@example2.org'), + 'employeeNumber' => 123456 +); +$new_entry = Net_LDAP2_Entry::createFresh($dn, $attributes); + +// Finally add the entry in the server: +$result = $ldap->add($new_entry); +if (Net_LDAP2::isError($result)) { + die('Unable to add entry: '.$result->getMessage()); +} + +// The entry is now present in the directory server. +// Additionally, it is linked to the $ldap connection used for the add(), +// so you may call $entry->modify() (and friends) and $entry->update() +// without the need for passing an $ldap object. +// This is only the case if the entry was not linked to an Net_LDAP2 object +// before, so if the entry object would be fetched from a $ldap object +// and then added to $ldap_2, the link of the entry remains to $ldap, +// thus any update() will be performed on directory1 ($ldap). +?> \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/examples/connecting.php
Added
@@ -0,0 +1,44 @@ +<?php +/** +* This file shows you how to connect to a ldap server using Net_LDAP2. +* +* It also establishes connections for the other examples; +* they include this file to get a ldap link. +*/ + +// Class includes; this assumes Net_LDAP2 installed in PHPs include path +// or under subfolder "Net" in the local directory. +require_once 'Net/LDAP2.php'; + +// Configuration +// host can be a single server (string) or multiple ones - if we define more +// servers here (array), we can implement a basic fail over scenario. +// If no credentials (binddn and bindpw) are given, Net_LDAP2 establishes +// an anonymous bind. +// See the documentation for more information on the configuration items! +$ldap_config = array( +// 'host' => 'ldap.example.org', + 'host' => array('ldap1.example.org', 'ldap2.example.org'), +// 'binddn' => 'cn=admin,o=example,dc=org', +// 'bindpw' => 'your-secret-password', + 'tls' => false, + 'base' => 'o=example,dc=org', + 'port' => 389, + 'version' => 3, + 'filter' => '(cn=*)', + 'scope' => 'sub' +); + +// Connect to configured ldap server +$ldap = Net_LDAP2::connect($ldap_config); + +// It is important to check for errors. +// Nearly every method of Net_LDAP2 returns a Net_LDAP2_Error object +// if something went wrong. Through this object, you can retrieve detailed +// information on what exactly happened. +// +// Here we drop a die with the error message, so the other example +// files will not be calles unless we have a valid link. +if (Net_LDAP2::isError($ldap)) { + die('BIND FAILED: '.$ldap->getMessage()); +} \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/examples/fetch_entry.php
Added
@@ -0,0 +1,38 @@ +<?php +/** +* This is a short example on how to fetch a specific entry in the +* directory using Net_LDAP2. +*/ + +// We use the connecting.php example to get a link to our server. +// This file will also include all required basic Net_LDAP2 classes. +include_once 'connecting.php'; + +// Okay, we should have a valid link now. +// Lets fetch an entry! We want to know the admins first and last name. +// If we need additional attributes later, we must refetch the entry. +// It is a good practice to only select the attributes really needed. +// Since we want to be a little flexible, we make the base +// dynamic, so it is enough to change the base-dn in your +// $ldap_config array. +$entry = $ldap->getEntry('cn=admin,'.$ldap_config['base'], array('gn', 'sn')); + +// Error checking is important! +if (Net_LDAP2::isError($entry)) { + die('Could not fetch entry: '.$entry->getMessage()); +} + +// Now fetch the data from the entry +$surename = $entry->getValue('sn', 'single'); +if (Net_LDAP2::isError($surename)) { + die('Unable to get surename: '.$surename->getMessage()); +} +$givenname = $entry->getValue('gn', 'single'); +if (Net_LDAP2::isError($givenname)) { + die('Unable to get surename: '.$givenname->getMessage()); +} + +// Finally output the data of the entry: +// This will give something like "Name of cn=admin,o=example,dc=org: Foo Bar" +echo 'Name of '.$entry->DN().': '.$givenname.' '.$surename; +?> \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/examples/modify_entry.php
Added
@@ -0,0 +1,64 @@ +<?php +/** +* This is a short example on how to modify a specific entry in the +* directory using Net_LDAP2. +* +* There is an alternative way of doing this; please have a look at +* examples/modify_entry2.php +*/ + +// We use the fetch_entry.php example to get the LDAP-Entry +// which we will modify now. +include_once 'fetch_entry.php'; + +// Okay, we should have a valid Net_LDAP2_Entry object that represents +// a real existing entry in our directory. +// The changes are only locally made and executed on the server +// at the end of the script. + +// What we do now is to add two new attributes, one with two values +// Note that we can add attribute values which we haven't selected +// at fetching/searching the entry - but if we do that and +// call getValues(), we will only see the values added and NOT all +// attributes present on the server! +$result = $entry->add(array( + 'mail' => array('foo@example.org', 'test2@example.org'), + 'telephoneNumber' => '1234567890' +)); +if (Net_LDAP2::isError($result)) { + die('Unable to add attribute: '.$result->getMessage()); +} + +// Now we modify the first value +// Note, that we must give all old values, otherwise the attribute +// will be deleted. We specify the new absolute attribute state +$result = $entry->replace(array('mail' => array('test1@example.org', 'test2@example.org'))); +if (Net_LDAP2::isError($result)) { + die('Unable to modify attribute: '.$result->getMessage()); +} + +// And now we delete the second attribute value +// We must provide the old value, so the ldap server knows, +// which value we want to be deleted +$result = $entry->delete(array('mail' => 'test2@example.org')); +if (Net_LDAP2::isError($result)) { + die('Unable to delete attribute value: '.$result->getMessage()); +} + +// Finally, we delete the whole attribute 'telephoneNumber': +$result = $entry->delete('telephoneNumber'); +if (Net_LDAP2::isError($result)) { + die('Unable to delete attribute: '.$result->getMessage()); +} + +// Now it is time to transfer the changes to the ldap +// directory. However, for security reasons, this line is +// commented out. + +/* +$result = $entry->update(); +if (Net_LDAP2::isError($result)) { + die('Unable to update entry: '.$result->getMessage()); +} +*/ +?> \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/examples/modify_entry2.php
Added
@@ -0,0 +1,60 @@ +<?php +/** +* This is a short example on how to modify a specific entry in the +* directory using Net_LDAP2. +* The way described here is the more compact one but may be useful too. +* The diference is, that this way we use the $ldap object to modify +* the entry directly on the server. +*/ + +// We use the fetch_entry.php example to get the LDAP-Entry +// which we will modify now. +include_once 'fetch_entry.php'; + +// Okay, we should have a valid Net_LDAP2_Entry object that represents +// a real existing entry in our directory. + +// What we do now is to specify some actions that should be performed. +// Note, that the same rules as in the long version discussed in modify_entry.php +// aplly here too, so for replacing attributes, we must specify the absolute new state. +$changes = array( + 'add' => array( + 'mail' => array('foo@example.org', 'test2@example.org'), + 'telephoneNumber' => '1234567890' + ), + 'replace' => array( + 'mail' => array('test1@example.org', 'test2@example.org') + ), + + 'delete' => array( + 'mail' => 'test2@example.org', + 'telephoneNumber' => null // the null value is important here, since array + ) // mode (indexed, associative) is needed to be homogenous +); + +// Now it is time to transfer the changes to the ldap +// directory. However, for security reasons, these lines +// are commented out. +// You have two options to carry out the changes, with a small but often +// very important difference: +// The first call will carry out the actions in the order "add->delete->replace", +// while the latter will perform the changes in the order you define. +// (add->replace->delete, in our example) + + +/* +// METHOD 1: ORDER = add->delete->replace +$result = $ldap->modify($entry, $changes); +if (Net_LDAP2::isError($result)) { + die('Unable to update entry: '.$result->getMessage()); +} +*/ + +/* +// METHOD 2: ORDER = add->replace->delete +$result = $ldap->modify($entry, array('changes' => $changes)); +if (Net_LDAP2::isError($result)) { + die('Unable to update entry: '.$result->getMessage()); +} +*/ +?>
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/examples/schema_cache.php
Added
@@ -0,0 +1,163 @@ +<?php +/** +* This is a short example on how to use the schema cache facility. +* Schema caching allows you to store the fetched schema on disk +* (or wherever you want, depending on the cache class used) so +* initialisation of Net_LDAP2 becomes a little faster. +* +* Two examples will be showed here: +* 1. how to use the packaged file based cache +* 2. how to write a custom cache class +*/ + +// Class includes; this assumes Net_LDAP2 installed in PHPs include path +// or under subfolder "Net" in the local directory. +require_once 'Net/LDAP2.php'; + +// Configuration +// host can be a single server (string) or multiple ones - if we define more +// servers here (array), we can implement a basic fail over scenario. +// If no credentials (binddn and bindpw) are given, Net_LDAP2 establishes +// an anonymous bind. +// See the documentation for more information on the configuration items! +$ldap_config = array( +// 'host' => 'ldap.example.org', + 'host' => array('ldap1.example.org', 'ldap2.example.org'), +// 'binddn' => 'cn=admin,o=example,dc=org', +// 'bindpw' => 'your-secret-password', + 'tls' => false, + 'base' => 'o=example,dc=org', + 'port' => 389, + 'version' => 3, + 'filter' => '(cn=*)', + 'scope' => 'sub' +); + + +/* +* EXAMPLE 1: How to use the packaged file based cach +* This cache class stores the schema object on disk once Net_LDAP2 +* initially fetched it from the LDAP server. This will make Net_LDAP2 +* use the disk version instead of loading the schema from LDAP +* unless the schema object becomes too old. +*/ + +// Configuring the schema cacher +// see the source code of SimpleFileSchemaCache.php for config options +// An interesting idea is, to store the file in some tmpfs mount, which will +// result in storing the schema cache in memory instead of disk. +$mySchemaCache_cfg = array( + 'path' => '/tmp/Net_LDAP2_Schema.cache', // place to put cache file + 'max_age' => 86400 // max age is 24 hours (in seconds) +); + +// Initialize cache with the config +$mySchemaCache = new Net_LDAP2_SimpleFileSchemaCache($mySchemaCache_cfg); + +// As usual, connect to configured ldap server +$ldap = Net_LDAP2::connect($ldap_config); +if (Net_LDAP2::isError($ldap)) { + die('BIND FAILED: '.$ldap->getMessage()); +} + +// and finally register our initialized cache object +$res = $ldap->registerSchemaCache($mySchemaCache); +if (Net_LDAP2::isError($res)) { + die('REGISTER CACHE FAILED: '.$res->getMessage()); +} + +// Here we go, Net_LDAP2 will fetch the schema once and then use the disk version. + + + + + +/* +* EXAMPLE 2: How to write a custom cache class +* Writing a custom cache class is easy. You just have to wipe out a +* class that implements the SchemaCache interface. +* How a cache class must look like is documented in the interface +* definition file: SchemaCache.interface.php +* Here we will write a small hacky cache that stores the schema +* in the php session. This gives us a nice per-user cache that +* survives for the php session. This cache will obviously not +* be so performant as the SimpleFileSchemaCache but may be +* useful for other purposes. +*/ + +// Firstly, we need our custom schema class... +class MySessionSchemaCache implements Net_LDAP2_SchemaCache { + /** + * Initilize the cache + * + * Here we do nothing. You can use the class constructor for everything you + * want, but typically it is used to configure the caches config. + */ + public function MySessionSchemaCache () { + // nothing to see here, move along... + } + + /** + * Load schema from session + * + * For the sake of simplicity we dont implement a cache aging here. + * This is not a big problem, since php sessions shouldnt last endlessly. + * + * @return Net_LDAP2_Schema|Net_LDAP2_Error|false + */ + public function loadSchema() { + // Lets see if we have a session, otherwise we cant use this cache + // and drop some error that will be returned by Net_LDAP2->schema(). + // Minor errors should be indicated by returning false, so Net_LDAP2 + // can continue its work. This will result in the same behavior as + // no schema cache would have been registered. + if (!isset($_SESSION)) { + return new Net_LDAP2_Error(__CLASS__.": No PHP Session initialized.". + " This cache needs an open PHP session."); + } + + // Here the session is valid, so we return the stores schema. + // If we cant find the schema (because cahce is empty),w e return + // false to inidicate a minor error to Net_LDAP2. + // This causes it to fetch a fresh object from LDAP. + if (array_key_exists(__CLASS__, $_SESSION) + && $_SESSION[__CLASS__] instanceof Net_LDAP2_SchemaCache) { + return $_SESSION[__CLASS__]; + } else { + return false; + } + } + + /** + * Store the schema object in session + * + * @return true|Net_LDAP2_Error + */ + public function storeSchema($schema) { + // Just dump the given object into the session + // unless in loadSchema(), it is important to only return + // Net_LDAP2_Error objects if something crucial went wrong. + // If you feel that you want to return an error object, be sure + // that you have read the comments in Net_LDAP2_SchemaCache.interface.php + // or you will seriously hurt the performance of your application!!!! + $_SESSION[__CLASS__] = $schema; + return true; + } +} + + +// Ok, now we have our finished cache object. Now initialize and register it +// the usual way: +$mySchemaCache = new MySessionSchemaCache(); + +$ldap = Net_LDAP2::connect($ldap_config); +if (Net_LDAP2::isError($ldap)) { + die('BIND FAILED: '.$ldap->getMessage()); +} + +$res = $ldap->registerSchemaCache($mySchemaCache); +if (Net_LDAP2::isError($res)) { + die('REGISTER CACHE FAILED: '.$res->getMessage()); +} + +// Now, the Schema is cached in the PHP session :)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/examples/search_entries.php
Added
@@ -0,0 +1,78 @@ +<?php +/** +* This is a short example on how to search for entries in your +* directory using Net_LDAP2. +*/ + +// We use the connecting.php example to get a link to our server. +// This file will also include all required basic Net_LDAP2 classes. +include_once 'connecting.php'; + +// Okay, we should have a valid link now. +// We must now define a filter that defines, which +// entries we want to have returned. +// We use the Net_LDAP2_Filter class for this purpose, +// because so we don't need to worry about +// RFC-2254 ;) +// In this example, we want all users with first names +// starting with "bened" and the last names ending with "ger". +// Additionally, we want to exclude all users with names +// containing "smith", which will be done throug a "negation". + +// Basic filter building +$filter_sn = Net_LDAP2_Filter::create('gn', 'begins', 'bened'); +$filter_gn = Net_LDAP2_Filter::create('sn', 'ends', 'ger'); + +// Building and negating the "no smith" filter component +// this must be done in two steps, because +// you are able to negate EVERY filter, not just leave filters. +// the $filter_smith will not be used afterwards and is only +// necessary for negation here. +$filter_smith = Net_LDAP2_Filter::create('sn', 'contains','smith'); +$filter_nosmith = Net_LDAP2_Filter::combine('not', $filter_smith); + +// Now combine all filter components to build our search filter +$filter = Net_LDAP2_Filter::combine('and', array($filter_sn, $filter_gn, $filter_nosmith)); + + +// The filter is ready now, so we can +// use this filter now to search for entries. +// The scope we use is "sub", meaning "all entries below the search base". +// The base is "null", meaning the base defined in $ldap_config. This is similar +// to call $ldap->search($ldap_config['base'], ... +$requested_attributes = array('sn','gn','telephonenumber'); +$search = $ldap->search(null, $filter, array('attributes' => $requested_attributes)); +if (Net_LDAP2::isError($search)) { + die('LDAP search failed: '.$search->getMessage()); +} + +// Lets see what entries we got and print the names and telephone numbers: +if ($search->count() > 0) { + echo "Found ".$search->count().' entries:<br>'; + + // Note, this is is only one of several ways to fetch entries! + // You can also retrieve all entries in an array with + // $entries = $search->entries() + // or the same thing sorted: + // $entries = $search->sorted() + // Since Net_LDAP2 you can also use a foreach loop: + // foreach ($search as $dn => $entry) { + while ($entry = $search->shiftEntry()) { + $surename = $entry->getValue('sn', 'single'); + if (Net_LDAP2::isError($surename)) { + die('Unable to get surename: '.$surename->getMessage()); + } + $givenname = $entry->getValue('gn', 'single'); + if (Net_LDAP2::isError($givenname)) { + die('Unable to get givenname: '.$givenname->getMessage()); + } + $phone = $entry->getValue('telephonenumber', 'single'); + if (Net_LDAP2::isError($phone)) { + die('Unable to get phone number: '.$phone->getMessage()); + } + echo "<br>$givenname $surename: $phone"; + } +} else { + die('Sorry, no entries found!'); +} +?>
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/manual.html
Added
@@ -0,0 +1,248 @@ +<html> +<head> + <title>Net_LDAP2 Manual</title> + <style type="text/css"> + pre { border: 1px solid #000000; background-color:#EBEBEB; padding:5px; } + </style> +</head> +<body> +<h1>Net_LDAP2 Manual</h1> +Welcome to the Net_LDAP2 user manual! here you have a quick introduction on +how to use Net_LDAP2 to acces your directory server with php. +<p><font color="red">Note that this manual is only a brief introduction and also may be outdated. +The official manual is available at the <a href="http://pear.php.net/package/Net_LDAP2/docs">PEAR project website.</a> +The reason this manual remains here is, that it may be useful in cases you don't have internet +acces at the moment.</font></p> + +<h2>First step: Connect</h2> +<p> +To do this, use the Net_LDAP2::connect function like this: + +<p><pre> +require_once('Net_LDAP22/LDAP2.php'); + +$config = array ( + 'binddn' => 'uid=tarjei,dc=php,dc=net', + 'bindpw' => 'secret', + 'basedn' => dc=php,dc=net + ); + +$ldap = Net_LDAP2::connect($config); +</pre></p> +</p> +<p> +But what are valid values in the config array? +<ul>Here's a quick table: (defaults) + <li><b>binddn</b> = the DN to bind as. (none)</li> + <li><b>bindpw</b> = Password of the user specified by 'binddn' (none)</li> + <li><b>host</b> = the ldap host to connect to (localhost)</li> + <li><b>base</b> = ldap base, this is usually the Entry point of your directory (none)</li> + <li><b>port</b> = the server port (389)</li> + <li><b>starttls</b> = when set, ldap_start_tls() is run after connecting. (false)</li> + <li><b>version</b> = ldap version (defaults to v 3) </li> + <li><b>filter</b> = default search filter (objectclass=*)</li> + <li><b>scope</b> = default search scope (sub)</li> +</ul> +We'll get back to these later. +</p> + + + +<h2>Errorhandling</h2> +<p> +Now you should have the base ldapobject stored in the variable "$ldap". +But, what if it is an error? Net_LDAP2 returns a Net_LDAP2_error object (basicly a +pear_error object) when an error occurs. So wherever you need to check an error, do like this: +<p><pre> +$ldap = Net_LDAP2::connect($config); // copied from above! + +if (Net_LDAP2::isError($ldap)) { + print $ldap->getMessage(); // this will tell you what went wrong! +} + +</pre></p> +</p> +<p> +Two things to note: + +<br>1) The function is_a() might be faster: +<p><pre> +if (is_a($ldap,'net_ldap_error')) { +// do the same as above +} +</pre></p> +In PHP5 you must use the instanceof operator instead of is_a(). + +<br>2) Net_LDAP2_Error can also return an errornumber. These numbers are standardized. A good description of what they mean is found there: +http://www.directory-info.com/LDAP2/LDAPErrorCodes.html +</p> + + + +<h2>Searching (basics)</h2> +<p> +Most of the work you do on an ldapserver is in searching, +for example, you search for your boss's password or his wife's phonenumber. +<br>Searching an ldapserver is a bit like doing SQL and a lot not like it at all.</br> +Think of the directory as some sort of "telephone book". +Basically, searches are performed by applying a "filter" to objects under a +specific "base" in the directory. Additionally, there is a "scope" applied to the search, +so you can specify the recursion level in the directory tree. +</p> +<p> +<h3>Base:</h3> +The "base" is the point under the directory where you want to search under. +To search for all people under php.net, you may use: "ou=People,dc=php,dc=net". +But if you want just to search the devs, you can use "ou=dev,ou=People,dc=php,dc=net". +</p> +<p> +<h3>Filter:</h3> Filters define what you are looking for. They "filter out" unwanted entries. +<br>Filters start with a ( and end with a ). There is a lot to be said about filters, most is better said by examples: + +<br><br><b>(&(objectclass=posixAccount)(uid=boss)) :</b> The object has to satisfy both filters. +I.e. an object that is both boss and an posixAccount. If you had another object +with uid=boss but that wasn't an postixaccount it would be excluded. +<br><b>(|(uid=boss)(uid=secretary)) :</b> Either the boss or the secretary. +Note that both logical operators are placed before the filters not between the +two conditions as you might used to from sql. +<br><b>(&(objectclass=posixAccount)(|(uid=boss)(uid=secretary))) :</b> +Here they must have the posixAccount objectclass as well. + +<b>(objectclass=*) :</b> All objects must have an objectclass, so this is the simplest way of saying everything. + +<b>(uid=t*) :</b> With the right indexes on the server, you may search the substring of an attriute. Here; all users with the first name beginning with a "T". + +<br>Please note, that Net_LDAP2 provides a filter class for simplier generation and combination of filters. +You should use that class unless you know how filters work. This will save you a lot of trouble, +since there are some encoding issues with ldap-filters. If you want to provide the filter yourself, +you should also have a look to <a href="http://www.ietf.org/rfc/rfc1558.txt">RFC #1558</a> defining LDAP-Filters. +</p> + +<p> +<h3>Searchscope</h3> +The scope of an search may be three things: +<ul> + <li><b>'base'</b> = Just the entry in question.</li> + <li><b>'sub'</b> = All subentries.</li> + <li><b>'one'</b> = All entries just below the searchbase.</li> +</ul> + +Searching with scope 'base' may be handy for getting just one entry. But then again, that's what the getEntry function does. +</p> + +<p> +<h3>Searching some entries</h3> +We know now, how to search, so we will test out our new knowledge. +We want to search all person entries whose second name starts with "Ha", but only developers. +Later we want to know the name and the telephone number of the persons. +<pre> +$filter = '(&(objectclass=person)(sn=Ha*))'; +$searchbase = 'ou=dev,ou=People,dc=php,dc=net'; +$options = array( + 'scope' => 'sub', // all entries below the searchbase (recursive all subtrees from there) + 'attributes' => array('sn','gn','telephonenumber') // what attributes to select + ); +$search = $ldap->search($searchbase, $filter, $options); +</pre> +$search should now be an Net_LDAP2_Search object. +<br>Okay, now we assume that everything was fine (in production, test for error!). +We have several options now. +We can fetch the found entries at once sorted ($search->sorted()) or unsorted ($search->entries()), or we can read +the objects one by one inside a loop using $search->shiftEntry(). See the class documentation of Net_LDAP2_Search +for more details. +</p> + +<h2>Entries</h2> +<p> +This describes how to get an entry and modifying it. +If we just want one single entry, it may be useful to directly fetch that entry instead +of searching it manually. To do this you can use Net_LDAP2s "getEntry()" method: +<pre> +$dn = 'cn=Foo Bar,ou=dev,ou=People,dc=php,dc=net'; +$entry = $ldap->getEntry($dn, array('sn','gn','telephonenumber')); +</pre> +</p> +With this entry object you now can perform some actions like fetching the contents of attributes: +<pre> +$telephonenumber = $entry->getValue('telephonenumber','single'); +</pre> +Or you can modify a attribute: +<pre> +$entry->replace("telephonenumber" => "0123456789"); // replace the attributes values with the new number +$entry->update(); // update temporarily modified entry on the server +</pre> +Of course there are much more other possibilitys. Please note that adding and deleting +whole entrys is performed through the Net_LDAP2 class and not with the Net_LDAP2_Entry class. + +<h2>Schemas</h2> +You may also use Net_LDAP2 to find out what schemas your ldap-server supports. Here's an example of how: +<pre> +$schema = $ldap->schema(); +</pre> +Now you got a schemaobject. +To read from this schemaobject, you have several methods defined in the class Net_LDAP2_Schema. +<br>For example, to find out which attributes are required for inetOrgPerson, you do this: +<pre> +$required = $schema->must( 'inetOrgUser' ); + +print_r($required); +/* The output of this will be: +Array +( + [0] => sn + [1] => cn +) +*/ +</pre> + +Ok, but what kind of attribute is sn? Let's check: +<pre>
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/doc/utf8.txt
Added
@@ -0,0 +1,20 @@ +UTF8 and Net_LDAP2: + +It is hard to know exactly what entries need utf8 every time you need them, +so here's the simple way to salvation: + +Net_LDAP2 will check internally if utf8 is needed. + +Code: + // $attr is some text a user entered with funny characters in it. + // If $attr should not be utfized (f.x. userPassword) then utf8Encode + // will not encode the attribute. + $attr = $ldap->utf8Encode($attr); + // now insert the correctly encoded attribute into the directory. + $entry->modify($attr); + + // later when you access the attributes of that user, decode the ones + // that have to be decoded. + $attr = $ldap->utf8Decode( $entry->attributes() ); + +Thanks to Jan for the code.
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/package.xml
Added
@@ -0,0 +1,862 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package packagerversion="1.4.11" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 +http://pear.php.net/dtd/tasks-1.0.xsd +http://pear.php.net/dtd/package-2.0 +http://pear.php.net/dtd/package-2.0.xsd"> + <name>Net_LDAP2</name> + <channel>pear.php.net</channel> + <extends>Net_LDAP</extends> + <summary>Object oriented interface for searching and manipulating LDAP-entries</summary> + <description>Net_LDAP2 is the successor of Net_LDAP which is a clone of Perls Net::LDAP + object interface to directory servers. It does contain most of Net::LDAPs + features but has some own too. + With Net_LDAP2 you have: + * A simple object-oriented interface to connections, searches entries and filters. + * Support for TLS and LDAP v3. + * Simple modification, deletion and creation of LDAP entries. + * Support for schema handling. + + Net_LDAP2 layers itself on top of PHP's existing ldap extensions. + </description> + <lead> + <name>Benedikt Hallinger</name> + <user>beni</user> + <email>beni@php.net</email> + <active>yes</active> + </lead> + + <!-- Information for this release --> + <date>2015-10-30</date> + <version> + <release>2.2.0</release> + <api>2.2.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license>LGPLv3 License</license> + <notes> + * Fix bug #20969: Fatal error with PEAR 1.10.0 / constructor visiblity + * Add support for PHP 7 + * Improve unit tests + </notes> + <contents> + <dir name="/"> + <dir name="Net"> + <file name="LDAP2.php" role="php" /> + <dir name="LDAP2"> + <file name="Entry.php" role="php" /> + <file name="Filter.php" role="php" /> + <file name="RootDSE.php" role="php" /> + <file name="Schema.php" role="php" /> + <file name="Search.php" role="php" /> + <file name="Util.php" role="php" /> + <file name="LDIF.php" role="php" /> + <file name="SchemaCache.interface.php" role="php" /> + <file name="SimpleFileSchemaCache.php" role="php" /> + </dir> <!-- /LDAP2 --> + </dir> <!-- /Net --> + <dir name="doc"> + <file name="manual.html" role="doc" /> + <file name="README.txt" role="doc" /> + <file name="RootDSE.txt" role="doc" /> + <file name="Schema.txt" role="doc" /> + <file name="utf8.txt" role="doc" /> + <file name="examples/connecting.php" role="doc" /> + <file name="examples/fetch_entry.php" role="doc" /> + <file name="examples/search_entries.php" role="doc" /> + <file name="examples/add_entry.php" role="doc" /> + <file name="examples/modify_entry.php" role="doc" /> + <file name="examples/modify_entry2.php" role="doc" /> + <file name="examples/schema_cache.php" role="doc" /> + </dir> <!-- /doc --> + <dir name="tests"> + <file name="phpunit.xml" role="test" /> + <file name="Net_LDAP2_TestBase.php" role="test" /> + <file name="Net_LDAP2_EntryTest.php" role="test" /> + <file name="Net_LDAP2_FilterTest.php" role="test" /> + <file name="Net_LDAP2_RootDSETest.php" role="test" /> + <file name="Net_LDAP2_SearchTest.php" role="test" /> + <file name="Net_LDAP2Test.php" role="test" /> + <file name="Net_LDAP2_UtilTest.php" role="test" /> + <file name="Net_LDAP2_LDIFTest.php" role="test" /> + <file name="ldapconfig.ini.dist" role="test" /> + <file name="ldapldifconfig.ini.dist" role="test" /> + <file name="ldif_data/base.ldif" role="test" /> + <file name="ldif_data/malformed_syntax.ldif" role="test" /> + <file name="ldif_data/malformed_syntax.ldif" role="test" /> + <file name="ldif_data/malformed_wrapping.ldif" role="test" /> + <file name="ldif_data/slapd.conf" role="test" /> + <file name="ldif_data/sorted_w40.ldif" role="test" /> + <file name="ldif_data/sorted_w50.ldif" role="test" /> + <file name="ldif_data/unsorted_w30.ldif" role="test" /> + <file name="ldif_data/unsorted_w50.ldif" role="test" /> + <file name="ldif_data/unsorted_w50_WIN.ldif" role="test" /> + <file name="ldif_data/changes.ldif" role="test" /> + </dir> <!-- /tests --> + </dir> <!-- / --> + </contents> + <dependencies> + <required> + <php> + <min>5.4</min> + </php> + <pearinstaller> + <min>1.10.1</min> + </pearinstaller> + <extension> + <name>ldap</name> + </extension> + </required> + </dependencies> + <phprelease /> + + <!-- CHANGELOG --> + <changelog> + <release> + <version> + <release>0.1</release> + <api>0.1</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <date>2003-06-23</date> + <license>LGPL License</license> + <notes>Initial release + </notes> + </release> + <release> + <version> + <release>0.2</release> + <api>0.2</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <date>2003-08-23</date> + <license>LGPL License</license> + <notes>Fixed a lot of bugs that jumped in during the pearification process + </notes> + </release> + <release> + <version> + <release>0.3</release> + <api>0.3</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <date>2003-09-21</date> + <license>LGPL License</license> + <notes>More bug squashing! Much better errorhandling in the ->search() function. + Also, all errors that create a Pear_error now includes the errornumber if + appropriate (i.e. it was an ldap generated error). + </notes> + </release> + <release> + <version> + <release>0.4</release> + <api>0.4</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <date>2003-10-01</date> + <license>LGPL License</license> + <notes>Many more bugfixes. Jan Wagner fixed the shift_entry function. + Also a new Net_LDAP_Entry::modify function has been added that goes far making a simple way to modify entries. + </notes> + </release> + <release> + <version> + <release>0.5</release> + <api>0.5</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <date>2003-10-11</date> + <license>LGPL License</license> + <notes>Jan Wagner Contributed a new RootDSE object and a Schema object and some fixes to the Net_LDAP::search() method + The new Net_ldap_entry::modify() method seems to work very nice now. + </notes> + </release> + <release> + <version> + <release>0.6</release> + <api>0.6</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability>
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/HOWTO_SETUP_OPENLDAP_TESTCASE.txt
Added
@@ -0,0 +1,64 @@ ++----------------------------------------+ +| Howto for a OpenLDAP based test server | ++----------------------------------------+ + + +PREFACE +======= + +This file describes briefly, how you can set up an OpenLDAP-based +test server where you can run the tests on. +The test cases and ini-files match this guide, so after following it, +you can readily start to run all tests out of the box. + + /!\ DO NOT DO THIS ON A PRODUCTION MACHINE OR /!\ + /!\ ONE CONNECTED TO THE INTERNET /!\ + +If you already have a test server in place, then: + - You don't need to install or configure OpenLDAP + - Adjust the DN in Net_LDAP2/trunk/tests/ldif_data/INITIAL_TESTDATA.ldif + to match your tree + - Adjust your ldapconfig.ini to match your servers setup + + + + +THE GUIDE +========= + +0. PHP, phpunit +Of course you will need this to run the tests... + + +1. Install and configure OpenLDAP +Config: + - base: dc=example,dc=com + - admin: admin (will map to cn=admin,dc=example,dc=com) + - admin-password: test + +Needed schemas: core, inetorgperson +Note that the core schema is usually already present and you have good chances +that the inetorgperson one is there too. +You can apply the schema ldifs after the initial install of openldap with ldapadd: + Net_LDAP2/trunk/tests$ ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif + +A note for debian users: +Since some recent version the installer does not ask for the baseDN anymore. +Before using apt to install, you may need to manipulate the /etc/hosts, so the +command `dnsdomainname` will return 'example.com'. Then just do `apt-get install slapd`. +The other solution is to adjust all ldif files here and also the test case php scripts. + + +2. Import basic Net_LDAP2 test data +Net_LDAP2 provides an basic LDIF file that maps to the test cases initial config: + Net_LDAP2/trunk/tests$ ldapadd -D cn=admin,dc=example,dc=com -W -H ldapi:/// -f ldif_data/INITIAL_TESTDATA.ldif + + +3. configure test suite +Copy the default config to a real one: + Net_LDAP2/trunk/tests$ cp ldapconfig.ini.dist ldapconfig.ini + + +4. run the tests + - all tests: Net_LDAP2/trunk/tests$ phpunit AllTests.php + - a specific test: Net_LDAP2/trunk/tests$ phpunit Net_LDAP2_UtilTest.php
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/Net_LDAP2Test.php
Added
@@ -0,0 +1,896 @@ +<?php +require_once __DIR__ . '/Net_LDAP2_TestBase.php'; +require_once 'Net/LDAP2.php'; +require_once 'Net/LDAP2/Entry.php'; + +/** + * Test class for Net_LDAP2. + * Generated by PHPUnit_Util_Skeleton on 2007-10-09 at 10:32:36. + */ +class Net_LDAP2Test extends Net_LDAP2_TestBase { + /** + * Stores the LDAP configuration + */ + var $ldapcfg = false; + + /** + * Load ldap config and adjust appropriately + * + * @access protected + */ + protected function setUp() { + $this->ldapcfg = $this->getTestConfig(); + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + * + * @access protected + */ + protected function tearDown() { + } + + /** + * This checks if a valid LDAP testconfig is present and loads it. + * + * If so, it is loaded and returned as array. If not, false is returned. + * + * @return false|array + */ + public function getTestConfig() { + $config = false; + $file = dirname(__FILE__).'/ldapconfig.ini'; + if (file_exists($file) && is_readable($file)) { + $config = parse_ini_file($file, true); + } else { + return false; + } + // validate ini + $v_error = $file.' is probably invalid. Did you quoted values correctly?'; + $this->assertTrue(array_key_exists('global', $config), $v_error); + $this->assertTrue(array_key_exists('test', $config), $v_error); + $this->assertEquals(7, count($config['global']), $v_error); + $this->assertEquals(7, count($config['test']), $v_error); + + // reformat things a bit, for convinience + $config['global']['server_binddn'] = + $config['global']['server_binddn'].','.$config['global']['server_base_dn']; + $config['test']['existing_attrmv'] = explode('|', $config['test']['existing_attrmv']); + return $config; + } + + /** + * Establishes a working connection + * + * @return Net_LDAP2 + */ + public function &connect() { + // Check extension + if (true !== Net_LDAP2::checkLDAPExtension()) { + $this->markTestSkipped('PHP LDAP extension not found or not loadable. Skipped Test.'); + } + + // Simple working connect and privilegued bind + $lcfg = array( + 'host' => $this->ldapcfg['global']['server_address'], + 'port' => $this->ldapcfg['global']['server_port'], + 'basedn' => $this->ldapcfg['global']['server_base_dn'], + 'binddn' => $this->ldapcfg['global']['server_binddn'], + 'bindpw' => $this->ldapcfg['global']['server_bindpw'], + 'filter' => '(ou=*)', + ); + $ldap = Net_LDAP2::connect($lcfg); + $this->assertInstanceOf('Net_LDAP2', $ldap, 'Connect failed but was supposed to work. Check credentials and host address. If those are correct, file a bug!'); + return $ldap; + } + +/* ---------- TESTS ---------- */ + + /** + * testCheckLDAPExtension(). + * + * @todo can we unload modules at runtime?? + */ + public function testCheckLDAPExtension() { + if (extension_loaded('ldap')) { + // If extension is already loaded, then we must get true. + $this->assertTrue(Net_LDAP2::checkLDAPExtension()); + } else { + // If not, we should be able to load it - but may fail + $this->assertThat(Net_LDAP2::checkLDAPExtension(), + $this->logicalOr($this->isInstanceOf('Net_LDAP2_Error'), $this->equalTo(true))); + } + } + + /** + * Tests if getVersion() works correctly + */ + public function testGetVersion() { + $this->assertTrue(defined('NET_LDAP2_VERSION')); + $this->assertEquals(NET_LDAP2_VERSION, Net_LDAP2::getVersion()); + } + + /** + * Tests if the server can connect and bind correctly + */ + public function testConnectAndPrivileguedBind() { + // Check extension + if (true !== Net_LDAP2::checkLDAPExtension()) { + $this->markTestSkipped('PHP LDAP extension not found or not loadable. Skipped Test.'); + } + + if (!$this->ldapcfg) { + $this->markTestSkipped('No ldapconfig.ini found. Skipping test!'); + } else { + // This connect is supposed to fail + $lcfg = array( + 'host' => '0.0.0.1', + ); + $ldap = Net_LDAP2::connect($lcfg); + $this->assertInstanceOf('Net_LDAP2_Error', $ldap, 'Connect succeeded but was supposed to fail!'); + + // Failing with multiple hosts + $lcfg = array( + 'host' => array('0.0.0.1', '0.0.0.2'), + ); + $ldap = Net_LDAP2::connect($lcfg); + $this->assertInstanceOf('Net_LDAP2_Error', $ldap, 'Connect succeeded but was supposed to fail!'); + + // Simple working connect and privilegued bind + $ldap = $this->connect(); + + // Working connect and privilegued bind with first host down + $lcfg = array( + 'host' => array( + '0.0.0.1', + $this->ldapcfg['global']['server_address'] + ), + 'port' => $this->ldapcfg['global']['server_port'], + 'binddn' => $this->ldapcfg['global']['server_binddn'], + 'bindpw' => $this->ldapcfg['global']['server_bindpw'], + ); + $ldap = Net_LDAP2::connect($lcfg); + $this->assertInstanceOf('Net_LDAP2', $ldap, 'Connect failed but was supposed to work. Check credentials and host address. If those are correct, file a bug!'); + } + } + + /** + * Tests if the server can connect and bind anonymously, if supported (->cfg and ldap mode) + */ + public function testConnectAndAnonymousBind() { + // Check extension + if (true !== Net_LDAP2::checkLDAPExtension()) { + $this->markTestSkipped('PHP LDAP extension not found or not loadable. Skipped Test.'); + } + + if (!$this->ldapcfg) { + $this->markTestSkipped('No ldapconfig.ini found. Skipping test!'); + } elseif ($this->ldapcfg['global']['server_cap_anonymous'] == true) { + // Simple working connect and anonymous bind + $lcfg = array( + 'host' => $this->ldapcfg['global']['server_address'], + 'port' => $this->ldapcfg['global']['server_port'], + ); + $ldap = Net_LDAP2::connect($lcfg); + $this->assertInstanceOf('Net_LDAP2', $ldap, 'Connect failed but was supposed to work. Check address and if server supports anonymous bind. If those are correct, file a bug!'); + } else { + $this->markTestSkipped('Server does not support anonymous bind (see ldapconfig.ini). Skipping test.'); + } + } + + /** + * testStartTLS() if server supports it + */ + public function testStartTLS() { + // Check extension + if (true !== Net_LDAP2::checkLDAPExtension()) { + $this->markTestSkipped('PHP LDAP extension not found or not loadable. Skipped Test.'); + } + + if (!$this->ldapcfg) { + $this->markTestSkipped('No ldapconfig.ini found. Skipping test!'); + } elseif ($this->ldapcfg['global']['server_cap_tls'] == true) { + // Simple working connect and privilegued bind + $lcfg = array( + 'host' => $this->ldapcfg['global']['server_address'], + 'port' => $this->ldapcfg['global']['server_port'], + 'binddn' => $this->ldapcfg['global']['server_binddn'].','.$this->ldapcfg['global']['server_binddn'], + 'bindpw' => $this->ldapcfg['global']['server_bindpw'],
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/Net_LDAP2_EntryTest.php
Added
@@ -0,0 +1,320 @@ +<?php +require_once 'Net_LDAP2Test.php'; // for config methods +require_once __DIR__ . '/Net_LDAP2_TestBase.php'; + +require_once 'Net/LDAP2/Entry.php'; +require_once 'Net/LDAP2/Entry.php'; + +/** + * Test class for Net_LDAP2_Entry. + * Generated by PHPUnit_Util_Skeleton on 2007-10-09 at 10:33:12. + */ +class Net_LDAP2_EntryTest extends Net_LDAP2_TestBase { + /** + * Stores the LDAP configuration + */ + var $ldapcfg = false; + + /** + * Runs the test methods of this class. + * + * @access public + * @static + */ + public static function main() { + require_once "PHPUnit/TextUI/TestRunner.php"; + + $suite = new PHPUnit_Framework_TestSuite("Net_LDAP2_EntryTest"); + $result = PHPUnit_TextUI_TestRunner::run($suite); + } + + /** + * Sets up the fixture, for example, open a network connection. + * This method is called before a test is executed. + * + * @access protected + */ + protected function setUp() { + $this->ldapcfg = $this->getTestConfig(); + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + * + * @access protected + */ + protected function tearDown() { + } + + /** + * This checks if a valid LDAP testconfig is present and loads it. + * + * If so, it is loaded and returned as array. If not, false is returned. + * + * @return false|array + */ + public function getTestConfig() { + $config = false; + $file = dirname(__FILE__).'/ldapconfig.ini'; + if (file_exists($file) && is_readable($file)) { + $config = parse_ini_file($file, true); + } else { + return false; + } + // validate ini + $v_error = $file.' is probably invalid. Did you quoted values correctly?'; + $this->assertTrue(array_key_exists('global', $config), $v_error); + $this->assertTrue(array_key_exists('test', $config), $v_error); + $this->assertEquals(7, count($config['global']), $v_error); + $this->assertEquals(7, count($config['test']), $v_error); + + // reformat things a bit, for convinience + $config['global']['server_binddn'] = + $config['global']['server_binddn'].','.$config['global']['server_base_dn']; + $config['test']['existing_attrmv'] = explode('|', $config['test']['existing_attrmv']); + return $config; + } + + /** + * Establishes a working connection + * + * @return Net_LDAP2 + */ + public function &connect() { + // Check extension + if (true !== Net_LDAP2::checkLDAPExtension()) { + $this->markTestSkipped('PHP LDAP extension not found or not loadable. Skipped Test.'); + } + + // Simple working connect and privilegued bind + $lcfg = array( + 'host' => $this->ldapcfg['global']['server_address'], + 'port' => $this->ldapcfg['global']['server_port'], + 'basedn' => $this->ldapcfg['global']['server_base_dn'], + 'binddn' => $this->ldapcfg['global']['server_binddn'], + 'bindpw' => $this->ldapcfg['global']['server_bindpw'], + 'filter' => '(ou=*)', + ); + $ldap = Net_LDAP2::connect($lcfg); + $this->assertInstanceOf('Net_LDAP2', $ldap, 'Connect failed but was supposed to work. Check credentials and host address. If those are correct, file a bug!'); + return $ldap; + } + +/* ---------- TESTS ---------- */ + + /** + * @todo Implement testCreateFresh(). + */ + public function testCreateFresh() { + // test failing creation + $t = Net_LDAP2_Entry::createFresh("cn=test", "I should be an array"); + $this->assertTrue(Net_LDAP2::isError($t), 'Creating fresh entry succeeded but was supposed to fail!'); + + // test failing creation + $t = Net_LDAP2_Entry::createFresh("cn=test", + array( + 'attr1' => 'single', + 'attr2' => array('mv1', 'mv2') + ) + ); + $this->assertInstanceOf('Net_LDAP2_Entry', $t, 'Creating fresh entry failed but was supposed to succeed!'); + } + + /** + * @todo Implement testCreateExisting(). + */ + public function testCreateExisting() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * Test currentDN and API of move + */ + public function testCurrentDN() { + $entry = Net_LDAP2_Entry::createFresh('cn=footest,ou=example,dc=com', array('cn' => 'foo')); + + // test initial state + $this->assertEquals($entry->dn(), $entry->currentDN()); // equal DNs + $this->assertFalse($entry->willBeMoved()); + + // prepare move + $entry->dn('cn=newDN,ou=example,dc=com'); + + // test again + $this->assertNotEquals($entry->dn(), $entry->currentDN()); // equal DNs + $this->assertTrue($entry->willBeMoved()); + } + + /** + * @todo Implement testDn(). + */ + public function testDn() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement test_setAttributes(). + */ + public function test_setAttributes() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testGetValues(). + */ + public function testGetValues() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testGetValue(). + */ + public function testGetValue() { + // make up some local entry + $entry = Net_LDAP2_Entry::createFresh("cn=test", + array( + 'attr1' => 'single', + 'attr2' => array('mv1', 'mv2') + ) + ); + + // test default behavior + $this->assertEquals('single', $entry->getValue('attr1')); + $this->assertEquals(array('mv1', 'mv2'), $entry->getValue('attr2')); + $this->assertEquals(false, $entry->getValue('nonexistent')); + + // test option "single"
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/Net_LDAP2_FilterTest.php
Added
@@ -0,0 +1,506 @@ +<?php +require_once __DIR__ . '/Net_LDAP2_TestBase.php'; +require_once 'Net/LDAP2/Filter.php'; + +/** + * Test class for Net_LDAP2_Filter. + * Generated by PHPUnit_Util_Skeleton on 2007-10-09 at 10:34:23. + */ +class Net_LDAP2_FilterTest extends Net_LDAP2_TestBase { + /** + * @var string default filter string to test with + */ + var $filter_str = '(&(cn=foo)(ou=bar))'; + + /** + * Runs the test methods of this class. + * + * @access public + * @static + */ + public static function main() { + require_once "PHPUnit/TextUI/TestRunner.php"; + + $suite = new PHPUnit_Framework_TestSuite("Net_LDAP2_FilterTest"); + $result = PHPUnit_TextUI_TestRunner::run($suite); + } + + /** + * Sets up the fixture, for example, open a network connection. + * This method is called before a test is executed. + * + * @access protected + */ + protected function setUp() { + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + * + * @access protected + */ + protected function tearDown() { + } + + /** + * This tests the perl compatible creation of filters through parsing of an filter string + */ + public function testCreatePerlCompatible() { + $filter_o = new Net_LDAP2_Filter($this->filter_str); + $this->assertInstanceOf('Net_LDAP2_Filter', $filter_o); + $this->assertEquals($this->filter_str, $filter_o->asString()); + + $filter_o_err = new Net_LDAP2_Filter('some bad filter'); + $this->assertInstanceOf('PEAR_Error', $filter_o_err->asString()); + } + + /** + * Test correct parsing of filter strings through parse() + */ + public function testParse() { + $parsed_dmg = Net_LDAP2_Filter::parse('some_damaged_filter_str'); + $this->assertInstanceOf('PEAR_Error', $parsed_dmg); + + $parsed_dmg2 = Net_LDAP2_Filter::parse('(invalid=filter)(because=~no-surrounding brackets)'); + $this->assertInstanceOf('PEAR_Error', $parsed_dmg2); + + $parsed_dmg3 = Net_LDAP2_Filter::parse('((invalid=filter)(because=log_op is missing))'); + $this->assertInstanceOf('PEAR_Error', $parsed_dmg3); + + $parsed_dmg4 = Net_LDAP2_Filter::parse('(invalid-because-becauseinvalidoperator)'); + $this->assertInstanceOf('PEAR_Error', $parsed_dmg4); + + $parsed_dmg5 = Net_LDAP2_Filter::parse('(&(filterpart>=ok)(part2=~ok)(filterpart3_notok---becauseinvalidoperator))'); + $this->assertInstanceOf('PEAR_Error', $parsed_dmg5); + + // To verify bug #19364 is fixed + $parsed_dmg6 = Net_LDAP2_Filter::parse('(|((invalid-because-too-many-open-parens=x)(a=c))'); + $this->assertInstanceOf('PEAR_Error', $parsed_dmg6); + $parsed_dmg7 = Net_LDAP2_Filter::parse('(|(invalid-because-too-many-close-parens=x)(a=c)))'); + $this->assertInstanceOf('PEAR_Error', $parsed_dmg7); + + $parsed1 = Net_LDAP2_Filter::parse($this->filter_str); + $this->assertInstanceOf('Net_LDAP2_Filter', $parsed1); + $this->assertEquals($this->filter_str, $parsed1->asString()); + + // To verify bug #16738 is fixed. + // In 2.0.6 there was a problem with the splitting of the filter parts if the next part was also an combined filter + $parsed2_str = "(&(&(objectClass=posixgroup)(objectClass=foogroup))(uniquemember=uid=eeggs,ou=people,o=foo))"; + $parsed2 = Net_LDAP2_Filter::parse($parsed2_str); + $this->assertInstanceOf('Net_LDAP2_Filter', $parsed2); + $this->assertEquals($parsed2_str, $parsed2->asString()); + + // To verify bug #17057 is fixed + // In 2.0.7 there was a problem parsing certain not-combined filter strings. + $parsed3_str = "(!(jpegPhoto=*))"; + $parsed3 = Net_LDAP2_Filter::parse($parsed3_str); + $this->assertInstanceOf('Net_LDAP2_Filter', $parsed3); + $this->assertEquals($parsed3_str, $parsed3->asString()); + + $parsed3_complex_str = "(&(someAttr=someValue)(!(jpegPhoto=*)))"; + $parsed3_complex = Net_LDAP2_Filter::parse($parsed3_complex_str); + $this->assertInstanceOf('Net_LDAP2_Filter', $parsed3_complex); + $this->assertEquals($parsed3_complex_str, $parsed3_complex->asString()); + + } + + + /** + * This tests the basic create() method of creating filters + */ + public function testCreate() { + // Test values and an array containing the filter + // creating methods and an regex to test the resulting filter + $testattr = 'testattr'; + $testval = 'testval'; + $combinations = array( + 'equals' => "/\($testattr=$testval\)/", + 'equals' => "/\($testattr=$testval\)/", + 'begins' => "/\($testattr=$testval\*\)/", + 'ends' => "/\($testattr=\*$testval\)/", + 'contains' => "/\($testattr=\*$testval\*\)/", + 'greater' => "/\($testattr>$testval\)/", + 'less' => "/\($testattr<$testval\)/", + 'greaterorequal' => "/\($testattr>=$testval\)/", + 'lessorequal' => "/\($testattr<=$testval\)/", + 'approx' => "/\($testattr~=$testval\)/", + 'any' => "/\($testattr=\*\)/" + ); + // generate negating tests with supported operator combinations + foreach ($combinations as $match => $regex) { + $regex = preg_replace('#^/|/$#', '', $regex); // treat regex, so we can extend it easily + $combinations['not '.$match] = "/\(!$regex\)/"; + $combinations['not_'.$match] = "/\(!$regex\)/"; + $combinations['not-'.$match] = "/\(!$regex\)/"; + $combinations['! '.$match] = "/\(!$regex\)/"; + $combinations['!_'.$match] = "/\(!$regex\)/"; + $combinations['!-'.$match] = "/\(!$regex\)/"; + } + + // perform tests + foreach ($combinations as $match => $regex) { + // escaping is tested in util class + $filter = Net_LDAP2_Filter::create($testattr, $match, $testval, false); + + $this->assertInstanceOf('Net_LDAP2_Filter', $filter); + $this->assertRegExp($regex, $filter->asString(), "Filter generation failed for MatchType: $match"); + } + + // test creating failure + $filter = Net_LDAP2_Filter::create($testattr, 'test_undefined_matchingrule', $testval); + $this->assertInstanceOf('PEAR_Error', $filter); + } + + /** + * Tests, if asString() works + */ + public function testAsString() { + $filter = Net_LDAP2_Filter::create('foo', 'equals', 'bar'); + $this->assertInstanceOf('Net_LDAP2_Filter', $filter); + $this->assertEquals('(foo=bar)', $filter->asString()); + $this->assertEquals('(foo=bar)', $filter->as_string()); + } + + /** + * Tests, if printMe() works + */ + public function testPrintMe() { + if (substr(strtolower(PHP_OS), 0,3) == 'win') { + $testfile = '/tmp/Net_LDAP2_Filter_printMe-Testfile'; + } else { + $testfile = 'c:\Net_LDAP2_Filter_printMe-Testfile'; + } + $filter = Net_LDAP2_Filter::create('testPrintMe', 'equals', 'ok'); + $this->assertInstanceOf('Net_LDAP2_Filter', $filter); + + // print success: + ob_start(); + $printresult = $filter->printMe(); + ob_end_clean(); + $this->assertTrue($printresult); + + // PrintMe if Filehandle is an error (e.g. if some PEAR-File db is used): + $err = new PEAR_Error(); + $this->assertInstanceOf('PEAR_Error', $filter->printMe($err)); + + // PrintMe if filter is damaged, + // $filter_dmg is used below too, to test printing to a file with + // damaged filter + $filter_dmg = new Net_LDAP2_Filter('damaged_filter_string'); + + // write success: + $file = @fopen($testfile, 'w'); + if (is_writable($testfile) && $file) { + $this->assertTrue($filter->printMe($file)); + $this->assertInstanceOf('PEAR_Error', $filter_dmg->printMe($file)); // dmg. filter + @fclose($file); + } else { + $this->markTestSkipped("$testfile could not be opened in write mode, skipping write test");
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/Net_LDAP2_LDIFTest.php
Added
@@ -0,0 +1,689 @@ +<?php +//@encoding iso-8859-1 +require_once __DIR__ . '/Net_LDAP2_TestBase.php'; +require_once 'Net/LDAP2/LDIF.php'; + +/** + * Test class for Net_LDAP2_LDIF. + * Generated by PHPUnit_Util_Skeleton on 2007-12-20 at 10:11:52. + */ +class Net_LDAP2_LDIFTest extends Net_LDAP2_TestBase { + /** + * Default config for tests. + * + * The config is bound to the ldif test file + * tests/ldif_data/unsorted_w50.ldif + * so don't change or tests will fail + * + * @var array + */ + var $defaultConfig = array( + 'onerror' => 'undef', + 'encode' => 'base64', + 'wrap' => 50, + 'change' => 0, + 'sort' => 0, + 'version' => 1 // mimic pre 2.0.0RC5 behavior, so test files need no adjusting + ); + + /** + * Test entries data + * + * Please do not just modify these values, they + * are closely related to the LDIF test data. + * + * @var string + */ + var $testentries_data = array( + 'cn=test1,ou=example,dc=com' => array( + 'cn' => 'test1', + 'attr3' => array('foo', 'bar'), + 'attr1' => 12345, + 'attr4' => 'brrrzztt', + 'objectclass' => 'oc1', + 'attr2' => array('1234', 'baz')), + + 'cn=test blabla,ou=example,dc=com' => array( + 'cn' => 'test blabla', + 'attr3' => array('foo', 'bar'), + 'attr1' => 12345, + 'attr4' => 'blablaöäü', + 'objectclass' => 'oc2', + 'attr2' => array('1234', 'baz'), + 'verylong' => 'fhu08rhvt7b478vt5hv78h45nfgt45h78t34hhhhhhhhhv5bg8h6ttttttttt3489t57nhvgh4788trhg8999vnhtgthgui65hgb5789thvngwr789cghm738'), + + 'cn=test öäü,ou=example,dc=com' => array( + 'cn' => 'test öäü', + 'attr3' => array('foo', 'bar'), + 'attr1' => 12345, + 'attr4' => 'blablaöäü', + 'objectclass' => 'oc3', + 'attr2' => array('1234', 'baz'), + 'attr5' => 'endspace ', + 'attr6' => ':badinitchar'), + + ':cn=endspace,dc=com ' => array( + 'cn' => 'endspace') + ); + + /** + * Test file written to + * + * @var string + */ + var $outfile = 'test.out.ldif'; + + /** + * Test entries + * + * They will be created in main() + * + * @var array + */ + var $testentries = array(); + + /** + * Runs the test methods of this class. + * + * @access public + * @static + */ + public static function main() { + require_once "PHPUnit/TextUI/TestRunner.php"; + + $suite = new PHPUnit_Framework_TestSuite("Net_LDAP2_LDIFTest"); + $result = PHPUnit_TextUI_TestRunner::run($suite); + } + + /** + * Open some outfile and ensure correct rights + * + * @access protected + */ + protected function setUp() { + // initialize test entries + $this->testentries = array(); + foreach ($this->testentries_data as $dn => $attrs) { + $entry = Net_LDAP2_Entry::createfresh($dn, $attrs); + $this->assertInstanceOf('Net_LDAP2_Entry', $entry, 'ERROR inittializing test entries'); + array_push($this->testentries, $entry); + } + + // create outfile if not exists and enforce proper access rights + if (file_exists($this->outfile)) @unlink($this->outfile); + $this->assertTrue(touch($this->outfile), 'Init error: Unable to create '.$this->outfile); + $this->assertTrue(chmod($this->outfile, 0644), 'Init error: Unable to chmod(0644) '.$this->outfile); + } + + /** + * Remove the outfile + * + * @access protected + */ + protected function tearDown() { + // uncomment this if you debug the test cases so you will have output available + if (file_exists($this->outfile)) @unlink($this->outfile); + } + + /** + * Construction tests + * + * Construct LDIF object and see if we can get a handle + */ + public function testConstruction() { + $supported_modes = array('r', 'w', 'a'); + $plus = array('', '+'); + + // Test all open modes, + // all of them should return a correct handle + foreach ($supported_modes as $mode) { + foreach ($plus as $p) { + $ldif = new Net_LDAP2_LDIF($this->outfile, $mode, $this->defaultConfig); + $this->assertTrue(is_resource($ldif->handle())); + } + } + + // Test illegal option passing + $ldif = new Net_LDAP2_LDIF($this->outfile, $mode, array('somebad' => 'option')); + $this->assertInstanceOf('Net_LDAP2_Error', $ldif->error()); + + // Test passing custom handle + $handle = fopen($this->outfile, 'r'); + $ldif = new Net_LDAP2_LDIF($handle, $mode, $this->defaultConfig); + $this->assertTrue(is_resource($ldif->handle())); + + // Reading test with invalid file mode + $ldif = new Net_LDAP2_LDIF($this->outfile, 'y', $this->defaultConfig); + $this->assertNull($ldif->handle()); + $this->assertInstanceOf('Net_LDAP2_Error', $ldif->error()); + + // Reading test with nonexistent file + $ldif = new Net_LDAP2_LDIF('some/nonexistent/file_for_net_ldap_ldif', 'r', $this->defaultConfig); + $this->assertNull($ldif->handle()); + $this->assertInstanceOf('Net_LDAP2_Error', $ldif->error()); + + // writing to nonexistent file + $ldif = new Net_LDAP2_LDIF('testfile_for_net_ldap_ldif', 'w', $this->defaultConfig); + $this->assertTrue(is_resource($ldif->handle())); + @unlink('testfile_for_net_ldap_ldif'); + + // writing to nonexistent path + $ldif = new Net_LDAP2_LDIF('some/nonexistent/file_for_net_ldap_ldif', 'w', $this->defaultConfig); + $this->assertNull($ldif->handle()); + $this->assertInstanceOf('Net_LDAP2_Error', $ldif->error()); + + // writing to existing file but without permission + // note: chmod should succeed since we do that in setUp() + if (chmod($this->outfile, 0444)) { + $ldif = new Net_LDAP2_LDIF($this->outfile, 'w', $this->defaultConfig); + $this->assertNull($ldif->handle()); + $this->assertInstanceOf('Net_LDAP2_Error', $ldif->error()); + } else { + $this->markTestSkipped("Could not chmod ".$this->outfile.", write test without permission skipped"); + } + } + + /** + * Tests if entries from an LDIF file are correctly constructed + */ + public function testRead_entry() { + /* + * UNIX line endings + */ + $ldif = new Net_LDAP2_LDIF(dirname(__FILE__).'/ldif_data/unsorted_w50.ldif', 'r', $this->defaultConfig); + $this->assertTrue(is_resource($ldif->handle())); + + $entries = array(); + do { + $entry = $ldif->read_entry(); + $this->assertFalse((boolean)$ldif->error(), 'failed building entry from LDIF: '.$ldif->error(true));
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/Net_LDAP2_RootDSETest.php
Added
@@ -0,0 +1,152 @@ +<?php +require_once __DIR__ . '/Net_LDAP2_TestBase.php'; +require_once 'Net/LDAP2/RootDSE.php'; + +/** + * Test class for Net_LDAP2_RootDSE. + * Generated by PHPUnit_Util_Skeleton on 2007-10-09 at 10:47:05. + */ +class Net_LDAP2_RootDSETest extends Net_LDAP2_TestBase { + /** + * Runs the test methods of this class. + * + * @access public + * @static + */ + public static function main() { + require_once "PHPUnit/TextUI/TestRunner.php"; + + $suite = new PHPUnit_Framework_TestSuite("Net_LDAP2_RootDSETest"); + $result = PHPUnit_TextUI_TestRunner::run($suite); + } + + /** + * Sets up the fixture, for example, open a network connection. + * This method is called before a test is executed. + * + * @access protected + */ + protected function setUp() { + $this->markTestIncomplete('Test not implemented yet.'); + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + * + * @access protected + */ + protected function tearDown() { + } + + /** + * @todo Implement testGetValue(). + */ + public function testGetValue() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testGet_value(). + */ + public function testGet_value() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSupportedExtension(). + */ + public function testSupportedExtension() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSupported_extension(). + */ + public function testSupported_extension() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSupportedVersion(). + */ + public function testSupportedVersion() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSupported_version(). + */ + public function testSupported_version() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSupportedControl(). + */ + public function testSupportedControl() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSupported_control(). + */ + public function testSupported_control() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSupportedSASLMechanism(). + */ + public function testSupportedSASLMechanism() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSupported_sasl_mechanism(). + */ + public function testSupported_sasl_mechanism() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement test_checkAttr(). + */ + public function test_checkAttr() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } +} +?>
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/Net_LDAP2_SearchTest.php
Added
@@ -0,0 +1,363 @@ +<?php +require_once __DIR__ . '/Net_LDAP2_TestBase.php'; +require_once 'Net/LDAP2.php'; +require_once 'Net/LDAP2/Search.php'; + +/** + * Test class for Net_LDAP2_Search. + * Generated by PHPUnit_Util_Skeleton on 2007-10-09 at 10:46:51. + */ +class Net_LDAP2_SearchTest extends Net_LDAP2_TestBase { + /** + * Stores the LDAP configuration + */ + var $ldapcfg = false; + + /** + * Sets up the fixture, for example, open a network connection. + * This method is called before a test is executed. + * + * @access protected + */ + protected function setUp() { + $this->ldapcfg = $this->getTestConfig(); + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + * + * @access protected + */ + protected function tearDown() { + } + + /** + * This checks if a valid LDAP testconfig is present and loads it. + * + * If so, it is loaded and returned as array. If not, false is returned. + * + * @return false|array + */ + public function getTestConfig() { + $config = false; + $file = dirname(__FILE__).'/ldapconfig.ini'; + if (file_exists($file) && is_readable($file)) { + $config = parse_ini_file($file, true); + } else { + return false; + } + // validate ini + $v_error = $file.' is probably invalid. Did you quoted values correctly?'; + $this->assertTrue(array_key_exists('global', $config), $v_error); + $this->assertTrue(array_key_exists('test', $config), $v_error); + $this->assertEquals(7, count($config['global']), $v_error); + $this->assertEquals(7, count($config['test']), $v_error); + + // reformat things a bit, for convinience + $config['global']['server_binddn'] = + $config['global']['server_binddn'].','.$config['global']['server_base_dn']; + $config['test']['existing_attrmv'] = explode('|', $config['test']['existing_attrmv']); + return $config; + } + + /** + * Establishes a working connection + * + * @return Net_LDAP2 + */ + public function &connect() { + // Check extension + if (true !== Net_LDAP2::checkLDAPExtension()) { + $this->markTestSkipped('PHP LDAP extension not found or not loadable. Skipped Test.'); + } + + // Simple working connect and privilegued bind + $lcfg = array( + 'host' => $this->ldapcfg['global']['server_address'], + 'port' => $this->ldapcfg['global']['server_port'], + 'basedn' => $this->ldapcfg['global']['server_base_dn'], + 'binddn' => $this->ldapcfg['global']['server_binddn'], + 'bindpw' => $this->ldapcfg['global']['server_bindpw'], + 'filter' => '(ou=*)', + ); + $ldap = Net_LDAP2::connect($lcfg); + $this->assertInstanceOf('Net_LDAP2', $ldap, 'Connect failed but was supposed to work. Check credentials and host address. If those are correct, file a bug!'); + return $ldap; + } + + /** + * @todo Implement testEntries(). + */ + public function testEntries() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testShiftEntry(). + */ + public function testShiftEntry() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testShift_entry(). + */ + public function testShift_entry() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testPopEntry(). + */ + public function testPopEntry() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testPop_entry(). + */ + public function testPop_entry() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSorted_as_struct(). + */ + public function testSorted_as_struct() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSorted(). + */ + public function testSorted() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testAs_struct(). + */ + public function testAs_struct() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSetSearch(). + */ + public function testSetSearch() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testSetLink(). + */ + public function testSetLink() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /** + * @todo Implement testCount(). + */ + public function testCount() { + // Remove the following line when you implement this test. + $this->markTestIncomplete( + "This test has not been implemented yet." + ); + } + + /**
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/Net_LDAP2_TestBase.php
Added
@@ -0,0 +1,12 @@ +<?php +class Net_LDAP2_TestBase extends PHPUnit_Framework_TestCase +{ + public static function assertTrue($condition, $msg = null) + { + if ($condition instanceof Net_LDAP2_Error) { + self::fail('Error: ' . $condition->getMessage()); + } + return parent::assertTrue($condition, $msg); + } +} +?>
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/Net_LDAP2_UtilTest.php
Added
@@ -0,0 +1,385 @@ +<?php +require_once __DIR__ . '/Net_LDAP2_TestBase.php'; +require_once 'Net/LDAP2/Util.php'; + +/** + * Test class for Net_LDAP2_Util. + * Generated by PHPUnit_Util_Skeleton on 2007-10-09 at 10:33:22. + */ +class Net_LDAP2_UtilTest extends Net_LDAP2_TestBase { + /** + * Runs the test methods of this class. + * + * @access public + * @static + */ + public static function main() { + require_once "PHPUnit/TextUI/TestRunner.php"; + + $suite = new PHPUnit_Framework_TestSuite("Net_LDAP2_UtilTest"); + $result = PHPUnit_TextUI_TestRunner::run($suite); + } + + /** + * Sets up the fixture, for example, open a network connection. + * This method is called before a test is executed. + * + * @access protected + */ + protected function setUp() { + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + * + * @access protected + */ + protected function tearDown() { + } + + /** + * Test escape_dn_value() + */ + public function testEscape_dn_value() { + $dnval = ' '.chr(22).' t,e+s"t,\\v<a>l;u#e=! '; + $expected = '\20\20\16 t\,e\+s\"t\,\\\\v\<a\>l\;u\#e\=!\20\20\20\20'; + + // string call + $this->assertEquals(array($expected), Net_LDAP2_Util::escape_dn_value($dnval)); + + // array call + $this->assertEquals(array($expected), Net_LDAP2_Util::escape_dn_value(array($dnval))); + + // multiple arrays + $this->assertEquals(array($expected, $expected, $expected), Net_LDAP2_Util::escape_dn_value(array($dnval,$dnval,$dnval))); + } + + /** + * Test unescape_dn_value() + */ + public function testUnescape_dn_value() { + $dnval = '\\20\\20\\16\\20t\\,e\\+s \\"t\\,\\\\v\\<a\\>l\\;u\\#e\\=!\\20\\20\\20\\20'; + $expected = ' '.chr(22).' t,e+s "t,\\v<a>l;u#e=! '; + + // string call + $this->assertEquals(array($expected), Net_LDAP2_Util::unescape_dn_value($dnval)); + + // array call + $this->assertEquals(array($expected), Net_LDAP2_Util::unescape_dn_value(array($dnval))); + + // multiple arrays + $this->assertEquals(array($expected, $expected, $expected), Net_LDAP2_Util::unescape_dn_value(array($dnval,$dnval,$dnval))); + } + + /** + * Test escaping of filter values + */ + public function testEscape_filter_value() { + $expected = 't\28e,s\29t\2av\5cal\1eue'; + $filterval = 't(e,s)t*v\\al'.chr(30).'ue'; + + // string call + $this->assertEquals(array($expected), Net_LDAP2_Util::escape_filter_value($filterval)); + + // array call + $this->assertEquals(array($expected), Net_LDAP2_Util::escape_filter_value(array($filterval))); + + // multiple arrays + $this->assertEquals(array($expected, $expected, $expected), Net_LDAP2_Util::escape_filter_value(array($filterval,$filterval,$filterval))); + } + + /** + * Test unescaping of filter values + */ + public function testUnescape_filter_value() { + $expected = 't(e,s)t*v\\al'.chr(30).'ue'; + $filterval = 't\28e,s\29t\2av\5cal\1eue'; + + // string call + $this->assertEquals(array($expected), Net_LDAP2_Util::unescape_filter_value($filterval)); + + // array call + $this->assertEquals(array($expected), Net_LDAP2_Util::unescape_filter_value(array($filterval))); + + // multiple arrays + $this->assertEquals(array($expected, $expected, $expected), Net_LDAP2_Util::unescape_filter_value(array($filterval,$filterval,$filterval))); + } + + /** + * Test asc2hex32() + */ + public function testAsc2hex32() { + + $expected = '\00\01\02\03\04\05\06\07\08\09\0a\0b\0c\0d\0e\0f\10\11\12\13\14\15\16\17\18\19\1a\1b\1c\1d\1e\1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'; + $str = ''; + for ($i = 0; $i < 127; $i++) { + $str .= chr($i); + } + $this->assertEquals($expected, Net_LDAP2_Util::asc2hex32($str)); + } + + /** + * Test HEX unescaping + */ + public function testHex2asc() { + $expected = ''; + for ($i = 0; $i < 127; $i++) { + $expected .= chr($i); + } + + $str = '\00\01\02\03\04\05\06\07\08\09\0a\0b\0c\0d\0e\0f\10\11\12\13\14\15\16\17\18\19\1a\1b\1c\1d\1e\1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'; + $this->assertEquals($expected, Net_LDAP2_Util::hex2asc($str)); + } + + /** + * Tests split_rdn_multival() + * + * In addition to the above test of the basic split correction, + * we test here the functionality of mutlivalued RDNs + */ + public function testSplit_rdn_multival() { + // One value + $rdn = 'CN=J. Smith'; + $expected = array('CN=J. Smith'); + $split = Net_LDAP2_Util::split_rdn_multival($rdn); + $this->assertEquals($expected, $split); + + // Two values + $rdn = 'OU=Sales+CN=J. Smith'; + $expected = array('OU=Sales', 'CN=J. Smith'); + $split = Net_LDAP2_Util::split_rdn_multival($rdn); + $this->assertEquals($expected, $split); + + // Several multivals + $rdn = 'OU=Sales+CN=J. Smith+L=London+C=England'; + $expected = array('OU=Sales', 'CN=J. Smith', 'L=London', 'C=England'); + $split = Net_LDAP2_Util::split_rdn_multival($rdn); + $this->assertEquals($expected, $split); + + // Unescaped "+" in value + $rdn = 'OU=Sa+les+CN=J. Smith'; + $expected = array('OU=Sa+les', 'CN=J. Smith'); + $split = Net_LDAP2_Util::split_rdn_multival($rdn); + $this->assertEquals($expected, $split); + + // Unescaped "+" in attr name + $rdn = 'O+U=Sales+CN=J. Smith'; + $expected = array('O+U=Sales', 'CN=J. Smith'); + $split = Net_LDAP2_Util::split_rdn_multival($rdn); + $this->assertEquals($expected, $split); + + // Unescaped "+" in attr name + value + $rdn = 'O+U=Sales+CN=J. Sm+ith'; + $expected = array('O+U=Sales', 'CN=J. Sm+ith'); + $split = Net_LDAP2_Util::split_rdn_multival($rdn); + $this->assertEquals($expected, $split); + + // Unescaped "+" in attr name, but not first attr + // this documents a known bug. However, unfortunately we cant + // know wether the "C+" belongs to value "Sales" or attribute "C+N". + // To solve this, we must ask the schema which we do not right now. + // The problem is located in _correct_dn_splitting() + $rdn = 'OU=Sales+C+N=J. Smith'; + $expected = array('OU=Sales+C', 'N=J. Smith'); // The "C+" is treaten as value of "OU" + $split = Net_LDAP2_Util::split_rdn_multival($rdn); + $this->assertEquals($expected, $split); + + // Escaped "+" in attr name and value + $rdn = 'O\+U=Sales+CN=J. Sm\+ith'; + $expected = array('O\+U=Sales', 'CN=J. Sm\+ith'); + $split = Net_LDAP2_Util::split_rdn_multival($rdn); + $this->assertEquals($expected, $split); + } + + /** + * Tests attribute splitting ('foo=bar' => array('foo', 'bar')) + */ + public function testSplit_attribute_string() { + $attr_str = "foo=bar";
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldapconfig.ini.dist
Added
@@ -0,0 +1,51 @@ +; +---------------------------------------------------------------------------+ +; | This is a configuration file for Net_LDAP2s tests. | +; | To activate the tests, you need to adjust the configuration to | +; | your needs and copy it over to "ldapconfig.conf". Place the | +; | file inside the directory holding all the test programs. | +; | | +; | Note, that this tests assume a working LDAP server. | +; | If you don't have such a server, you may use the | +; | LDIF based mock server. Head to 'ldapldifconfig.ini.dist'. | +; | | +; | The syntax of this file is really easy and similar to other .ini-files. | +; | Remember to quote strings containing non-alphanumeric characters. | +; +---------------------------------------------------------------------------+ + + +; Global section +; server_cap_tls: is the server ssl capable? +; server_cap_anonymous: is the server allowing anonymous access? +; server_base_dn: BaseDN at which your DIT starts. Ensure that the +; binding user has all rights to add, delete and +; modifying entries as well as creating and deleting +; some subtree (ou=...) below the base. +; server_*: I think those following are self-explanatory +; server_binddn: Relative to base_dn below +[global] +server_cap_tls = false +server_cap_anonymous = true +server_base_dn = "dc=example,dc=com" +server_address = localhost +server_port = 389 +server_binddn = "cn=admin" +server_bindpw = test + + +; Definitions for the tests. Adjust to suit the needs of your test server. +; existing_entry: RDN for an entry that must exist (relative to base). +; The following attribute tests are performed on this entry. +; existing_attrs: Name of an existing attribute (single valued) +; existing_attrsv: Value of this attribute +; existing_attrm: Name of an existing attribute (multi valued) +; existing_attrmv: Values of this attribute, "|" delimited +; utf8_attr: Name of attribute with UTF8 value +; noutf8_attr: Name of attribute without UTF8 value +[test] +existing_entry = "cn=existing" +existing_attrs = sn +existing_attrsv = testentry +existing_attrm = mail +existing_attrmv = "test.entry@example.com|te@example.com" +utf8_attr = ou +noutf8_attr = givenName
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldapldifconfig.ini.dist
Added
@@ -0,0 +1,17 @@ +; +---------------------------------------------------------------------------+ +; | This is a configuration file for Net_LDAP2LDIFs tests. | +; | To activate the tests, you need to adjust the configuration to | +; | your needs and copy it over to "ldapldifconfig.conf". Place the | +; | file inside the directory holding all the test programs. | +; | | +; | Note, that this tests assumes a correct LDIF file. | +; | By default, one of the test sets will be used. | +; | | +; | The syntax of this file is really easy and similar to other .ini-files. | +; | Remember to quote strings containing non-alphanumeric characters. | +; +---------------------------------------------------------------------------+ + + +; /!\ IMOPORTANT NOTE: THE LDIF BASED MOCK SERVER IS NOT IMPLEMENTED SO FAR! /!\ +; This file is just here for later use and a reminder. Just ignore it so far +; unless you are implementing tests :) \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/INITIAL_TESTDATA.ldif
Added
@@ -0,0 +1,13 @@ +dn: cn=existing,dc=example,dc=com +objectClass: inetOrgPerson +objectClass: organizationalPerson +objectClass: person +objectClass: top +cn: existing +sn: testentry +mail: test.entry@example.com +mail: te@example.com +ou:: UGFsbcO2 +givenName: i am +description: A test entry for PEAR::Net_LDAP2 +
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/base.ldif
Added
@@ -0,0 +1,7 @@ +# ldapadd -x -h localhost -p 389 -D "cn=admin,dc=test,dc=com" -w secret -f base.ldif + +dn: dc=example,dc=com +objectClass: dcObject +objectClass: organizationalUnit +#dc: test +ou: Test \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/changes.ldif
Added
@@ -0,0 +1,44 @@ +# +# This is a LDIF file to test writing changes of entries +# +# +version: 1 +dn: cn=test1,ou=example,dc=com +changetype: modify +delete: attr1 +- +delete: attr2 +attr2: baz +- +delete: attr4 +- + +dn:: Y249dGVzdCD25Pwsb3U9ZXhhbXBsZSxkYz1jb20= +changetype: modify +add: newattr +newattr: foo +- +delete: attr3 +- +replace: attr1 +attr1: newvaluefor1 +- +replace: attr2 +attr2: newvalue1for2 +attr2: newvalue2for2 +- + +dn:: OmNuPWVuZHNwYWNlLGRjPWNvbSA= +changetype: delete + +dn: cn=foo,ou=example,dc=com +changetype: modrdn +newrdn: cn=Bar +deleteoldrdn: 1 + +dn: cn=footest,ou=example,dc=com +changetype: modrdn +newrdn: cn=foobartest +deleteoldrdn: 1 +newsuperior: ou=newexample,dc=com +
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/malformed_encoding.ldif
Added
@@ -0,0 +1,19 @@ +# +# This is a LDIF file to test encoding failure +# + +# unencoded DN +version: 1 +dn: cn=testöäü,ou=example,dc=com +objectclass: oc1 + +# unencoded attr value +version: 1 +dn: cn=test2,ou=example,dc=com +objectclass: testöäü +cn: test2 + +# entry ok +version: 1 +dn: cn=test,ou=example,dc=com +objectclass: oc1
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/malformed_syntax.ldif
Added
@@ -0,0 +1,20 @@ +# +# This is a LDIF file to test syntax error +# + +# wrong syntax (space too less at val of objectclass) +dn: cn=test1,ou=example,dc=com +objectclass:oc1 +cn: test1 +attr3: foo + +# wrong syntax (no DN given) +objectclass:oc1 +cn: test_invalid +attr3: foo + +# entry ok +version: 1 +dn: cn=test3,ou=example,dc=com +objectclass: oc1 +attr3: foo
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/malformed_wrapping.ldif
Added
@@ -0,0 +1,24 @@ +# +# This is a LDIF file to test wrapping failure +# + +# wrong wrapping (entry must fail because DN is damaged): +# (note, that there must eb an empty line below this comment, otherwise +# the DN line is treaten as wrapped comment) + + dn: cn=test1,ou=example,dc=com +objectclass: oc1 +cn: test1 + +# wrong syntax (literal line but no wrapped content) +dn: cn=test2,ou=example,dc=com +objectclass:oc1 +cn: test2 +some_wrong_literal_line +attr3: foo + +# entry ok +version: 1 +dn: cn=test,ou=example,dc=com +objectclass: oc1 +cn: test
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/slapd.conf
Added
@@ -0,0 +1,17 @@ +# See slapd.conf(5) for details on configuration options. +include /etc/ldap/schema/core.schema +include /etc/ldap/schema/cosine.schema +include /etc/ldap/schema/inetorgperson.schema +include /etc/ldap/schema/nis.schema + +pidfile /tmp/slapd/slapd.pid +argsfile /tmp/slapd/slapd.args + +modulepath /usr/lib/openldap + +database ldif +directory /tmp/slapd + +suffix "dc=example,dc=com" +rootdn "cn=admin,dc=example,dc=com" +rootpw {SSHA}AIzygLSXlArhAMzddUriXQxf7UlkqopP
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/sorted_w40.ldif
Added
@@ -0,0 +1,41 @@ +# +# This is a LDIF file to test reading capabilitys +# It was created using options: sort=1, wrap=40 +# +version: 1 +dn: cn=test1,ou=example,dc=com +objectclass: oc1 +attr1: 12345 +attr2: 1234 +attr2: baz +attr3: foo +attr3: bar +attr4: brrrzztt +cn: test1 + +dn: cn=test blabla,ou=example,dc=com +objectclass: oc2 +attr1: 12345 +attr2: 1234 +attr2: baz +attr3: foo +attr3: bar +attr4:: YmxhYmxh9uT8 +cn: test blabla +verylong: fhu08rhvt7b478vt5hv78h45nfgt45h78t34hhhhhhhhhv5bg8h6ttttttttt3489t57nhvgh4788trhg8999vnhtgthgui65hgb5789thvngwr789cghm738 + +dn:: Y249dGVzdCD25Pwsb3U9ZXhhbXBsZSxkYz1jb20= +objectclass: oc3 +attr1: 12345 +attr2: 1234 +attr2: baz +attr3: foo +attr3: bar +attr4:: YmxhYmxh9uT8 +attr5:: ZW5kc3BhY2Ug +attr6:: OmJhZGluaXRjaGFy +cn:: dGVzdCD25Pw= + +dn:: OmNuPWVuZHNwYWNlLGRjPWNvbSA= +cn: endspace +
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/sorted_w50.ldif
Added
@@ -0,0 +1,43 @@ +# +# This is a LDIF file to test reading capabilitys +# It was created using options: sort=1, wrap=50 +# +version: 1 +dn: cn=test1,ou=example,dc=com +objectclass: oc1 +attr1: 12345 +attr2: 1234 +attr2: baz +attr3: foo +attr3: bar +attr4: brrrzztt +cn: test1 + +dn: cn=test blabla,ou=example,dc=com +objectclass: oc2 +attr1: 12345 +attr2: 1234 +attr2: baz +attr3: foo +attr3: bar +attr4:: YmxhYmxh9uT8 +cn: test blabla +verylong: fhu08rhvt7b478vt5hv78h45nfgt45h78t34hhhhhhhhhv5bg8 + h6ttttttttt3489t57nhvgh4788trhg8999vnhtgthgui65hgb + 5789thvngwr789cghm738 + +dn:: Y249dGVzdCD25Pwsb3U9ZXhhbXBsZSxkYz1jb20= +objectclass: oc3 +attr1: 12345 +attr2: 1234 +attr2: baz +attr3: foo +attr3: bar +attr4:: YmxhYmxh9uT8 +attr5:: ZW5kc3BhY2Ug +attr6:: OmJhZGluaXRjaGFy +cn:: dGVzdCD25Pw= + +dn:: OmNuPWVuZHNwYWNlLGRjPWNvbSA= +cn: endspace +
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/unsorted_w30.ldif
Added
@@ -0,0 +1,41 @@ +# +# This is a LDIF file to test reading capabilitys +# It was created using options: sort=0, wrap=30 +# +version: 1 +dn: cn=test1,ou=example,dc=com +cn: test1 +attr3: foo +attr3: bar +attr1: 12345 +attr4: brrrzztt +objectclass: oc1 +attr2: 1234 +attr2: baz + +dn: cn=test blabla,ou=example,dc=com +cn: test blabla +attr3: foo +attr3: bar +attr1: 12345 +attr4:: YmxhYmxh9uT8 +objectclass: oc2 +attr2: 1234 +attr2: baz +verylong: fhu08rhvt7b478vt5hv78h45nfgt45h78t34hhhhhhhhhv5bg8h6ttttttttt3489t57nhvgh4788trhg8999vnhtgthgui65hgb5789thvngwr789cghm738 + +dn:: Y249dGVzdCD25Pwsb3U9ZXhhbXBsZSxkYz1jb20= +cn:: dGVzdCD25Pw= +attr3: foo +attr3: bar +attr1: 12345 +attr4:: YmxhYmxh9uT8 +objectclass: oc3 +attr2: 1234 +attr2: baz +attr5:: ZW5kc3BhY2Ug +attr6:: OmJhZGluaXRjaGFy + +dn:: OmNuPWVuZHNwYWNlLGRjPWNvbSA= +cn: endspace +
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/unsorted_w50.ldif
Added
@@ -0,0 +1,43 @@ +# +# This is a LDIF file to test reading capabilitys +# It was created using options: sort=0, wrap=50 +# +version: 1 +dn: cn=test1,ou=example,dc=com +cn: test1 +attr3: foo +attr3: bar +attr1: 12345 +attr4: brrrzztt +objectclass: oc1 +attr2: 1234 +attr2: baz + +dn: cn=test blabla,ou=example,dc=com +cn: test blabla +attr3: foo +attr3: bar +attr1: 12345 +attr4:: YmxhYmxh9uT8 +objectclass: oc2 +attr2: 1234 +attr2: baz +verylong: fhu08rhvt7b478vt5hv78h45nfgt45h78t34hhhhhhhhhv5bg8 + h6ttttttttt3489t57nhvgh4788trhg8999vnhtgthgui65hgb + 5789thvngwr789cghm738 + +dn:: Y249dGVzdCD25Pwsb3U9ZXhhbXBsZSxkYz1jb20= +cn:: dGVzdCD25Pw= +attr3: foo +attr3: bar +attr1: 12345 +attr4:: YmxhYmxh9uT8 +objectclass: oc3 +attr2: 1234 +attr2: baz +attr5:: ZW5kc3BhY2Ug +attr6:: OmJhZGluaXRjaGFy + +dn:: OmNuPWVuZHNwYWNlLGRjPWNvbSA= +cn: endspace +
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/ldif_data/unsorted_w50_WIN.ldif
Added
@@ -0,0 +1,43 @@ +# +# This is a LDIF file to test reading capabilitys with WINDOWS line endings +# It was created using options: sort=0, wrap=50 +# +version: 1 +dn: cn=test1,ou=example,dc=com +cn: test1 +attr3: foo +attr3: bar +attr1: 12345 +attr4: brrrzztt +objectclass: oc1 +attr2: 1234 +attr2: baz + +dn: cn=test blabla,ou=example,dc=com +cn: test blabla +attr3: foo +attr3: bar +attr1: 12345 +attr4:: YmxhYmxh9uT8 +objectclass: oc2 +attr2: 1234 +attr2: baz +verylong: fhu08rhvt7b478vt5hv78h45nfgt45h78t34hhhhhhhhhv5bg8 + h6ttttttttt3489t57nhvgh4788trhg8999vnhtgthgui65hgb + 5789thvngwr789cghm738 + +dn:: Y249dGVzdCD25Pwsb3U9ZXhhbXBsZSxkYz1jb20= +cn:: dGVzdCD25Pw= +attr3: foo +attr3: bar +attr1: 12345 +attr4:: YmxhYmxh9uT8 +objectclass: oc3 +attr2: 1234 +attr2: baz +attr5:: ZW5kc3BhY2Ug +attr6:: OmJhZGluaXRjaGFy + +dn:: OmNuPWVuZHNwYWNlLGRjPWNvbSA= +cn: endspace +
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/phpunit.xml
Added
@@ -0,0 +1,5 @@ +<phpunit strict="false"> + <php> + <includePath>..</includePath> + </php> +</phpunit>
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/travis
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/pear/net_ldap2/tests/travis/enable-ldap.ini
Added
@@ -0,0 +1,1 @@ +extension=ldap.so
View file
roundcubemail-1.4.13.tar.gz/vendor/phpdocumentor/type-resolver/src/PseudoTypes/IntegerRange.php
Added
@@ -0,0 +1,61 @@ +<?php + +declare(strict_types=1); + +/** + * This file is part of phpDocumentor. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\PseudoTypes; + +use phpDocumentor\Reflection\PseudoType; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\Types\Integer; + +/** + * Value Object representing the type 'int'. + * + * @psalm-immutable + */ +final class IntegerRange extends Integer implements PseudoType +{ + /** @var string */ + private $minValue; + + /** @var string */ + private $maxValue; + + public function __construct(string $minValue, string $maxValue) + { + $this->minValue = $minValue; + $this->maxValue = $maxValue; + } + + public function underlyingType(): Type + { + return new Integer(); + } + + public function getMinValue(): string + { + return $this->minValue; + } + + public function getMaxValue(): string + { + return $this->maxValue; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + return 'int<' . $this->minValue . ', ' . $this->maxValue . '>'; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/phpdocumentor/type-resolver/src/PseudoTypes/List_.php
Added
@@ -0,0 +1,50 @@ +<?php + +declare(strict_types=1); + +/** + * This file is part of phpDocumentor. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\PseudoTypes; + +use phpDocumentor\Reflection\PseudoType; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\Types\Array_; +use phpDocumentor\Reflection\Types\Integer; +use phpDocumentor\Reflection\Types\Mixed_; + +/** + * Value Object representing the type 'list'. + * + * @psalm-immutable + */ +final class List_ extends Array_ implements PseudoType +{ + public function underlyingType(): Type + { + return new Array_(); + } + + public function __construct(?Type $valueType = null) + { + parent::__construct($valueType, new Integer()); + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + if ($this->valueType instanceof Mixed_) { + return 'list'; + } + + return 'list<' . $this->valueType . '>'; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/phpdocumentor/type-resolver/src/PseudoTypes/NegativeInteger.php
Added
@@ -0,0 +1,39 @@ +<?php + +declare(strict_types=1); + +/** + * This file is part of phpDocumentor. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\PseudoTypes; + +use phpDocumentor\Reflection\PseudoType; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\Types\Integer; + +/** + * Value Object representing the type 'int'. + * + * @psalm-immutable + */ +final class NegativeInteger extends Integer implements PseudoType +{ + public function underlyingType(): Type + { + return new Integer(); + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + return 'negative-int'; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/phpdocumentor/type-resolver/src/PseudoTypes/Numeric_.php
Added
@@ -0,0 +1,47 @@ +<?php + +declare(strict_types=1); + +/** + * This file is part of phpDocumentor. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\PseudoTypes; + +use phpDocumentor\Reflection\PseudoType; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\Types\AggregatedType; +use phpDocumentor\Reflection\Types\Compound; +use phpDocumentor\Reflection\Types\Float_; +use phpDocumentor\Reflection\Types\Integer; + +/** + * Value Object representing the 'numeric' pseudo-type, which is either a numeric-string, integer or float. + * + * @psalm-immutable + */ +final class Numeric_ extends AggregatedType implements PseudoType +{ + public function __construct() + { + AggregatedType::__construct([new NumericString(), new Integer(), new Float_()], '|'); + } + + public function underlyingType(): Type + { + return new Compound([new NumericString(), new Integer(), new Float_()]); + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + return 'numeric'; + } +}
View file
roundcubemail-1.4.11.20.tar.gz/vendor/phpdocumentor/type-resolver/src/PseudoTypes/PositiveInteger.php -> roundcubemail-1.4.13.tar.gz/vendor/phpdocumentor/type-resolver/src/PseudoTypes/PositiveInteger.php
Changed
@@ -18,7 +18,7 @@ use phpDocumentor\Reflection\Types\Integer; /** - * Value Object representing the type 'string'. + * Value Object representing the type 'int'. * * @psalm-immutable */
View file
roundcubemail-1.4.11.20.tar.gz/vendor/phpdocumentor/type-resolver/src/TypeResolver.php -> roundcubemail-1.4.13.tar.gz/vendor/phpdocumentor/type-resolver/src/TypeResolver.php
Changed
@@ -15,6 +15,8 @@ use ArrayIterator; use InvalidArgumentException; +use phpDocumentor\Reflection\PseudoTypes\IntegerRange; +use phpDocumentor\Reflection\PseudoTypes\List_; use phpDocumentor\Reflection\Types\Array_; use phpDocumentor\Reflection\Types\ArrayKey; use phpDocumentor\Reflection\Types\ClassString; @@ -37,8 +39,10 @@ use function class_exists; use function class_implements; use function count; +use function current; use function end; use function in_array; +use function is_numeric; use function key; use function preg_split; use function strpos; @@ -81,10 +85,12 @@ 'non-empty-lowercase-string' => PseudoTypes\NonEmptyLowercaseString::class, 'non-empty-string' => PseudoTypes\NonEmptyString::class, 'numeric-string' => PseudoTypes\NumericString::class, + 'numeric' => PseudoTypes\Numeric_::class, 'trait-string' => PseudoTypes\TraitString::class, 'int' => Types\Integer::class, 'integer' => Types\Integer::class, 'positive-int' => PseudoTypes\PositiveInteger::class, + 'negative-int' => PseudoTypes\NegativeInteger::class, 'bool' => Types\Boolean::class, 'boolean' => Types\Boolean::class, 'real' => Types\Float_::class, @@ -110,6 +116,7 @@ 'parent' => Types\Parent_::class, 'iterable' => Types\Iterable_::class, 'never' => Types\Never_::class, + 'list' => PseudoTypes\List_::class, ]; /** @@ -255,6 +262,8 @@ if ($classType !== null) { if ((string) $classType === 'class-string') { $types[] = $this->resolveClassString($tokens, $context); + } elseif ((string) $classType === 'int') { + $types[] = $this->resolveIntRange($tokens); } elseif ((string) $classType === 'interface-string') { $types[] = $this->resolveInterfaceString($tokens, $context); } else { @@ -271,6 +280,10 @@ } elseif ($token === self::OPERATOR_ARRAY) { end($types); $last = key($types); + if ($last === null) { + throw new InvalidArgumentException('Unexpected array operator'); + } + $lastItem = $types[$last]; if ($lastItem instanceof Expression) { $lastItem = $lastItem->getValueType(); @@ -315,7 +328,7 @@ ); } } elseif (count($types) === 1) { - return $types[0]; + return current($types); } if ($compoundToken === '|') { @@ -478,6 +491,75 @@ } /** + * Resolves integer ranges + * + * @param ArrayIterator<int, (string|null)> $tokens + */ + private function resolveIntRange(ArrayIterator $tokens): Type + { + $tokens->next(); + + $token = ''; + $minValue = null; + $maxValue = null; + $commaFound = false; + $tokenCounter = 0; + while ($tokens->valid()) { + $tokenCounter++; + $token = $tokens->current(); + if ($token === null) { + throw new RuntimeException( + 'Unexpected nullable character' + ); + } + + $token = trim($token); + + if ($token === '>') { + break; + } + + if ($token === ',') { + $commaFound = true; + } + + if ($commaFound === false && $minValue === null) { + if (is_numeric($token) || $token === 'max' || $token === 'min') { + $minValue = $token; + } + } + + if ($commaFound === true && $maxValue === null) { + if (is_numeric($token) || $token === 'max' || $token === 'min') { + $maxValue = $token; + } + } + + $tokens->next(); + } + + if ($token !== '>') { + if (empty($token)) { + throw new RuntimeException( + 'interface-string: ">" is missing' + ); + } + + throw new RuntimeException( + 'Unexpected character "' . $token . '", ">" is missing' + ); + } + + if (!$minValue || !$maxValue || $tokenCounter > 4) { + throw new RuntimeException( + 'int<min,max> has not the correct format' + ); + } + + return new IntegerRange($minValue, $maxValue); + } + + /** * Resolves class string * * @param ArrayIterator<int, (string|null)> $tokens @@ -521,10 +603,11 @@ { $isArray = ((string) $classType === 'array'); $isIterable = ((string) $classType === 'iterable'); + $isList = ((string) $classType === 'list'); // allow only "array", "iterable" or class name before "<" if ( - !$isArray && !$isIterable + !$isArray && !$isIterable && !$isList && (!$classType instanceof Object_ || $classType->getFqsen() === null) ) { throw new RuntimeException( @@ -538,7 +621,7 @@ $keyType = null; $token = $tokens->current(); - if ($token !== null && trim($token) === ',') { + if ($token !== null && trim($token) === ',' && !$isList) { // if we have a comma, then we just parsed the key type, not the value type $keyType = $valueType; if ($isArray) { @@ -596,6 +679,10 @@ return new Iterable_($valueType, $keyType); } + if ($isList) { + return new List_($valueType); + } + if ($classType instanceof Object_) { return $this->makeCollectionFromObject($classType, $valueType, $keyType); }
View file
roundcubemail-1.4.11.20.tar.gz/vendor/phpdocumentor/type-resolver/src/Types/Array_.php -> roundcubemail-1.4.13.tar.gz/vendor/phpdocumentor/type-resolver/src/Types/Array_.php
Changed
@@ -24,6 +24,6 @@ * * @psalm-immutable */ -final class Array_ extends AbstractList +class Array_ extends AbstractList { }
View file
roundcubemail-1.4.11.20.tar.gz/vendor/smarty/smarty/CHANGELOG.md -> roundcubemail-1.4.13.tar.gz/vendor/smarty/smarty/CHANGELOG.md
Changed
@@ -6,6 +6,21 @@ ## [Unreleased] +## [3.1.43] - 2022-01-10 + +### Security +- Prevent evasion of the `static_classes` security policy. This addresses CVE-2021-21408 + +## [3.1.42] - 2022-01-10 + +### Security +- Prevent arbitrary PHP code execution through maliciously crafted expression for the math function. This addresses CVE-2021-29454 + +## [3.1.41] - 2022-01-09 + +### Security +- Rewrote the mailto function to not use `eval` when encoding with javascript + ## [3.1.40] - 2021-10-13 ### Changed
View file
roundcubemail-1.4.11.20.tar.gz/vendor/smarty/smarty/lexer/smarty_internal_templateparser.y -> roundcubemail-1.4.13.tar.gz/vendor/smarty/smarty/lexer/smarty_internal_templateparser.y
Changed
@@ -758,6 +758,9 @@ value(res) ::= varindexed(vi) DOUBLECOLON static_class_access(r). { + if ($this->security && $this->security->static_classes !== array()) { + $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); + } $prefixVar = $this->compiler->getNewPrefixVariable(); if (vi['var'] === '\'smarty\'') { $this->compiler->appendPrefixCode("<?php {$prefixVar} = ". $this->compiler->compileTag('private_special_variable',array(),vi['smarty_internal_index']).';?>');
View file
roundcubemail-1.4.11.20.tar.gz/vendor/smarty/smarty/libs/Smarty.class.php -> roundcubemail-1.4.13.tar.gz/vendor/smarty/smarty/libs/Smarty.class.php
Changed
@@ -111,7 +111,7 @@ /** * smarty version */ - const SMARTY_VERSION = '3.1.40'; + const SMARTY_VERSION = '3.1.43'; /** * define variable scopes */
View file
roundcubemail-1.4.11.20.tar.gz/vendor/smarty/smarty/libs/plugins/function.mailto.php -> roundcubemail-1.4.13.tar.gz/vendor/smarty/smarty/libs/plugins/function.mailto.php
Changed
@@ -94,22 +94,19 @@ ); return; } - // FIXME: (rodneyrehm) document.write() excues me what? 1998 has passed! if ($encode === 'javascript') { - $string = 'document.write(\'<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>\');'; + $string = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>'; $js_encode = ''; for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $js_encode .= '%' . bin2hex($string[ $x ]); } - return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>'; + return '<script type="text/javascript">document.write(unescape(\'' . $js_encode . '\'))</script>'; } elseif ($encode === 'javascript_charcode') { $string = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>'; - for ($x = 0, $y = strlen($string); $x < $y; $x++) { + for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $ord[] = ord($string[ $x ]); } - $_ret = "<script type=\"text/javascript\" language=\"javascript\">\n" . "{document.write(String.fromCharCode(" . - implode(',', $ord) . "))" . "}\n" . "</script>\n"; - return $_ret; + return '<script type="text/javascript">document.write(String.fromCharCode(' . implode(',', $ord) . '))</script>'; } elseif ($encode === 'hex') { preg_match('!^(.*)(\?.*)$!', $address, $match); if (!empty($match[ 2 ])) {
View file
roundcubemail-1.4.11.20.tar.gz/vendor/smarty/smarty/libs/plugins/function.math.php -> roundcubemail-1.4.13.tar.gz/vendor/smarty/smarty/libs/plugins/function.math.php
Changed
@@ -28,7 +28,12 @@ 'int' => true, 'abs' => true, 'ceil' => true, + 'acos' => true, + 'acosh' => true, 'cos' => true, + 'cosh' => true, + 'deg2rad' => true, + 'rad2deg' => true, 'exp' => true, 'floor' => true, 'log' => true, @@ -39,27 +44,51 @@ 'pow' => true, 'rand' => true, 'round' => true, + 'asin' => true, + 'asinh' => true, 'sin' => true, + 'sinh' => true, 'sqrt' => true, 'srand' => true, - 'tan' => true + 'atan' => true, + 'atanh' => true, + 'tan' => true, + 'tanh' => true ); + // be sure equation parameter is present if (empty($params[ 'equation' ])) { trigger_error("math: missing equation parameter", E_USER_WARNING); return; } $equation = $params[ 'equation' ]; + + // Remove whitespaces + $equation = preg_replace('/\s+/', '', $equation); + + // Adapted from https://www.php.net/manual/en/function.eval.php#107377 + $number = '(?:\d+(?:[,.]\d+)?|pi|π)'; // What is a number + $functionsOrVars = '((?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))'; + $operators = '[+\/*\^%-]'; // Allowed math operators + $regexp = '/^(('.$number.'|'.$functionsOrVars.'|('.$functionsOrVars.'\s*\((?1)+\)|\((?1)+\)))(?:'.$operators.'(?2))?)+$/'; + + if (!preg_match($regexp, $equation)) { + trigger_error("math: illegal characters", E_USER_WARNING); + return; + } + // make sure parenthesis are balanced if (substr_count($equation, '(') !== substr_count($equation, ')')) { trigger_error("math: unbalanced parenthesis", E_USER_WARNING); return; } + // disallow backticks if (strpos($equation, '`') !== false) { trigger_error("math: backtick character not allowed in equation", E_USER_WARNING); return; } + // also disallow dollar signs if (strpos($equation, '$') !== false) { trigger_error("math: dollar signs not allowed in equation", E_USER_WARNING); @@ -96,6 +125,7 @@ } $smarty_math_result = null; eval("\$smarty_math_result = " . $equation . ";"); + if (empty($params[ 'format' ])) { if (empty($params[ 'assign' ])) { return $smarty_math_result;
View file
roundcubemail-1.4.11.20.tar.gz/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php -> roundcubemail-1.4.13.tar.gz/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php
Changed
@@ -2837,6 +2837,10 @@ // line 765 "../smarty/lexer/smarty_internal_templateparser.y" public function yy_r95() { + if ($this->security && $this->security->static_classes !== array()) { + $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); + } + $prefixVar = $this->compiler->getNewPrefixVariable(); if ($this->yystack[ $this->yyidx + -2 ]->minor[ 'var' ] === '\'smarty\'') { $this->compiler->appendPrefixCode("<?php {$prefixVar} = " .
View file
roundcubemail-1.4.11.20.tar.gz/vendor/symfony/polyfill-ctype/Ctype.php -> roundcubemail-1.4.13.tar.gz/vendor/symfony/polyfill-ctype/Ctype.php
Changed
@@ -25,13 +25,13 @@ * * @see https://php.net/ctype-alnum * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alnum($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); } @@ -41,13 +41,13 @@ * * @see https://php.net/ctype-alpha * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alpha($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); } @@ -57,13 +57,13 @@ * * @see https://php.net/ctype-cntrl * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_cntrl($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); } @@ -73,13 +73,13 @@ * * @see https://php.net/ctype-digit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_digit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); } @@ -89,13 +89,13 @@ * * @see https://php.net/ctype-graph * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_graph($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); } @@ -105,13 +105,13 @@ * * @see https://php.net/ctype-lower * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_lower($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); } @@ -121,13 +121,13 @@ * * @see https://php.net/ctype-print * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_print($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); } @@ -137,13 +137,13 @@ * * @see https://php.net/ctype-punct * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_punct($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); } @@ -153,13 +153,13 @@ * * @see https://php.net/ctype-space * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_space($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); } @@ -169,13 +169,13 @@ * * @see https://php.net/ctype-upper * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_upper($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); } @@ -185,13 +185,13 @@ * * @see https://php.net/ctype-xdigit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_xdigit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); } @@ -204,11 +204,12 @@ * (negative values have 256 added in order to allow characters in the Extended ASCII range). * Any other integer is interpreted as a string containing the decimal digits of the integer. * - * @param string|int $int + * @param mixed $int + * @param string $function * * @return mixed */ - private static function convert_int_to_char_for_ctype($int) + private static function convert_int_to_char_for_ctype($int, $function) { if (!\is_int($int)) { return $int; @@ -218,6 +219,10 @@ return (string) $int; } + if (\PHP_VERSION_ID >= 80100) { + @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); + } + if ($int < 0) {
View file
roundcubemail-1.4.11.20.tar.gz/vendor/symfony/polyfill-ctype/composer.json -> roundcubemail-1.4.13.tar.gz/vendor/symfony/polyfill-ctype/composer.json
Changed
@@ -18,6 +18,9 @@ "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, "files": [ "bootstrap.php" ]
View file
roundcubemail-1.4.11.20.tar.gz/vendor/symfony/yaml/Inline.php -> roundcubemail-1.4.13.tar.gz/vendor/symfony/yaml/Inline.php
Changed
@@ -653,7 +653,7 @@ // no break case '+' === $scalar[0] || '-' === $scalar[0] || '.' === $scalar[0] || is_numeric($scalar[0]): if (Parser::preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar)) { - $scalar = str_replace('_', '', (string) $scalar); + $scalar = str_replace('_', '', $scalar); } switch (true) {
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/LICENSE.txt
Added
@@ -0,0 +1,27 @@ +Copyright (c) 2005-2015, Zend Technologies USA, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Zend Technologies USA, Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/README.md
Added
@@ -0,0 +1,22 @@ +Zend Framework 1 for Composer +============================= + +This package is a part of the Zend Framework 1. Each component was separated and put into its own composer package. Some modifications were made for improved [Composer](http://getcomposer.org/) integration. This package can also be found at [Packagist](http://packagist.org/packages/zf1). + +## Why? + +**Size!** Zend Framework is very large and contains a huge amount of files (over 72000 files in the main repository!). If you're only using a part of the framework, using the separated packages will greatly reduce the amount of files. This will make setup faster and easier on your disks. + +**Autoloading!** Explicit `require_once` calls in the source code has been commented out to rely on composer autoloading, this reduces the number of included files to a minimum. + +**Migration!** Zend Framework 2 has been around for a while now, and migrating all your projects takes a lot of time. Using these packages makes it easier to migrate each component separately. Also, some packages doesn't exist in zf2 (such as the zend-search-lucene), now you can continue using that package without requiring the entire framework. + +If you're using major parts of the framework, I would recommend checking out the [zendframework1 package](https://github.com/bombayworks/zendframework1), which contains the entire framework optimized for composer usage. + +## How to use + +Add `"zf1/zend-json": "~1.12"` to the require section of your composer.json, include the composer autoloader and you're good to go. + +## Broken dependencies? + +Dependencies have been set automatically based on the [requirements from the zend framework manual](http://framework.zend.com/manual/1.12/en/requirements.introduction.html), if you find any broken dependencies please submit an issue. \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/composer.json
Added
@@ -0,0 +1,24 @@ +{ + "name": "zf1/zend-json", + "description": "Zend Framework 1 Json package", + "keywords": [ + "framework", + "zf1", + "zend", + "json" + ], + "homepage": "http://framework.zend.com/", + "license": "BSD-3-Clause", + "require": { + "php": ">=5.2.11", + "zf1/zend-exception": "self.version", + "zf1/zend-loader": "self.version", + "zf1/zend-server": "self.version", + "zf1/zend-xml": "self.version" + }, + "autoload": { + "psr-0": { + "Zend_Json": "library/" + } + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json.php
Added
@@ -0,0 +1,442 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * Zend_Json_Expr. + * + * @see Zend_Json_Expr + */ +// require_once 'Zend/Json/Expr.php'; + +/** @see Zend_Xml_Security */ +// require_once 'Zend/Xml/Security.php'; + +/** + * Class for encoding to and decoding from JSON. + * + * @category Zend + * @package Zend_Json + * @uses Zend_Json_Expr + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json +{ + /** + * How objects should be encoded -- arrays or as StdClass. TYPE_ARRAY is 1 + * so that it is a boolean true value, allowing it to be used with + * ext/json's functions. + */ + const TYPE_ARRAY = 1; + const TYPE_OBJECT = 0; + + /** + * To check the allowed nesting depth of the XML tree during xml2json conversion. + * + * @var int + */ + public static $maxRecursionDepthAllowed=25; + + /** + * @var bool + */ + public static $useBuiltinEncoderDecoder = false; + + /** + * Decodes the given $encodedValue string which is + * encoded in the JSON format + * + * Uses ext/json's json_decode if available. + * + * @param string $encodedValue Encoded in JSON format + * @param int $objectDecodeType Optional; flag indicating how to decode + * objects. See {@link Zend_Json_Decoder::decode()} for details. + * @return mixed + */ + public static function decode($encodedValue, $objectDecodeType = Zend_Json::TYPE_ARRAY) + { + $encodedValue = (string) $encodedValue; + if (function_exists('json_decode') && self::$useBuiltinEncoderDecoder !== true) { + $decode = json_decode($encodedValue, $objectDecodeType); + + // php < 5.3 + if (!function_exists('json_last_error')) { + if (strtolower($encodedValue) === 'null') { + return null; + } elseif ($decode === null) { + // require_once 'Zend/Json/Exception.php'; + throw new Zend_Json_Exception('Decoding failed'); + } + // php >= 5.3 + } elseif (($jsonLastErr = json_last_error()) != JSON_ERROR_NONE) { + // require_once 'Zend/Json/Exception.php'; + switch ($jsonLastErr) { + case JSON_ERROR_DEPTH: + throw new Zend_Json_Exception('Decoding failed: Maximum stack depth exceeded'); + case JSON_ERROR_CTRL_CHAR: + throw new Zend_Json_Exception('Decoding failed: Unexpected control character found'); + case JSON_ERROR_SYNTAX: + throw new Zend_Json_Exception('Decoding failed: Syntax error'); + default: + throw new Zend_Json_Exception('Decoding failed'); + } + } + + return $decode; + } + + // require_once 'Zend/Json/Decoder.php'; + return Zend_Json_Decoder::decode($encodedValue, $objectDecodeType); + } + + /** + * Encode the mixed $valueToEncode into the JSON format + * + * Encodes using ext/json's json_encode() if available. + * + * NOTE: Object should not contain cycles; the JSON format + * does not allow object reference. + * + * NOTE: Only public variables will be encoded + * + * NOTE: Encoding native javascript expressions are possible using Zend_Json_Expr. + * You can enable this by setting $options['enableJsonExprFinder'] = true + * + * @see Zend_Json_Expr + * + * @param mixed $valueToEncode + * @param boolean $cycleCheck Optional; whether or not to check for object recursion; off by default + * @param array $options Additional options used during encoding + * @return string JSON encoded object + */ + public static function encode($valueToEncode, $cycleCheck = false, $options = array()) + { + if (is_object($valueToEncode)) { + if (method_exists($valueToEncode, 'toJson')) { + return $valueToEncode->toJson(); + } elseif (method_exists($valueToEncode, 'toArray')) { + return self::encode($valueToEncode->toArray(), $cycleCheck, $options); + } + } + + // Pre-encoding look for Zend_Json_Expr objects and replacing by tmp ids + $javascriptExpressions = array(); + if(isset($options['enableJsonExprFinder']) + && ($options['enableJsonExprFinder'] == true) + ) { + /** + * @see Zend_Json_Encoder + */ + // require_once "Zend/Json/Encoder.php"; + $valueToEncode = self::_recursiveJsonExprFinder($valueToEncode, $javascriptExpressions); + } + + // Encoding + if (function_exists('json_encode') && self::$useBuiltinEncoderDecoder !== true) { + $encodedResult = json_encode($valueToEncode); + } else { + // require_once 'Zend/Json/Encoder.php'; + $encodedResult = Zend_Json_Encoder::encode($valueToEncode, $cycleCheck, $options); + } + + //only do post-proccessing to revert back the Zend_Json_Expr if any. + if (count($javascriptExpressions) > 0) { + $count = count($javascriptExpressions); + for($i = 0; $i < $count; $i++) { + $magicKey = $javascriptExpressions[$i]['magicKey']; + $value = $javascriptExpressions[$i]['value']; + + $encodedResult = str_replace( + //instead of replacing "key:magicKey", we replace directly magicKey by value because "key" never changes. + '"' . $magicKey . '"', + $value, + $encodedResult + ); + } + } + + return $encodedResult; + } + + /** + * Check & Replace Zend_Json_Expr for tmp ids in the valueToEncode + * + * Check if the value is a Zend_Json_Expr, and if replace its value + * with a magic key and save the javascript expression in an array. + * + * NOTE this method is recursive. + * + * NOTE: This method is used internally by the encode method. + * + * @see encode + * @param array|object|Zend_Json_Expr $value a string - object property to be encoded + * @param array $javascriptExpressions + * @param null $currentKey + * + * @internal param mixed $valueToCheck + * @return void + */ + protected static function _recursiveJsonExprFinder(&$value, array &$javascriptExpressions, $currentKey = null) + { + if ($value instanceof Zend_Json_Expr) {
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Decoder.php
Added
@@ -0,0 +1,581 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * @see Zend_Json + */ +// require_once 'Zend/Json.php'; + +/** + * Decode JSON encoded string to PHP variable constructs + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Decoder +{ + /** + * Parse tokens used to decode the JSON object. These are not + * for public consumption, they are just used internally to the + * class. + */ + const EOF = 0; + const DATUM = 1; + const LBRACE = 2; + const LBRACKET = 3; + const RBRACE = 4; + const RBRACKET = 5; + const COMMA = 6; + const COLON = 7; + + /** + * Use to maintain a "pointer" to the source being decoded + * + * @var string + */ + protected $_source; + + /** + * Caches the source length + * + * @var int + */ + protected $_sourceLength; + + /** + * The offset within the souce being decoded + * + * @var int + * + */ + protected $_offset; + + /** + * The current token being considered in the parser cycle + * + * @var int + */ + protected $_token; + + /** + * Flag indicating how objects should be decoded + * + * @var int + * @access protected + */ + protected $_decodeType; + + /** + * Constructor + * + * @param string $source String source to decode + * @param int $decodeType How objects should be decoded -- see + * {@link Zend_Json::TYPE_ARRAY} and {@link Zend_Json::TYPE_OBJECT} for + * valid values + * @return void + */ + protected function __construct($source, $decodeType) + { + // Set defaults + $this->_source = self::decodeUnicodeString($source); + $this->_sourceLength = strlen($this->_source); + $this->_token = self::EOF; + $this->_offset = 0; + + // Normalize and set $decodeType + if (!in_array($decodeType, array(Zend_Json::TYPE_ARRAY, Zend_Json::TYPE_OBJECT))) + { + $decodeType = Zend_Json::TYPE_ARRAY; + } + $this->_decodeType = $decodeType; + + // Set pointer at first token + $this->_getNextToken(); + } + + /** + * Decode a JSON source string + * + * Decodes a JSON encoded string. The value returned will be one of the + * following: + * - integer + * - float + * - boolean + * - null + * - StdClass + * - array + * - array of one or more of the above types + * + * By default, decoded objects will be returned as associative arrays; to + * return a StdClass object instead, pass {@link Zend_Json::TYPE_OBJECT} to + * the $objectDecodeType parameter. + * + * Throws a Zend_Json_Exception if the source string is null. + * + * @static + * @access public + * @param string $source String to be decoded + * @param int $objectDecodeType How objects should be decoded; should be + * either or {@link Zend_Json::TYPE_ARRAY} or + * {@link Zend_Json::TYPE_OBJECT}; defaults to TYPE_ARRAY + * @return mixed + * @throws Zend_Json_Exception + */ + public static function decode($source = null, $objectDecodeType = Zend_Json::TYPE_ARRAY) + { + if (null === $source) { + // require_once 'Zend/Json/Exception.php'; + throw new Zend_Json_Exception('Must specify JSON encoded source for decoding'); + } elseif (!is_string($source)) { + // require_once 'Zend/Json/Exception.php'; + throw new Zend_Json_Exception('Can only decode JSON encoded strings'); + } + + $decoder = new self($source, $objectDecodeType); + + return $decoder->_decodeValue(); + } + + + /** + * Recursive driving rountine for supported toplevel tops + * + * @return mixed + */ + protected function _decodeValue() + { + switch ($this->_token) { + case self::DATUM: + $result = $this->_tokenValue; + $this->_getNextToken(); + return($result); + break; + case self::LBRACE: + return($this->_decodeObject()); + break; + case self::LBRACKET: + return($this->_decodeArray()); + break; + default: + return null; + break; + } + } + + /** + * Decodes an object of the form: + * { "attribute: value, "attribute2" : value,...} + * + * If Zend_Json_Encoder was used to encode the original object then + * a special attribute called __className which specifies a class + * name that should wrap the data contained within the encoded source. + * + * Decodes to either an array or StdClass object, based on the value of + * {@link $_decodeType}. If invalid $_decodeType present, returns as an + * array. + * + * @return array|StdClass + */ + protected function _decodeObject()
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Encoder.php
Added
@@ -0,0 +1,578 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * Encode PHP constructs to JSON + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Encoder +{ + /** + * Whether or not to check for possible cycling + * + * @var boolean + */ + protected $_cycleCheck; + + /** + * Additional options used during encoding + * + * @var array + */ + protected $_options = array(); + + /** + * Array of visited objects; used to prevent cycling. + * + * @var array + */ + protected $_visited = array(); + + /** + * Constructor + * + * @param boolean $cycleCheck Whether or not to check for recursion when encoding + * @param array $options Additional options used during encoding + * @return void + */ + protected function __construct($cycleCheck = false, $options = array()) + { + $this->_cycleCheck = $cycleCheck; + $this->_options = $options; + } + + /** + * Use the JSON encoding scheme for the value specified + * + * @param mixed $value The value to be encoded + * @param boolean $cycleCheck Whether or not to check for possible object recursion when encoding + * @param array $options Additional options used during encoding + * @return string The encoded value + */ + public static function encode($value, $cycleCheck = false, $options = array()) + { + $encoder = new self(($cycleCheck) ? true : false, $options); + return $encoder->_encodeValue($value); + } + + /** + * Recursive driver which determines the type of value to be encoded + * and then dispatches to the appropriate method. $values are either + * - objects (returns from {@link _encodeObject()}) + * - arrays (returns from {@link _encodeArray()}) + * - basic datums (e.g. numbers or strings) (returns from {@link _encodeDatum()}) + * + * @param mixed $value The value to be encoded + * @return string Encoded value + */ + protected function _encodeValue(&$value) + { + if (is_object($value)) { + return $this->_encodeObject($value); + } else if (is_array($value)) { + return $this->_encodeArray($value); + } + + return $this->_encodeDatum($value); + } + + + + /** + * Encode an object to JSON by encoding each of the public properties + * + * A special property is added to the JSON object called '__className' + * that contains the name of the class of $value. This is used to decode + * the object on the client into a specific class. + * + * @param object $value + * @return string + * @throws Zend_Json_Exception If recursive checks are enabled and the object has been serialized previously + */ + protected function _encodeObject(&$value) + { + if ($this->_cycleCheck) { + if ($this->_wasVisited($value)) { + + if (isset($this->_options['silenceCyclicalExceptions']) + && $this->_options['silenceCyclicalExceptions']===true) { + + return '"* RECURSION (' . get_class($value) . ') *"'; + + } else { + // require_once 'Zend/Json/Exception.php'; + throw new Zend_Json_Exception( + 'Cycles not supported in JSON encoding, cycle introduced by ' + . 'class "' . get_class($value) . '"' + ); + } + } + + $this->_visited[] = $value; + } + + $props = ''; + if (method_exists($value, 'toJson')) { + $props =',' . preg_replace("/^\{(.*)\}$/","\\1",$value->toJson()); + } else { + if ($value instanceof IteratorAggregate) { + $propCollection = $value->getIterator(); + } elseif ($value instanceof Iterator) { + $propCollection = $value; + } else { + $propCollection = get_object_vars($value); + } + + foreach ($propCollection as $name => $propValue) { + if (isset($propValue)) { + $props .= ',' + . $this->_encodeString($name) + . ':' + . $this->_encodeValue($propValue); + } + } + } + $className = get_class($value); + return '{"__className":' . $this->_encodeString($className) + . $props . '}'; + } + + + /** + * Determine if an object has been serialized already + * + * @param mixed $value + * @return boolean + */ + protected function _wasVisited(&$value) + { + if (in_array($value, $this->_visited, true)) { + return true; + } + + return false; + } + + + /** + * JSON encode an array value + * + * Recursively encodes each value of an array and returns a JSON encoded + * array string. + * + * Arrays are defined as integer-indexed arrays starting at index 0, where + * the last index is (count($array) -1); any deviation from that is + * considered an associative array, and will be encoded as such. + * + * @param array& $array + * @return string + */ + protected function _encodeArray(&$array) + { + $tmpArray = array(); + + // Check for associative array + if (!empty($array) && (array_keys($array) !== range(0, count($array) - 1))) { + // Associative array + $result = '{';
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Exception.php
Added
@@ -0,0 +1,37 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + + +/** + * Zend_Exception + */ +// require_once 'Zend/Exception.php'; + + +/** + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Exception extends Zend_Exception +{} +
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Expr.php
Added
@@ -0,0 +1,80 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @subpackage Expr + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * Class for Zend_Json encode method. + * + * This class simply holds a string with a native Javascript Expression, + * so objects | arrays to be encoded with Zend_Json can contain native + * Javascript Expressions. + * + * Example: + * <code> + * $foo = array( + * 'integer' =>9, + * 'string' =>'test string', + * 'function' => Zend_Json_Expr( + * 'function(){ window.alert("javascript function encoded by Zend_Json") }' + * ), + * ); + * + * Zend_Json::encode($foo, false, array('enableJsonExprFinder' => true)); + * // it will returns json encoded string: + * // {"integer":9,"string":"test string","function":function(){window.alert("javascript function encoded by Zend_Json")}} + * </code> + * + * @category Zend + * @package Zend_Json + * @subpackage Expr + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Expr +{ + /** + * Storage for javascript expression. + * + * @var string + */ + protected $_expression; + + /** + * Constructor + * + * @param string $expression the expression to hold. + * @return void + */ + public function __construct($expression) + { + $this->_expression = (string) $expression; + } + + /** + * Cast to string + * + * @return string holded javascript expression. + */ + public function __toString() + { + return $this->_expression; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server.php
Added
@@ -0,0 +1,568 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * @see Zend_Server_Abstract + */ +// require_once 'Zend/Server/Abstract.php'; + +/** + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server extends Zend_Server_Abstract +{ + /**#@+ + * Version Constants + */ + const VERSION_1 = '1.0'; + const VERSION_2 = '2.0'; + /**#@-*/ + + /** + * Flag: whether or not to auto-emit the response + * @var bool + */ + protected $_autoEmitResponse = true; + + /** + * @var bool Flag; allow overwriting existing methods when creating server definition + */ + protected $_overwriteExistingMethods = true; + + /** + * Request object + * @var Zend_Json_Server_Request + */ + protected $_request; + + /** + * Response object + * @var Zend_Json_Server_Response + */ + protected $_response; + + /** + * SMD object + * @var Zend_Json_Server_Smd + */ + protected $_serviceMap; + + /** + * SMD class accessors + * @var array + */ + protected $_smdMethods; + + /** + * @var Zend_Server_Description + */ + protected $_table; + + /** + * Attach a function or callback to the server + * + * @param string|array $function Valid PHP callback + * @param string $namespace Ignored + * @return Zend_Json_Server + */ + public function addFunction($function, $namespace = '') + { + if (!is_string($function) && (!is_array($function) || (2 > count($function)))) { + // require_once 'Zend/Json/Server/Exception.php'; + throw new Zend_Json_Server_Exception('Unable to attach function; invalid'); + } + + if (!is_callable($function)) { + // require_once 'Zend/Json/Server/Exception.php'; + throw new Zend_Json_Server_Exception('Unable to attach function; does not exist'); + } + + $argv = null; + if (2 < func_num_args()) { + $argv = func_get_args(); + $argv = array_slice($argv, 2); + } + + // require_once 'Zend/Server/Reflection.php'; + if (is_string($function)) { + $method = Zend_Server_Reflection::reflectFunction($function, $argv, $namespace); + } else { + $class = array_shift($function); + $action = array_shift($function); + $reflection = Zend_Server_Reflection::reflectClass($class, $argv, $namespace); + $methods = $reflection->getMethods(); + $found = false; + foreach ($methods as $method) { + if ($action == $method->getName()) { + $found = true; + break; + } + } + if (!$found) { + $this->fault('Method not found', -32601); + return $this; + } + } + + $definition = $this->_buildSignature($method); + $this->_addMethodServiceMap($definition); + + return $this; + } + + /** + * Register a class with the server + * + * @param string $class + * @param string $namespace Ignored + * @param mixed $argv Ignored + * @return Zend_Json_Server + */ + public function setClass($class, $namespace = '', $argv = null) + { + $argv = null; + if (3 < func_num_args()) { + $argv = func_get_args(); + $argv = array_slice($argv, 3); + } + + // require_once 'Zend/Server/Reflection.php'; + $reflection = Zend_Server_Reflection::reflectClass($class, $argv, $namespace); + + foreach ($reflection->getMethods() as $method) { + $definition = $this->_buildSignature($method, $class); + $this->_addMethodServiceMap($definition); + } + return $this; + } + + /** + * Indicate fault response + * + * @param string $fault + * @param int $code + * @return false + */ + public function fault($fault = null, $code = 404, $data = null) + { + // require_once 'Zend/Json/Server/Error.php'; + $error = new Zend_Json_Server_Error($fault, $code, $data); + $this->getResponse()->setError($error); + return $error; + } + + /** + * Handle request + * + * @param Zend_Json_Server_Request $request + * @return null|Zend_Json_Server_Response + */ + public function handle($request = false) + { + if ((false !== $request) && (!$request instanceof Zend_Json_Server_Request)) { + // require_once 'Zend/Json/Server/Exception.php'; + throw new Zend_Json_Server_Exception('Invalid request type provided; cannot handle'); + } elseif ($request) { + $this->setRequest($request); + } + + // Handle request + $this->_handle(); + + // Get response + $response = $this->_getReadyResponse(); + + // Emit response? + if ($this->autoEmitResponse()) { + echo $response; + return;
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Cache.php
Added
@@ -0,0 +1,102 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** Zend_Server_Cache */ +// require_once 'Zend/Server/Cache.php'; + +/** + * Zend_Json_Server_Cache: cache Zend_Json_Server server definition and SMD + * + * @category Zend + * @package Zend_Json + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server_Cache extends Zend_Server_Cache +{ + /** + * Cache a service map description (SMD) to a file + * + * Returns true on success, false on failure + * + * @param string $filename + * @param Zend_Json_Server $server + * @return boolean + */ + public static function saveSmd($filename, Zend_Json_Server $server) + { + if (!is_string($filename) + || (!file_exists($filename) && !is_writable(dirname($filename)))) + { + return false; + } + + if (0 === @file_put_contents($filename, $server->getServiceMap()->toJson())) { + return false; + } + + return true; + } + + /** + * Retrieve a cached SMD + * + * On success, returns the cached SMD (a JSON string); an failure, returns + * boolean false. + * + * @param string $filename + * @return string|false + */ + public static function getSmd($filename) + { + if (!is_string($filename) + || !file_exists($filename) + || !is_readable($filename)) + { + return false; + } + + + if (false === ($smd = @file_get_contents($filename))) { + return false; + } + + return $smd; + } + + /** + * Delete a file containing a cached SMD + * + * @param string $filename + * @return bool + */ + public static function deleteSmd($filename) + { + if (is_string($filename) && file_exists($filename)) { + unlink($filename); + return true; + } + + return false; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Error.php
Added
@@ -0,0 +1,198 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server_Error +{ + const ERROR_PARSE = -32768; + const ERROR_INVALID_REQUEST = -32600; + const ERROR_INVALID_METHOD = -32601; + const ERROR_INVALID_PARAMS = -32602; + const ERROR_INTERNAL = -32603; + const ERROR_OTHER = -32000; + + /** + * Allowed error codes + * @var array + */ + protected $_allowedCodes = array( + self::ERROR_PARSE, + self::ERROR_INVALID_REQUEST, + self::ERROR_INVALID_METHOD, + self::ERROR_INVALID_PARAMS, + self::ERROR_INTERNAL, + self::ERROR_OTHER, + ); + + /** + * Current code + * @var int + */ + protected $_code = -32000; + + /** + * Error data + * @var mixed + */ + protected $_data; + + /** + * Error message + * @var string + */ + protected $_message; + + /** + * Constructor + * + * @param string $message + * @param int $code + * @param mixed $data + * @return void + */ + public function __construct($message = null, $code = -32000, $data = null) + { + $this->setMessage($message) + ->setCode($code) + ->setData($data); + } + + /** + * Set error code + * + * @param int $code + * @return Zend_Json_Server_Error + */ + public function setCode($code) + { + if (!is_scalar($code)) { + return $this; + } + + $code = (int) $code; + if (in_array($code, $this->_allowedCodes)) { + $this->_code = $code; + } elseif (in_array($code, range(-32099, -32000))) { + $this->_code = $code; + } + + return $this; + } + + /** + * Get error code + * + * @return int|null + */ + public function getCode() + { + return $this->_code; + } + + /** + * Set error message + * + * @param string $message + * @return Zend_Json_Server_Error + */ + public function setMessage($message) + { + if (!is_scalar($message)) { + return $this; + } + + $this->_message = (string) $message; + return $this; + } + + /** + * Get error message + * + * @return string + */ + public function getMessage() + { + return $this->_message; + } + + /** + * Set error data + * + * @param mixed $data + * @return Zend_Json_Server_Error + */ + public function setData($data) + { + $this->_data = $data; + return $this; + } + + /** + * Get error data + * + * @return mixed + */ + public function getData() + { + return $this->_data; + } + + /** + * Cast error to array + * + * @return array + */ + public function toArray() + { + return array( + 'code' => $this->getCode(), + 'message' => $this->getMessage(), + 'data' => $this->getData(), + ); + } + + /** + * Cast error to JSON + * + * @return string + */ + public function toJson() + { + // require_once 'Zend/Json.php'; + return Zend_Json::encode($this->toArray()); + } + + /** + * Cast to string (JSON) + * + * @return string + */ + public function __toString() + { + return $this->toJson(); + } +} +
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Exception.php
Added
@@ -0,0 +1,36 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** Zend_Json_Exception */ +// require_once 'Zend/Json/Exception.php'; + +/** + * Zend_Json_Server exceptions + * + * @uses Zend_Json_Exception + * @package Zend_Json + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server_Exception extends Zend_Json_Exception +{ +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Request
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Request.php
Added
@@ -0,0 +1,289 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * @category Zend + * @package Zend_Json + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server_Request +{ + /** + * Request ID + * @var mixed + */ + protected $_id; + + /** + * Flag + * @var bool + */ + protected $_isMethodError = false; + + /** + * Requested method + * @var string + */ + protected $_method; + + /** + * Regex for method + * @var string + */ + protected $_methodRegex = '/^[a-z][a-z0-9_.]*$/i'; + + /** + * Request parameters + * @var array + */ + protected $_params = array(); + + /** + * JSON-RPC version of request + * @var string + */ + protected $_version = '1.0'; + + /** + * Set request state + * + * @param array $options + * @return Zend_Json_Server_Request + */ + public function setOptions(array $options) + { + $methods = get_class_methods($this); + foreach ($options as $key => $value) { + $method = 'set' . ucfirst($key); + if (in_array($method, $methods)) { + $this->$method($value); + } elseif ($key == 'jsonrpc') { + $this->setVersion($value); + } + } + return $this; + } + + /** + * Add a parameter to the request + * + * @param mixed $value + * @param string $key + * @return Zend_Json_Server_Request + */ + public function addParam($value, $key = null) + { + if ((null === $key) || !is_string($key)) { + $index = count($this->_params); + $this->_params[$index] = $value; + } else { + $this->_params[$key] = $value; + } + + return $this; + } + + /** + * Add many params + * + * @param array $params + * @return Zend_Json_Server_Request + */ + public function addParams(array $params) + { + foreach ($params as $key => $value) { + $this->addParam($value, $key); + } + return $this; + } + + /** + * Overwrite params + * + * @param array $params + * @return Zend_Json_Server_Request + */ + public function setParams(array $params) + { + $this->_params = array(); + return $this->addParams($params); + } + + /** + * Retrieve param by index or key + * + * @param int|string $index + * @return mixed|null Null when not found + */ + public function getParam($index) + { + if (array_key_exists($index, $this->_params)) { + return $this->_params[$index]; + } + + return null; + } + + /** + * Retrieve parameters + * + * @return array + */ + public function getParams() + { + return $this->_params; + } + + /** + * Set request method + * + * @param string $name + * @return Zend_Json_Server_Request + */ + public function setMethod($name) + { + if (!preg_match($this->_methodRegex, $name)) { + $this->_isMethodError = true; + } else { + $this->_method = $name; + } + return $this; + } + + /** + * Get request method name + * + * @return string + */ + public function getMethod() + { + return $this->_method; + } + + /** + * Was a bad method provided? + * + * @return bool + */ + public function isMethodError() + { + return $this->_isMethodError; + } + + /** + * Set request identifier + * + * @param mixed $name + * @return Zend_Json_Server_Request + */
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Request/Http.php
Added
@@ -0,0 +1,66 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * @see Zend_Json_Server_Request + */ +// require_once 'Zend/Json/Server/Request.php'; + +/** + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server_Request_Http extends Zend_Json_Server_Request +{ + /** + * Raw JSON pulled from POST body + * @var string + */ + protected $_rawJson; + + /** + * Constructor + * + * Pull JSON request from raw POST body and use to populate request. + * + * @return void + */ + public function __construct() + { + $json = file_get_contents('php://input'); + $this->_rawJson = $json; + if (!empty($json)) { + $this->loadJson($json); + } + } + + /** + * Get JSON from raw POST body + * + * @return string + */ + public function getRawJson() + { + return $this->_rawJson; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Response
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Response.php
Added
@@ -0,0 +1,249 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * @category Zend + * @package Zend_Json + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server_Response +{ + /** + * Response error + * @var null|Zend_Json_Server_Error + */ + protected $_error; + + /** + * Request ID + * @var mixed + */ + protected $_id; + + /** + * Result + * @var mixed + */ + protected $_result; + + /** + * Service map + * @var Zend_Json_Server_Smd + */ + protected $_serviceMap; + + /** + * JSON-RPC version + * @var string + */ + protected $_version; + + /** + * Set result + * + * @param mixed $value + * @return Zend_Json_Server_Response + */ + public function setResult($value) + { + $this->_result = $value; + return $this; + } + + /** + * Get result + * + * @return mixed + */ + public function getResult() + { + return $this->_result; + } + + // RPC error, if response results in fault + /** + * Set result error + * + * @param Zend_Json_Server_Error $error + * @return Zend_Json_Server_Response + */ + public function setError(Zend_Json_Server_Error $error) + { + $this->_error = $error; + return $this; + } + + /** + * Get response error + * + * @return null|Zend_Json_Server_Error + */ + public function getError() + { + return $this->_error; + } + + /** + * Is the response an error? + * + * @return bool + */ + public function isError() + { + return $this->getError() instanceof Zend_Json_Server_Error; + } + + /** + * Set request ID + * + * @param mixed $name + * @return Zend_Json_Server_Response + */ + public function setId($name) + { + $this->_id = $name; + return $this; + } + + /** + * Get request ID + * + * @return mixed + */ + public function getId() + { + return $this->_id; + } + + /** + * Set JSON-RPC version + * + * @param string $version + * @return Zend_Json_Server_Response + */ + public function setVersion($version) + { + $version = is_array($version) + ? implode(' ', $version) + : $version; + if ((string)$version == '2.0') { + $this->_version = '2.0'; + } else { + $this->_version = null; + } + return $this; + } + + /** + * Retrieve JSON-RPC version + * + * @return string + */ + public function getVersion() + { + return $this->_version; + } + + /** + * Cast to JSON + * + * @return string + */ + public function toJson() + { + if ($this->isError()) { + $response = array( + 'error' => $this->getError()->toArray(), + 'id' => $this->getId(), + ); + } else { + $response = array( + 'result' => $this->getResult(), + 'id' => $this->getId(), + ); + } + + if (null !== ($version = $this->getVersion())) { + $response['jsonrpc'] = $version; + } + + // require_once 'Zend/Json.php'; + return Zend_Json::encode($response); + } + + /** + * Retrieve args + * + * @return mixed + */
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Response/Http.php
Added
@@ -0,0 +1,81 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * @see Zend_Json_Server_Response + */ +// require_once 'Zend/Json/Server/Response.php'; + +/** + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server_Response_Http extends Zend_Json_Server_Response +{ + /** + * Emit JSON + * + * Send appropriate HTTP headers. If no Id, then return an empty string. + * + * @return string + */ + public function toJson() + { + $this->sendHeaders(); + if (!$this->isError() && null === $this->getId()) { + return ''; + } + + return parent::toJson(); + } + + /** + * Send headers + * + * If headers are already sent, do nothing. If null ID, send HTTP 204 + * header. Otherwise, send content type header based on content type of + * service map. + * + * @return void + */ + public function sendHeaders() + { + if (headers_sent()) { + return; + } + + if (!$this->isError() && (null === $this->getId())) { + header('HTTP/1.1 204 No Content'); + return; + } + + if (null === ($smd = $this->getServiceMap())) { + return; + } + + $contentType = $smd->getContentType(); + if (!empty($contentType)) { + header('Content-Type: ' . $contentType); + } + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Smd
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Smd.php
Added
@@ -0,0 +1,480 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * @category Zend + * @package Zend_Json + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server_Smd +{ + const ENV_JSONRPC_1 = 'JSON-RPC-1.0'; + const ENV_JSONRPC_2 = 'JSON-RPC-2.0'; + const SMD_VERSION = '2.0'; + + /** + * Content type + * @var string + */ + protected $_contentType = 'application/json'; + + /** + * Content type regex + * @var string + */ + protected $_contentTypeRegex = '#[a-z]+/[a-z][a-z-]+#i'; + + /** + * Service description + * @var string + */ + protected $_description; + + /** + * Generate Dojo-compatible SMD + * @var bool + */ + protected $_dojoCompatible = false; + + /** + * Current envelope + * @var string + */ + protected $_envelope = self::ENV_JSONRPC_1; + + /** + * Allowed envelope types + * @var array + */ + protected $_envelopeTypes = array( + self::ENV_JSONRPC_1, + self::ENV_JSONRPC_2, + ); + + /** + * Service id + * @var string + */ + protected $_id; + + /** + * Services offerred + * @var array + */ + protected $_services = array(); + + /** + * Service target + * @var string + */ + protected $_target; + + /** + * Global transport + * @var string + */ + protected $_transport = 'POST'; + + /** + * Allowed transport types + * @var array + */ + protected $_transportTypes = array('POST'); + + /** + * Set object state via options + * + * @param array $options + * @return Zend_Json_Server_Smd + */ + public function setOptions(array $options) + { + $methods = get_class_methods($this); + foreach ($options as $key => $value) { + $method = 'set' . ucfirst($key); + if (in_array($method, $methods)) { + $this->$method($value); + } + } + return $this; + } + + /** + * Set transport + * + * @param string $transport + * @return Zend_Json_Server_Smd + */ + public function setTransport($transport) + { + if (!in_array($transport, $this->_transportTypes)) { + // require_once 'Zend/Json/Server/Exception.php'; + throw new Zend_Json_Server_Exception(sprintf('Invalid transport "%s" specified', $transport)); + } + $this->_transport = $transport; + return $this; + } + + /** + * Get transport + * + * @return string + */ + public function getTransport() + { + return $this->_transport; + } + + /** + * Set envelope + * + * @param string $envelopeType + * @return Zend_Json_Server_Smd + */ + public function setEnvelope($envelopeType) + { + if (!in_array($envelopeType, $this->_envelopeTypes)) { + // require_once 'Zend/Json/Server/Exception.php'; + throw new Zend_Json_Server_Exception(sprintf('Invalid envelope type "%s"', $envelopeType)); + } + $this->_envelope = $envelopeType; + return $this; + } + + /** + * Retrieve envelope + * + * @return string + */ + public function getEnvelope() + { + return $this->_envelope; + } + + // Content-Type of response; default to application/json + /** + * Set content type + * + * @param string $type + * @return Zend_Json_Server_Smd + */ + public function setContentType($type) + { + if (!preg_match($this->_contentTypeRegex, $type)) { + // require_once 'Zend/Json/Server/Exception.php'; + throw new Zend_Json_Server_Exception(sprintf('Invalid content type "%s" specified', $type)); + } + $this->_contentType = $type; + return $this; + } + + /** + * Retrieve content type + * + * @return string + */ + public function getContentType() + { + return $this->_contentType;
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-json/library/Zend/Json/Server/Smd/Service.php
Added
@@ -0,0 +1,473 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * @see Zend_Json_Server_Smd + */ +// require_once 'Zend/Json/Server/Smd.php'; + +/** + * Create Service Mapping Description for a method + * + * @package Zend_Json + * @subpackage Server + * @version $Id$ + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Server_Smd_Service +{ + /**#@+ + * Service metadata + * @var string + */ + protected $_envelope = Zend_Json_Server_Smd::ENV_JSONRPC_1; + protected $_name; + protected $_return; + protected $_target; + protected $_transport = 'POST'; + /**#@-*/ + + /** + * Allowed envelope types + * @var array + */ + protected $_envelopeTypes = array( + Zend_Json_Server_Smd::ENV_JSONRPC_1, + Zend_Json_Server_Smd::ENV_JSONRPC_2, + ); + + /** + * Regex for names + * @var string + */ + protected $_nameRegex = '/^[a-z][a-z0-9._]+$/i'; + + /** + * Parameter option types + * @var array + */ + protected $_paramOptionTypes = array( + 'name' => 'is_string', + 'optional' => 'is_bool', + 'default' => null, + 'description' => 'is_string', + ); + + /** + * Service params + * @var array + */ + protected $_params = array(); + + /** + * Mapping of parameter types to JSON-RPC types + * @var array + */ + protected $_paramMap = array( + 'any' => 'any', + 'arr' => 'array', + 'array' => 'array', + 'assoc' => 'object', + 'bool' => 'boolean', + 'boolean' => 'boolean', + 'dbl' => 'float', + 'double' => 'float', + 'false' => 'boolean', + 'float' => 'float', + 'hash' => 'object', + 'integer' => 'integer', + 'int' => 'integer', + 'mixed' => 'any', + 'nil' => 'null', + 'null' => 'null', + 'object' => 'object', + 'string' => 'string', + 'str' => 'string', + 'struct' => 'object', + 'true' => 'boolean', + 'void' => 'null', + ); + + /** + * Allowed transport types + * @var array + */ + protected $_transportTypes = array( + 'POST', + ); + + /** + * Constructor + * + * @param string|array $spec + * @return void + * @throws Zend_Json_Server_Exception if no name provided + */ + public function __construct($spec) + { + if (is_string($spec)) { + $this->setName($spec); + } elseif (is_array($spec)) { + $this->setOptions($spec); + } + + if (null == $this->getName()) { + // require_once 'Zend/Json/Server/Exception.php'; + throw new Zend_Json_Server_Exception('SMD service description requires a name; none provided'); + } + } + + /** + * Set object state + * + * @param array $options + * @return Zend_Json_Server_Smd_Service + */ + public function setOptions(array $options) + { + $methods = get_class_methods($this); + foreach ($options as $key => $value) { + if ('options' == strtolower($key)) { + continue; + } + $method = 'set' . ucfirst($key); + if (in_array($method, $methods)) { + $this->$method($value); + } + } + return $this; + } + + /** + * Set service name + * + * @param string $name + * @return Zend_Json_Server_Smd_Service + * @throws Zend_Json_Server_Exception + */ + public function setName($name) + { + $name = (string) $name; + if (!preg_match($this->_nameRegex, $name)) { + // require_once 'Zend/Json/Server/Exception.php'; + throw new Zend_Json_Server_Exception(sprintf('Invalid name "%s" provided for service; must follow PHP method naming conventions', $name)); + } + $this->_name = $name; + return $this; + } + + /** + * Retrieve name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Set Transport + * + * Currently limited to POST + * + * @param string $transport + * @return Zend_Json_Server_Smd_Service + */ + public function setTransport($transport) + { + if (!in_array($transport, $this->_transportTypes)) { + // require_once 'Zend/Json/Server/Exception.php'; + throw new Zend_Json_Server_Exception(sprintf('Invalid transport "%s"; please select one of (%s)', $transport, implode(', ', $this->_transportTypes)));
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/LICENSE.txt
Added
@@ -0,0 +1,27 @@ +Copyright (c) 2005-2015, Zend Technologies USA, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Zend Technologies USA, Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/README.md
Added
@@ -0,0 +1,22 @@ +Zend Framework 1 for Composer +============================= + +This package is a part of the Zend Framework 1. Each component was separated and put into its own composer package. Some modifications were made for improved [Composer](http://getcomposer.org/) integration. This package can also be found at [Packagist](http://packagist.org/packages/zf1). + +## Why? + +**Size!** Zend Framework is very large and contains a huge amount of files (over 72000 files in the main repository!). If you're only using a part of the framework, using the separated packages will greatly reduce the amount of files. This will make setup faster and easier on your disks. + +**Autoloading!** Explicit `require_once` calls in the source code has been commented out to rely on composer autoloading, this reduces the number of included files to a minimum. + +**Migration!** Zend Framework 2 has been around for a while now, and migrating all your projects takes a lot of time. Using these packages makes it easier to migrate each component separately. Also, some packages doesn't exist in zf2 (such as the zend-search-lucene), now you can continue using that package without requiring the entire framework. + +If you're using major parts of the framework, I would recommend checking out the [zendframework1 package](https://github.com/bombayworks/zendframework1), which contains the entire framework optimized for composer usage. + +## How to use + +Add `"zf1/zend-server": "~1.12"` to the require section of your composer.json, include the composer autoloader and you're good to go. + +## Broken dependencies? + +Dependencies have been set automatically based on the [requirements from the zend framework manual](http://framework.zend.com/manual/1.12/en/requirements.introduction.html), if you find any broken dependencies please submit an issue. \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/composer.json
Added
@@ -0,0 +1,21 @@ +{ + "name": "zf1/zend-server", + "description": "Zend Framework 1 Server package", + "keywords": [ + "framework", + "zf1", + "zend", + "server" + ], + "homepage": "http://framework.zend.com/", + "license": "BSD-3-Clause", + "require": { + "php": ">=5.2.11", + "zf1/zend-exception": "self.version" + }, + "autoload": { + "psr-0": { + "Zend_Server": "library/" + } + } +} \ No newline at end of file
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Abstract.php
Added
@@ -0,0 +1,242 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** Zend_Server_Interface */ +// require_once 'Zend/Server/Interface.php'; + +/** + * Zend_Server_Definition + */ +// require_once 'Zend/Server/Definition.php'; + +/** + * Zend_Server_Method_Definition + */ +// require_once 'Zend/Server/Method/Definition.php'; + +/** + * Zend_Server_Method_Callback + */ +// require_once 'Zend/Server/Method/Callback.php'; + +/** + * Zend_Server_Method_Prototype + */ +// require_once 'Zend/Server/Method/Prototype.php'; + +/** + * Zend_Server_Method_Parameter + */ +// require_once 'Zend/Server/Method/Parameter.php'; + +/** + * Zend_Server_Abstract + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +abstract class Zend_Server_Abstract implements Zend_Server_Interface +{ + /** + * @deprecated + * @var array List of PHP magic methods (lowercased) + */ + protected static $magic_methods = array( + '__call', + '__clone', + '__construct', + '__destruct', + '__get', + '__isset', + '__set', + '__set_state', + '__sleep', + '__tostring', + '__unset', + '__wakeup', + ); + + /** + * @var bool Flag; whether or not overwriting existing methods is allowed + */ + protected $_overwriteExistingMethods = false; + + /** + * @var Zend_Server_Definition + */ + protected $_table; + + /** + * Constructor + * + * Setup server description + * + * @return void + */ + public function __construct() + { + $this->_table = new Zend_Server_Definition(); + $this->_table->setOverwriteExistingMethods($this->_overwriteExistingMethods); + } + + /** + * Returns a list of registered methods + * + * Returns an array of method definitions. + * + * @return Zend_Server_Definition + */ + public function getFunctions() + { + return $this->_table; + } + + /** + * Lowercase a string + * + * Lowercase's a string by reference + * + * @deprecated + * @param string $string value + * @param string $key + * @return string Lower cased string + */ + public static function lowerCase(&$value, &$key) + { + trigger_error(__CLASS__ . '::' . __METHOD__ . '() is deprecated and will be removed in a future version', E_USER_NOTICE); + return $value = strtolower($value); + } + + /** + * Build callback for method signature + * + * @param Zend_Server_Reflection_Function_Abstract $reflection + * @return Zend_Server_Method_Callback + */ + protected function _buildCallback(Zend_Server_Reflection_Function_Abstract $reflection) + { + $callback = new Zend_Server_Method_Callback(); + if ($reflection instanceof Zend_Server_Reflection_Method) { + $callback->setType($reflection->isStatic() ? 'static' : 'instance') + ->setClass($reflection->getDeclaringClass()->getName()) + ->setMethod($reflection->getName()); + } elseif ($reflection instanceof Zend_Server_Reflection_Function) { + $callback->setType('function') + ->setFunction($reflection->getName()); + } + return $callback; + } + + /** + * Build a method signature + * + * @param Zend_Server_Reflection_Function_Abstract $reflection + * @param null|string|object $class + * @return Zend_Server_Method_Definition + * @throws Zend_Server_Exception on duplicate entry + */ + protected function _buildSignature(Zend_Server_Reflection_Function_Abstract $reflection, $class = null) + { + $ns = $reflection->getNamespace(); + $name = $reflection->getName(); + $method = empty($ns) ? $name : $ns . '.' . $name; + + if (!$this->_overwriteExistingMethods && $this->_table->hasMethod($method)) { + // require_once 'Zend/Server/Exception.php'; + throw new Zend_Server_Exception('Duplicate method registered: ' . $method); + } + + $definition = new Zend_Server_Method_Definition(); + $definition->setName($method) + ->setCallback($this->_buildCallback($reflection)) + ->setMethodHelp($reflection->getDescription()) + ->setInvokeArguments($reflection->getInvokeArguments()); + + foreach ($reflection->getPrototypes() as $proto) { + $prototype = new Zend_Server_Method_Prototype(); + $prototype->setReturnType($this->_fixType($proto->getReturnType())); + foreach ($proto->getParameters() as $parameter) { + $param = new Zend_Server_Method_Parameter(array( + 'type' => $this->_fixType($parameter->getType()), + 'name' => $parameter->getName(), + 'optional' => $parameter->isOptional(), + )); + if ($parameter->isDefaultValueAvailable()) { + $param->setDefaultValue($parameter->getDefaultValue()); + } + $prototype->addParameter($param); + } + $definition->addPrototype($prototype); + } + if (is_object($class)) { + $definition->setObject($class); + } + $this->_table->addMethod($definition); + return $definition; + } + + /** + * Dispatch method
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Cache.php
Added
@@ -0,0 +1,147 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * Zend_Server_Cache: cache server definitions + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Server_Cache +{ + /** + * @var array Methods to skip when caching server + */ + protected static $_skipMethods = array(); + + /** + * Cache a file containing the dispatch list. + * + * Serializes the server definition stores the information + * in $filename. + * + * Returns false on any error (typically, inability to write to file), true + * on success. + * + * @param string $filename + * @param Zend_Server_Interface $server + * @return bool + */ + public static function save($filename, Zend_Server_Interface $server) + { + if (!is_string($filename) + || (!file_exists($filename) && !is_writable(dirname($filename)))) + { + return false; + } + + $methods = $server->getFunctions(); + + if ($methods instanceof Zend_Server_Definition) { + $definition = new Zend_Server_Definition(); + foreach ($methods as $method) { + if (in_array($method->getName(), self::$_skipMethods)) { + continue; + } + $definition->addMethod($method); + } + $methods = $definition; + } + + if (0 === @file_put_contents($filename, serialize($methods))) { + return false; + } + + return true; + } + + /** + * Load server definition from a file + * + * Unserializes a stored server definition from $filename. Returns false if + * it fails in any way, true on success. + * + * Useful to prevent needing to build the server definition on each + * request. Sample usage: + * + * <code> + * if (!Zend_Server_Cache::get($filename, $server)) { + * // require_once 'Some/Service/Class.php'; + * // require_once 'Another/Service/Class.php'; + * + * // Attach Some_Service_Class with namespace 'some' + * $server->attach('Some_Service_Class', 'some'); + * + * // Attach Another_Service_Class with namespace 'another' + * $server->attach('Another_Service_Class', 'another'); + * + * Zend_Server_Cache::save($filename, $server); + * } + * + * $response = $server->handle(); + * echo $response; + * </code> + * + * @param string $filename + * @param Zend_Server_Interface $server + * @return bool + */ + public static function get($filename, Zend_Server_Interface $server) + { + if (!is_string($filename) + || !file_exists($filename) + || !is_readable($filename)) + { + return false; + } + + + if (false === ($dispatch = @file_get_contents($filename))) { + return false; + } + + if (false === ($dispatchArray = @unserialize($dispatch))) { + return false; + } + + $server->loadFunctions($dispatchArray); + + return true; + } + + /** + * Remove a cache file + * + * @param string $filename + * @return boolean + */ + public static function delete($filename) + { + if (is_string($filename) && file_exists($filename)) { + unlink($filename); + return true; + } + + return false; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Definition.php
Added
@@ -0,0 +1,267 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * Server methods metadata + * + * @todo Implement iterator + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Server_Definition implements Countable, Iterator +{ + /** + * @var array Array of Zend_Server_Method_Definition objects + */ + protected $_methods = array(); + + /** + * @var bool Whether or not overwriting existing methods is allowed + */ + protected $_overwriteExistingMethods = false; + + /** + * Constructor + * + * @param null|array $methods + * @return void + */ + public function __construct($methods = null) + { + if (is_array($methods)) { + $this->setMethods($methods); + } + } + + /** + * Set flag indicating whether or not overwriting existing methods is allowed + * + * @param mixed $flag + * @return void + */ + public function setOverwriteExistingMethods($flag) + { + $this->_overwriteExistingMethods = (bool) $flag; + return $this; + } + + /** + * Add method to definition + * + * @param array|Zend_Server_Method_Definition $method + * @param null|string $name + * @return Zend_Server_Definition + * @throws Zend_Server_Exception if duplicate or invalid method provided + */ + public function addMethod($method, $name = null) + { + if (is_array($method)) { + // require_once 'Zend/Server/Method/Definition.php'; + $method = new Zend_Server_Method_Definition($method); + } elseif (!$method instanceof Zend_Server_Method_Definition) { + // require_once 'Zend/Server/Exception.php'; + throw new Zend_Server_Exception('Invalid method provided'); + } + + if (is_numeric($name)) { + $name = null; + } + if (null !== $name) { + $method->setName($name); + } else { + $name = $method->getName(); + } + if (null === $name) { + // require_once 'Zend/Server/Exception.php'; + throw new Zend_Server_Exception('No method name provided'); + } + + if (!$this->_overwriteExistingMethods && array_key_exists($name, $this->_methods)) { + // require_once 'Zend/Server/Exception.php'; + throw new Zend_Server_Exception(sprintf('Method by name of "%s" already exists', $name)); + } + $this->_methods[$name] = $method; + return $this; + } + + /** + * Add multiple methods + * + * @param array $methods Array of Zend_Server_Method_Definition objects or arrays + * @return Zend_Server_Definition + */ + public function addMethods(array $methods) + { + foreach ($methods as $key => $method) { + $this->addMethod($method, $key); + } + return $this; + } + + /** + * Set all methods at once (overwrite) + * + * @param array $methods Array of Zend_Server_Method_Definition objects or arrays + * @return Zend_Server_Definition + */ + public function setMethods(array $methods) + { + $this->clearMethods(); + $this->addMethods($methods); + return $this; + } + + /** + * Does the definition have the given method? + * + * @param string $method + * @return bool + */ + public function hasMethod($method) + { + return array_key_exists($method, $this->_methods); + } + + /** + * Get a given method definition + * + * @param string $method + * @return null|Zend_Server_Method_Definition + */ + public function getMethod($method) + { + if ($this->hasMethod($method)) { + return $this->_methods[$method]; + } + return false; + } + + /** + * Get all method definitions + * + * @return array Array of Zend_Server_Method_Definition objects + */ + public function getMethods() + { + return $this->_methods; + } + + /** + * Remove a method definition + * + * @param string $method + * @return Zend_Server_Definition + */ + public function removeMethod($method) + { + if ($this->hasMethod($method)) { + unset($this->_methods[$method]); + } + return $this; + } + + /** + * Clear all method definitions + * + * @return Zend_Server_Definition + */ + public function clearMethods() + { + $this->_methods = array(); + return $this; + } + + /** + * Cast definition to an array + * + * @return array + */ + public function toArray()
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Exception.php
Added
@@ -0,0 +1,35 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Zend_Exception + */ +// require_once 'Zend/Exception.php'; + +/** + * Zend_Server_Reflection exceptions + * + * @package Zend_Server + * @subpackage Reflection + * @version $Id$ + */ +class Zend_Server_Exception extends Zend_Exception +{ +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Interface.php
Added
@@ -0,0 +1,118 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Zend_Server_Interface + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +interface Zend_Server_Interface +{ + /** + * Attach a function as a server method + * + * Namespacing is primarily for xmlrpc, but may be used with other + * implementations to prevent naming collisions. + * + * @param string $function + * @param string $namespace + * @param null|array Optional array of arguments to pass to callbacks at + * dispatch. + * @return void + */ + public function addFunction($function, $namespace = ''); + + /** + * Attach a class to a server + * + * The individual implementations should probably allow passing a variable + * number of arguments in, so that developers may define custom runtime + * arguments to pass to server methods. + * + * Namespacing is primarily for xmlrpc, but could be used for other + * implementations as well. + * + * @param mixed $class Class name or object instance to examine and attach + * to the server. + * @param string $namespace Optional namespace with which to prepend method + * names in the dispatch table. + * methods in the class will be valid callbacks. + * @param null|array Optional array of arguments to pass to callbacks at + * dispatch. + * @return void + */ + public function setClass($class, $namespace = '', $argv = null); + + /** + * Generate a server fault + * + * @param mixed $fault + * @param int $code + * @return mixed + */ + public function fault($fault = null, $code = 404); + + /** + * Handle a request + * + * Requests may be passed in, or the server may automagically determine the + * request based on defaults. Dispatches server request to appropriate + * method and returns a response + * + * @param mixed $request + * @return mixed + */ + public function handle($request = false); + + /** + * Return a server definition array + * + * Returns a server definition array as created using + * {@link * Zend_Server_Reflection}. Can be used for server introspection, + * documentation, or persistence. + * + * @access public + * @return array + */ + public function getFunctions(); + + /** + * Load server definition + * + * Used for persistence; loads a construct as returned by {@link getFunctions()}. + * + * @param array $array + * @return void + */ + public function loadFunctions($definition); + + /** + * Set server persistence + * + * @todo Determine how to implement this + * @param int $mode + * @return void + */ + public function setPersistence($mode); +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Method
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Method/Callback.php
Added
@@ -0,0 +1,205 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @subpackage Method + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * Method callback metadata + * + * @category Zend + * @package Zend_Server + * @subpackage Method + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Server_Method_Callback +{ + /** + * @var string Class name for class method callback + */ + protected $_class; + + /** + * @var string Function name for function callback + */ + protected $_function; + + /** + * @var string Method name for class method callback + */ + protected $_method; + + /** + * @var string Callback type + */ + protected $_type; + + /** + * @var array Valid callback types + */ + protected $_types = array('function', 'static', 'instance'); + + /** + * Constructor + * + * @param null|array $options + * @return void + */ + public function __construct($options = null) + { + if ((null !== $options) && is_array($options)) { + $this->setOptions($options); + } + } + + /** + * Set object state from array of options + * + * @param array $options + * @return Zend_Server_Method_Callback + */ + public function setOptions(array $options) + { + foreach ($options as $key => $value) { + $method = 'set' . ucfirst($key); + if (method_exists($this, $method)) { + $this->$method($value); + } + } + return $this; + } + + /** + * Set callback class + * + * @param string $class + * @return Zend_Server_Method_Callback + */ + public function setClass($class) + { + if (is_object($class)) { + $class = get_class($class); + } + $this->_class = $class; + return $this; + } + + /** + * Get callback class + * + * @return string|null + */ + public function getClass() + { + return $this->_class; + } + + /** + * Set callback function + * + * @param string $function + * @return Zend_Server_Method_Callback + */ + public function setFunction($function) + { + $this->_function = (string) $function; + $this->setType('function'); + return $this; + } + + /** + * Get callback function + * + * @return null|string + */ + public function getFunction() + { + return $this->_function; + } + + /** + * Set callback class method + * + * @param string $method + * @return Zend_Server_Method_Callback + */ + public function setMethod($method) + { + $this->_method = $method; + return $this; + } + + /** + * Get callback class method + * + * @return null|string + */ + public function getMethod() + { + return $this->_method; + } + + /** + * Set callback type + * + * @param string $type + * @return Zend_Server_Method_Callback + * @throws Zend_Server_Exception + */ + public function setType($type) + { + if (!in_array($type, $this->_types)) { + // require_once 'Zend/Server/Exception.php'; + throw new Zend_Server_Exception('Invalid method callback type passed to ' . __CLASS__ . '::' . __METHOD__); + } + $this->_type = $type; + return $this; + } + + /** + * Get callback type + * + * @return string + */ + public function getType() + { + return $this->_type; + } + + /** + * Cast callback to array + * + * @return array + */ + public function toArray() + { + $type = $this->getType(); + $array = array( + 'type' => $type, + ); + if ('function' == $type) { + $array['function'] = $this->getFunction(); + } else {
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Method/Definition.php
Added
@@ -0,0 +1,293 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @subpackage Method + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * Method definition metadata + * + * @category Zend + * @package Zend_Server + * @subpackage Method + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Server_Method_Definition +{ + /** + * @var Zend_Server_Method_Callback + */ + protected $_callback; + + /** + * @var array + */ + protected $_invokeArguments = array(); + + /** + * @var string + */ + protected $_methodHelp = ''; + + /** + * @var string + */ + protected $_name; + + /** + * @var null|object + */ + protected $_object; + + /** + * @var array Array of Zend_Server_Method_Prototype objects + */ + protected $_prototypes = array(); + + /** + * Constructor + * + * @param null|array $options + * @return void + */ + public function __construct($options = null) + { + if ((null !== $options) && is_array($options)) { + $this->setOptions($options); + } + } + + /** + * Set object state from options + * + * @param array $options + * @return Zend_Server_Method_Definition + */ + public function setOptions(array $options) + { + foreach ($options as $key => $value) { + $method = 'set' . ucfirst($key); + if (method_exists($this, $method)) { + $this->$method($value); + } + } + return $this; + } + + /** + * Set method name + * + * @param string $name + * @return Zend_Server_Method_Definition + */ + public function setName($name) + { + $this->_name = (string) $name; + return $this; + } + + /** + * Get method name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Set method callback + * + * @param array|Zend_Server_Method_Callback $callback + * @return Zend_Server_Method_Definition + */ + public function setCallback($callback) + { + if (is_array($callback)) { + // require_once 'Zend/Server/Method/Callback.php'; + $callback = new Zend_Server_Method_Callback($callback); + } elseif (!$callback instanceof Zend_Server_Method_Callback) { + // require_once 'Zend/Server/Exception.php'; + throw new Zend_Server_Exception('Invalid method callback provided'); + } + $this->_callback = $callback; + return $this; + } + + /** + * Get method callback + * + * @return Zend_Server_Method_Callback + */ + public function getCallback() + { + return $this->_callback; + } + + /** + * Add prototype to method definition + * + * @param array|Zend_Server_Method_Prototype $prototype + * @return Zend_Server_Method_Definition + */ + public function addPrototype($prototype) + { + if (is_array($prototype)) { + // require_once 'Zend/Server/Method/Prototype.php'; + $prototype = new Zend_Server_Method_Prototype($prototype); + } elseif (!$prototype instanceof Zend_Server_Method_Prototype) { + // require_once 'Zend/Server/Exception.php'; + throw new Zend_Server_Exception('Invalid method prototype provided'); + } + $this->_prototypes[] = $prototype; + return $this; + } + + /** + * Add multiple prototypes at once + * + * @param array $prototypes Array of Zend_Server_Method_Prototype objects or arrays + * @return Zend_Server_Method_Definition + */ + public function addPrototypes(array $prototypes) + { + foreach ($prototypes as $prototype) { + $this->addPrototype($prototype); + } + return $this; + } + + /** + * Set all prototypes at once (overwrites) + * + * @param array $prototypes Array of Zend_Server_Method_Prototype objects or arrays + * @return Zend_Server_Method_Definition + */ + public function setPrototypes(array $prototypes) + { + $this->_prototypes = array(); + $this->addPrototypes($prototypes); + return $this; + } + + /** + * Get all prototypes + * + * @return array $prototypes Array of Zend_Server_Method_Prototype objects or arrays + */ + public function getPrototypes() + { + return $this->_prototypes; + }
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Method/Parameter.php
Added
@@ -0,0 +1,214 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @subpackage Method + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * Method parameter metadata + * + * @category Zend + * @package Zend_Server + * @subpackage Method + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Server_Method_Parameter +{ + /** + * @var mixed Default parameter value + */ + protected $_defaultValue; + + /** + * @var string Parameter description + */ + protected $_description = ''; + + /** + * @var string Parameter variable name + */ + protected $_name; + + /** + * @var bool Is parameter optional? + */ + protected $_optional = false; + + /** + * @var string Parameter type + */ + protected $_type = 'mixed'; + + /** + * Constructor + * + * @param null|array $options + * @return void + */ + public function __construct($options = null) + { + if (is_array($options)) { + $this->setOptions($options); + } + } + + /** + * Set object state from array of options + * + * @param array $options + * @return Zend_Server_Method_Parameter + */ + public function setOptions(array $options) + { + foreach ($options as $key => $value) { + $method = 'set' . ucfirst($key); + if (method_exists($this, $method)) { + $this->$method($value); + } + } + return $this; + } + + /** + * Set default value + * + * @param mixed $defaultValue + * @return Zend_Server_Method_Parameter + */ + public function setDefaultValue($defaultValue) + { + $this->_defaultValue = $defaultValue; + return $this; + } + + /** + * Retrieve default value + * + * @return mixed + */ + public function getDefaultValue() + { + return $this->_defaultValue; + } + + /** + * Set description + * + * @param string $description + * @return Zend_Server_Method_Parameter + */ + public function setDescription($description) + { + $this->_description = (string) $description; + return $this; + } + + /** + * Retrieve description + * + * @return string + */ + public function getDescription() + { + return $this->_description; + } + + /** + * Set name + * + * @param string $name + * @return Zend_Server_Method_Parameter + */ + public function setName($name) + { + $this->_name = (string) $name; + return $this; + } + + /** + * Retrieve name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Set optional flag + * + * @param bool $flag + * @return Zend_Server_Method_Parameter + */ + public function setOptional($flag) + { + $this->_optional = (bool) $flag; + return $this; + } + + /** + * Is the parameter optional? + * + * @return bool + */ + public function isOptional() + { + return $this->_optional; + } + + /** + * Set parameter type + * + * @param string $type + * @return Zend_Server_Method_Parameter + */ + public function setType($type) + { + $this->_type = (string) $type; + return $this; + } + + /** + * Retrieve parameter type + * + * @return string + */ + public function getType() + { + return $this->_type; + } + + /**
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Method/Prototype.php
Added
@@ -0,0 +1,208 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @subpackage Method + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * Method prototype metadata + * + * @category Zend + * @package Zend_Server + * @subpackage Method + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Server_Method_Prototype +{ + /** + * @var string Return type + */ + protected $_returnType = 'void'; + + /** + * @var array Map parameter names to parameter index + */ + protected $_parameterNameMap = array(); + + /** + * @var array Method parameters + */ + protected $_parameters = array(); + + /** + * Constructor + * + * @param null|array $options + * @return void + */ + public function __construct($options = null) + { + if ((null !== $options) && is_array($options)) { + $this->setOptions($options); + } + } + + /** + * Set return value + * + * @param string $returnType + * @return Zend_Server_Method_Prototype + */ + public function setReturnType($returnType) + { + $this->_returnType = $returnType; + return $this; + } + + /** + * Retrieve return type + * + * @return string + */ + public function getReturnType() + { + return $this->_returnType; + } + + /** + * Add a parameter + * + * @param string $parameter + * @return Zend_Server_Method_Prototype + */ + public function addParameter($parameter) + { + if ($parameter instanceof Zend_Server_Method_Parameter) { + $this->_parameters[] = $parameter; + if (null !== ($name = $parameter->getName())) { + $this->_parameterNameMap[$name] = count($this->_parameters) - 1; + } + } else { + // require_once 'Zend/Server/Method/Parameter.php'; + $parameter = new Zend_Server_Method_Parameter(array( + 'type' => (string) $parameter, + )); + $this->_parameters[] = $parameter; + } + return $this; + } + + /** + * Add parameters + * + * @param array $parameter + * @return Zend_Server_Method_Prototype + */ + public function addParameters(array $parameters) + { + foreach ($parameters as $parameter) { + $this->addParameter($parameter); + } + return $this; + } + + /** + * Set parameters + * + * @param array $parameters + * @return Zend_Server_Method_Prototype + */ + public function setParameters(array $parameters) + { + $this->_parameters = array(); + $this->_parameterNameMap = array(); + $this->addParameters($parameters); + return $this; + } + + /** + * Retrieve parameters as list of types + * + * @return array + */ + public function getParameters() + { + $types = array(); + foreach ($this->_parameters as $parameter) { + $types[] = $parameter->getType(); + } + return $types; + } + + /** + * Get parameter objects + * + * @return array + */ + public function getParameterObjects() + { + return $this->_parameters; + } + + /** + * Retrieve a single parameter by name or index + * + * @param string|int $index + * @return null|Zend_Server_Method_Parameter + */ + public function getParameter($index) + { + if (!is_string($index) && !is_numeric($index)) { + return null; + } + if (array_key_exists($index, $this->_parameterNameMap)) { + $index = $this->_parameterNameMap[$index]; + } + if (array_key_exists($index, $this->_parameters)) { + return $this->_parameters[$index]; + } + return null; + } + + /** + * Set object state from array + * + * @param array $options + * @return Zend_Server_Method_Prototype + */ + public function setOptions(array $options) + { + foreach ($options as $key => $value) { + $method = 'set' . ucfirst($key); + if (method_exists($this, $method)) { + $this->$method($value); + } + } + return $this; + } + + /** + * Serialize to array + * + * @return array
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection.php
Added
@@ -0,0 +1,111 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Zend_Server_Reflection_Function + */ +// require_once 'Zend/Server/Reflection/Function.php'; + +/** + * Zend_Server_Reflection_Class + */ +// require_once 'Zend/Server/Reflection/Class.php'; + +/** + * Reflection for determining method signatures to use with server classes + * + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +class Zend_Server_Reflection +{ + /** + * Perform class reflection to create dispatch signatures + * + * Creates a {@link Zend_Server_Reflection_Class} object for the class or + * object provided. + * + * If extra arguments should be passed to dispatchable methods, these may + * be provided as an array to $argv. + * + * @param string|object $class Class name or object + * @param null|array $argv Optional arguments to be used during the method call + * @param string $namespace Optional namespace with which to prefix the + * method name (used for the signature key). Primarily to avoid collisions, + * also for XmlRpc namespacing + * @return Zend_Server_Reflection_Class + * @throws Zend_Server_Reflection_Exception + */ + public static function reflectClass($class, $argv = false, $namespace = '') + { + if (is_object($class)) { + $reflection = new ReflectionObject($class); + } elseif (class_exists($class)) { + $reflection = new ReflectionClass($class); + } else { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid class or object passed to attachClass()'); + } + + if ($argv && !is_array($argv)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid argv argument passed to reflectClass'); + } + + return new Zend_Server_Reflection_Class($reflection, $namespace, $argv); + } + + /** + * Perform function reflection to create dispatch signatures + * + * Creates dispatch prototypes for a function. It returns a + * {@link Zend_Server_Reflection_Function} object. + * + * If extra arguments should be passed to the dispatchable function, these + * may be provided as an array to $argv. + * + * @param string $function Function name + * @param null|array $argv Optional arguments to be used during the method call + * @param string $namespace Optional namespace with which to prefix the + * function name (used for the signature key). Primarily to avoid + * collisions, also for XmlRpc namespacing + * @return Zend_Server_Reflection_Function + * @throws Zend_Server_Reflection_Exception + */ + public static function reflectFunction($function, $argv = false, $namespace = '') + { + if (!is_string($function) || !function_exists($function)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid function "' . $function . '" passed to reflectFunction'); + } + + + if ($argv && !is_array($argv)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid argv argument passed to reflectClass'); + } + + return new Zend_Server_Reflection_Function(new ReflectionFunction($function), $namespace, $argv); + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/Class.php
Added
@@ -0,0 +1,198 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Zend_Server_Reflection_Method + */ +// require_once 'Zend/Server/Reflection/Method.php'; + +/** + * Class/Object reflection + * + * Proxies calls to a ReflectionClass object, and decorates getMethods() by + * creating its own list of {@link Zend_Server_Reflection_Method}s. + * + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +class Zend_Server_Reflection_Class +{ + /** + * Optional configuration parameters; accessible via {@link __get} and + * {@link __set()} + * @var array + */ + protected $_config = array(); + + /** + * Array of {@link Zend_Server_Reflection_Method}s + * @var array + */ + protected $_methods = array(); + + /** + * Namespace + * @var string + */ + protected $_namespace = null; + + /** + * ReflectionClass object + * @var ReflectionClass + */ + protected $_reflection; + + /** + * Constructor + * + * Create array of dispatchable methods, each a + * {@link Zend_Server_Reflection_Method}. Sets reflection object property. + * + * @param ReflectionClass $reflection + * @param string $namespace + * @param mixed $argv + * @return void + */ + public function __construct(ReflectionClass $reflection, $namespace = null, $argv = false) + { + $this->_reflection = $reflection; + $this->setNamespace($namespace); + + foreach ($reflection->getMethods() as $method) { + // Don't aggregate magic methods + if ('__' == substr($method->getName(), 0, 2)) { + continue; + } + + if ($method->isPublic()) { + // Get signatures and description + $this->_methods[] = new Zend_Server_Reflection_Method($this, $method, $this->getNamespace(), $argv); + } + } + } + + /** + * Proxy reflection calls + * + * @param string $method + * @param array $args + * @return mixed + */ + public function __call($method, $args) + { + if (method_exists($this->_reflection, $method)) { + return call_user_func_array(array($this->_reflection, $method), $args); + } + + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid reflection method'); + } + + /** + * Retrieve configuration parameters + * + * Values are retrieved by key from {@link $_config}. Returns null if no + * value found. + * + * @param string $key + * @return mixed + */ + public function __get($key) + { + if (isset($this->_config[$key])) { + return $this->_config[$key]; + } + + return null; + } + + /** + * Set configuration parameters + * + * Values are stored by $key in {@link $_config}. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function __set($key, $value) + { + $this->_config[$key] = $value; + } + + /** + * Return array of dispatchable {@link Zend_Server_Reflection_Method}s. + * + * @access public + * @return array + */ + public function getMethods() + { + return $this->_methods; + } + + /** + * Get namespace for this class + * + * @return string + */ + public function getNamespace() + { + return $this->_namespace; + } + + /** + * Set namespace for this class + * + * @param string $namespace + * @return void + */ + public function setNamespace($namespace) + { + if (empty($namespace)) { + $this->_namespace = ''; + return; + } + + if (!is_string($namespace) || !preg_match('/[a-z0-9_\.]+/i', $namespace)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid namespace'); + } + + $this->_namespace = $namespace; + } + + /** + * Wakeup from serialization + * + * Reflection needs explicit instantiation to work correctly. Re-instantiate + * reflection object on wakeup. + * + * @return void + */ + public function __wakeup() + { + $this->_reflection = new ReflectionClass($this->getName()); + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/Exception.php
Added
@@ -0,0 +1,38 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * @see Zend_Server_Exception + */ +// require_once 'Zend/Server/Exception.php'; + +/** + * Zend_Server_Reflection exceptions + * + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +class Zend_Server_Reflection_Exception extends Zend_Server_Exception +{ +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/Function
Added
+(directory)
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/Function.php
Added
@@ -0,0 +1,39 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Zend_Server_Reflection_Function_Abstract + */ +// require_once 'Zend/Server/Reflection/Function/Abstract.php'; + +/** + * Function Reflection + * + * @uses Zend_Server_Reflection_Function_Abstract + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +class Zend_Server_Reflection_Function extends Zend_Server_Reflection_Function_Abstract +{ +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/Function/Abstract.php
Added
@@ -0,0 +1,514 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Zend_Server_Reflection_Node + */ +// require_once 'Zend/Server/Reflection/Node.php'; + +/** + * Zend_Server_Reflection_Parameter + */ +// require_once 'Zend/Server/Reflection/Parameter.php'; + +/** + * Zend_Server_Reflection_Prototype + */ +// require_once 'Zend/Server/Reflection/Prototype.php'; + +/** + * Function/Method Reflection + * + * Decorates a ReflectionFunction. Allows setting and retrieving an alternate + * 'service' name (i.e., the name to be used when calling via a service), + * setting and retrieving the description (originally set using the docblock + * contents), retrieving the callback and callback type, retrieving additional + * method invocation arguments, and retrieving the + * method {@link Zend_Server_Reflection_Prototype prototypes}. + * + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +abstract class Zend_Server_Reflection_Function_Abstract +{ + /** + * @var ReflectionFunction + */ + protected $_reflection; + + /** + * Additional arguments to pass to method on invocation + * @var array + */ + protected $_argv = array(); + + /** + * Used to store extra configuration for the method (typically done by the + * server class, e.g., to indicate whether or not to instantiate a class). + * Associative array; access is as properties via {@link __get()} and + * {@link __set()} + * @var array + */ + protected $_config = array(); + + /** + * Declaring class (needed for when serialization occurs) + * @var string + */ + protected $_class; + + /** + * Function/method description + * @var string + */ + protected $_description = ''; + + /** + * Namespace with which to prefix function/method name + * @var string + */ + protected $_namespace; + + /** + * Prototypes + * @var array + */ + protected $_prototypes = array(); + + private $_return; + private $_returnDesc; + private $_paramDesc; + private $_sigParams; + private $_sigParamsDepth; + + /** + * Constructor + * + * @param ReflectionFunction $r + */ + public function __construct(Reflector $r, $namespace = null, $argv = array()) + { + // In PHP 5.1.x, ReflectionMethod extends ReflectionFunction. In 5.2.x, + // both extend ReflectionFunctionAbstract. So, we can't do normal type + // hinting in the prototype, but instead need to do some explicit + // testing here. + if ((!$r instanceof ReflectionFunction) + && (!$r instanceof ReflectionMethod)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid reflection class'); + } + $this->_reflection = $r; + + // Determine namespace + if (null !== $namespace){ + $this->setNamespace($namespace); + } + + // Determine arguments + if (is_array($argv)) { + $this->_argv = $argv; + } + + // If method call, need to store some info on the class + if ($r instanceof ReflectionMethod) { + $this->_class = $r->getDeclaringClass()->getName(); + } + + // Perform some introspection + $this->_reflect(); + } + + /** + * Create signature node tree + * + * Recursive method to build the signature node tree. Increments through + * each array in {@link $_sigParams}, adding every value of the next level + * to the current value (unless the current value is null). + * + * @param Zend_Server_Reflection_Node $parent + * @param int $level + * @return void + */ + protected function _addTree(Zend_Server_Reflection_Node $parent, $level = 0) + { + if ($level >= $this->_sigParamsDepth) { + return; + } + + foreach ($this->_sigParams[$level] as $value) { + $node = new Zend_Server_Reflection_Node($value, $parent); + if ((null !== $value) && ($this->_sigParamsDepth > $level + 1)) { + $this->_addTree($node, $level + 1); + } + } + } + + /** + * Build the signature tree + * + * Builds a signature tree starting at the return values and descending + * through each method argument. Returns an array of + * {@link Zend_Server_Reflection_Node}s. + * + * @return array + */ + protected function _buildTree() + { + $returnTree = array(); + foreach ((array) $this->_return as $value) { + $node = new Zend_Server_Reflection_Node($value); + $this->_addTree($node); + $returnTree[] = $node; + } + + return $returnTree; + } + + /** + * Build method signatures + * + * Builds method signatures using the array of return types and the array of + * parameters types + * + * @param array $return Array of return types + * @param string $returnDesc Return value description + * @param array $params Array of arguments (each an array of types) + * @param array $paramDesc Array of parameter descriptions + * @return array + */
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/Method.php
Added
@@ -0,0 +1,110 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Zend_Server_Reflection_Function_Abstract + */ +// require_once 'Zend/Server/Reflection/Function/Abstract.php'; + +/** + * Method Reflection + * + * @uses Zend_Server_Reflection_Function_Abstract + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +class Zend_Server_Reflection_Method extends Zend_Server_Reflection_Function_Abstract +{ + /** + * Parent class name + * @var string + */ + protected $_class; + + /** + * Parent class reflection + * @var Zend_Server_Reflection_Class + */ + protected $_classReflection; + + /** + * Constructor + * + * @param Zend_Server_Reflection_Class $class + * @param ReflectionMethod $r + * @param string $namespace + * @param array $argv + * @return void + */ + public function __construct(Zend_Server_Reflection_Class $class, ReflectionMethod $r, $namespace = null, $argv = array()) + { + $this->_classReflection = $class; + $this->_reflection = $r; + + $classNamespace = $class->getNamespace(); + + // Determine namespace + if (!empty($namespace)) { + $this->setNamespace($namespace); + } elseif (!empty($classNamespace)) { + $this->setNamespace($classNamespace); + } + + // Determine arguments + if (is_array($argv)) { + $this->_argv = $argv; + } + + // If method call, need to store some info on the class + $this->_class = $class->getName(); + + // Perform some introspection + $this->_reflect(); + } + + /** + * Return the reflection for the class that defines this method + * + * @return Zend_Server_Reflection_Class + */ + public function getDeclaringClass() + { + return $this->_classReflection; + } + + /** + * Wakeup from serialization + * + * Reflection needs explicit instantiation to work correctly. Re-instantiate + * reflection object on wakeup. + * + * @return void + */ + public function __wakeup() + { + $this->_classReflection = new Zend_Server_Reflection_Class(new ReflectionClass($this->_class), $this->getNamespace(), $this->getInvokeArguments()); + $this->_reflection = new ReflectionMethod($this->_classReflection->getName(), $this->getName()); + } + +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/Node.php
Added
@@ -0,0 +1,201 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Node Tree class for Zend_Server reflection operations + * + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @version $Id$ + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Server_Reflection_Node +{ + /** + * Node value + * @var mixed + */ + protected $_value = null; + + /** + * Array of child nodes (if any) + * @var array + */ + protected $_children = array(); + + /** + * Parent node (if any) + * @var Zend_Server_Reflection_Node + */ + protected $_parent = null; + + /** + * Constructor + * + * @param mixed $value + * @param Zend_Server_Reflection_Node $parent Optional + * @return Zend_Server_Reflection_Node + */ + public function __construct($value, Zend_Server_Reflection_Node $parent = null) + { + $this->_value = $value; + if (null !== $parent) { + $this->setParent($parent, true); + } + + return $this; + } + + /** + * Set parent node + * + * @param Zend_Server_Reflection_Node $node + * @param boolean $new Whether or not the child node is newly created + * and should always be attached + * @return void + */ + public function setParent(Zend_Server_Reflection_Node $node, $new = false) + { + $this->_parent = $node; + + if ($new) { + $node->attachChild($this); + return; + } + } + + /** + * Create and attach a new child node + * + * @param mixed $value + * @access public + * @return Zend_Server_Reflection_Node New child node + */ + public function createChild($value) + { + $child = new self($value, $this); + + return $child; + } + + /** + * Attach a child node + * + * @param Zend_Server_Reflection_Node $node + * @return void + */ + public function attachChild(Zend_Server_Reflection_Node $node) + { + $this->_children[] = $node; + + if ($node->getParent() !== $this) { + $node->setParent($this); + } + } + + /** + * Return an array of all child nodes + * + * @return array + */ + public function getChildren() + { + return $this->_children; + } + + /** + * Does this node have children? + * + * @return boolean + */ + public function hasChildren() + { + return count($this->_children) > 0; + } + + /** + * Return the parent node + * + * @return null|Zend_Server_Reflection_Node + */ + public function getParent() + { + return $this->_parent; + } + + /** + * Return the node's current value + * + * @return mixed + */ + public function getValue() + { + return $this->_value; + } + + /** + * Set the node value + * + * @param mixed $value + * @return void + */ + public function setValue($value) + { + $this->_value = $value; + } + + /** + * Retrieve the bottommost nodes of this node's tree + * + * Retrieves the bottommost nodes of the tree by recursively calling + * getEndPoints() on all children. If a child is null, it returns the parent + * as an end point. + * + * @return array + */ + public function getEndPoints() + { + $endPoints = array(); + if (!$this->hasChildren()) { + return $endPoints; + } + + foreach ($this->_children as $child) { + $value = $child->getValue(); + + if (null === $value) { + $endPoints[] = $this; + } elseif ((null !== $value) + && $child->hasChildren()) + { + $childEndPoints = $child->getEndPoints(); + if (!empty($childEndPoints)) { + $endPoints = array_merge($endPoints, $childEndPoints); + } + } elseif ((null !== $value) && !$child->hasChildren()) { + $endPoints[] = $child; + } + } + + return $endPoints;
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/Parameter.php
Added
@@ -0,0 +1,161 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Parameter Reflection + * + * Decorates a ReflectionParameter to allow setting the parameter type + * + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +class Zend_Server_Reflection_Parameter +{ + /** + * @var ReflectionParameter + */ + protected $_reflection; + + /** + * Parameter position + * @var int + */ + protected $_position; + + /** + * Parameter type + * @var string + */ + protected $_type; + + /** + * Parameter description + * @var string + */ + protected $_description; + + /** + * Constructor + * + * @param ReflectionParameter $r + * @param string $type Parameter type + * @param string $description Parameter description + */ + public function __construct(ReflectionParameter $r, $type = 'mixed', $description = '') + { + $this->_reflection = $r; + $this->setType($type); + $this->setDescription($description); + } + + /** + * Proxy reflection calls + * + * @param string $method + * @param array $args + * @return mixed + */ + public function __call($method, $args) + { + if (method_exists($this->_reflection, $method)) { + return call_user_func_array(array($this->_reflection, $method), $args); + } + + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid reflection method'); + } + + /** + * Retrieve parameter type + * + * @return string + */ + public function getType() + { + return $this->_type; + } + + /** + * Set parameter type + * + * @param string|null $type + * @return void + */ + public function setType($type) + { + if (!is_string($type) && (null !== $type)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid parameter type'); + } + + $this->_type = $type; + } + + /** + * Retrieve parameter description + * + * @return string + */ + public function getDescription() + { + return $this->_description; + } + + /** + * Set parameter description + * + * @param string|null $description + * @return void + */ + public function setDescription($description) + { + if (!is_string($description) && (null !== $description)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid parameter description'); + } + + $this->_description = $description; + } + + /** + * Set parameter position + * + * @param int $index + * @return void + */ + public function setPosition($index) + { + $this->_position = (int) $index; + } + + /** + * Return parameter position + * + * @return int + */ + public function getPosition() + { + return $this->_position; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/Prototype.php
Added
@@ -0,0 +1,103 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Zend_Server_Reflection_ReturnValue + */ +// require_once 'Zend/Server/Reflection/ReturnValue.php'; + +/** + * Zend_Server_Reflection_Parameter + */ +// require_once 'Zend/Server/Reflection/Parameter.php'; + +/** + * Method/Function prototypes + * + * Contains accessors for the return value and all method arguments. + * + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +class Zend_Server_Reflection_Prototype +{ + /** + * Constructor + * + * @param Zend_Server_Reflection_ReturnValue $return + * @param array $params + * @return void + */ + public function __construct(Zend_Server_Reflection_ReturnValue $return, $params = null) + { + $this->_return = $return; + + if (!is_array($params) && (null !== $params)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid parameters'); + } + + if (is_array($params)) { + foreach ($params as $param) { + if (!$param instanceof Zend_Server_Reflection_Parameter) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('One or more params are invalid'); + } + } + } + + $this->_params = $params; + } + + /** + * Retrieve return type + * + * @return string + */ + public function getReturnType() + { + return $this->_return->getType(); + } + + /** + * Retrieve the return value object + * + * @access public + * @return Zend_Server_Reflection_ReturnValue + */ + public function getReturnValue() + { + return $this->_return; + } + + /** + * Retrieve method parameters + * + * @return array Array of {@link Zend_Server_Reflection_Parameter}s + */ + public function getParameters() + { + return $this->_params; + } +}
View file
roundcubemail-1.4.13.tar.gz/vendor/zf1/zend-server/library/Zend/Server/Reflection/ReturnValue.php
Added
@@ -0,0 +1,110 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * Return value reflection + * + * Stores the return value type and description + * + * @category Zend + * @package Zend_Server + * @subpackage Reflection + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ +class Zend_Server_Reflection_ReturnValue +{ + /** + * Return value type + * @var string + */ + protected $_type; + + /** + * Return value description + * @var string + */ + protected $_description; + + /** + * Constructor + * + * @param string $type Return value type + * @param string $description Return value type + */ + public function __construct($type = 'mixed', $description = '') + { + $this->setType($type); + $this->setDescription($description); + } + + /** + * Retrieve parameter type + * + * @return string + */ + public function getType() + { + return $this->_type; + } + + /** + * Set parameter type + * + * @param string|null $type + * @return void + */ + public function setType($type) + { + if (!is_string($type) && (null !== $type)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid parameter type'); + } + + $this->_type = $type; + } + + /** + * Retrieve parameter description + * + * @return string + */ + public function getDescription() + { + return $this->_description; + } + + /** + * Set parameter description + * + * @param string|null $description + * @return void + */ + public function setDescription($description) + { + if (!is_string($description) && (null !== $description)) { + // require_once 'Zend/Server/Reflection/Exception.php'; + throw new Zend_Server_Reflection_Exception('Invalid parameter description'); + } + + $this->_description = $description; + } +}
View file
roundcubemail.dsc
Changed
@@ -2,7 +2,7 @@ Source: roundcubemail Binary: roundcubemail Architecture: all -Version: 1:1.4.11.20-0~kolab1 +Version: 1:1.4.13-0~kolab1 Maintainer: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Uploaders: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Homepage: http://www.roundcube.net/ @@ -14,5 +14,5 @@ roundcubemail deb web extra roundcubemail-core deb web extra Files: - 00000000000000000000000000000000 0 roundcubemail-1.4.11.20.tar.gz + 00000000000000000000000000000000 0 roundcubemail-1.4.13.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.