Projects
Kolab:Winterfell
kolab-webadmin
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 8
View file
kolab-webadmin.spec
Changed
@@ -34,14 +34,14 @@ %global kolabr_group_id 414 Name: kolab-webadmin -Version: 3.2.11 -Release: 0.20160627.git%{?dist} +Version: 3.2.12 +Release: 1%{?dist} Summary: Kolab Groupware Server Web Administration Interface License: AGPLv3+ Group: Productivity/Office/Organizers Url: http://www.kolab.org -Source0: kolab-webadmin-3.2.11.tar.gz +Source0: kolab-webadmin-3.2.12.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -169,6 +169,9 @@ %attr(0770,%{httpd_user},%{httpd_group}) %{_var}/log/%{name} %changelog +* Fri Nov 17 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 3.2.12-1 +- Release 3.2.12 + * Wed Jan 13 2016 Timotheus Pokorra <tp@tbits.net> - 3.2.11-2 - requires php because libphp5.so provides php_value needed in kolab-webadmin.conf (#3678)
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +kolab-webadmin (3.2.12-0~kolab1) unstable; urgency=low + + * Release 3.2.12 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Fri, 17 Nov 2017 22:08:00 +0100 + kolab-webadmin (3.2.11~dev20160627-0~kolab2) unstable; urgency=low * Adjust dependencies for Debian Stretch / Ubuntu Xenial
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext
Deleted
-(directory)
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP
Deleted
-(directory)
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2
Deleted
-(directory)
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2.php
Deleted
@@ -1,1015 +0,0 @@ -<?php -/** - * Class representing a HTTP request message - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Request2.php 315409 2011-08-24 07:29:23Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * A class representing an URL as per RFC 3986. - */ -require_once 'Net/URL2.php'; - -/** - * Exception class for HTTP_Request2 package - */ -require_once 'HTTP/Request2/Exception.php'; - -/** - * Class representing a HTTP request message - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @version Release: 2.0.0 - * @link http://tools.ietf.org/html/rfc2616#section-5 - */ -class HTTP_Request2 implements SplSubject -{ - /**#@+ - * Constants for HTTP request methods - * - * @link http://tools.ietf.org/html/rfc2616#section-5.1.1 - */ - const METHOD_OPTIONS = 'OPTIONS'; - const METHOD_GET = 'GET'; - const METHOD_HEAD = 'HEAD'; - const METHOD_POST = 'POST'; - const METHOD_PUT = 'PUT'; - const METHOD_DELETE = 'DELETE'; - const METHOD_TRACE = 'TRACE'; - const METHOD_CONNECT = 'CONNECT'; - /**#@-*/ - - /**#@+ - * Constants for HTTP authentication schemes - * - * @link http://tools.ietf.org/html/rfc2617 - */ - const AUTH_BASIC = 'basic'; - const AUTH_DIGEST = 'digest'; - /**#@-*/ - - /** - * Regular expression used to check for invalid symbols in RFC 2616 tokens - * @link http://pear.php.net/bugs/bug.php?id=15630 - */ - const REGEXP_INVALID_TOKEN = '![\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]!'; - - /** - * Regular expression used to check for invalid symbols in cookie strings - * @link http://pear.php.net/bugs/bug.php?id=15630 - * @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html - */ - const REGEXP_INVALID_COOKIE = '/[\s,;]/'; - - /** - * Fileinfo magic database resource - * @var resource - * @see detectMimeType() - */ - private static $_fileinfoDb; - - /** - * Observers attached to the request (instances of SplObserver) - * @var array - */ - protected $observers = array(); - - /** - * Request URL - * @var Net_URL2 - */ - protected $url; - - /** - * Request method - * @var string - */ - protected $method = self::METHOD_GET; - - /** - * Authentication data - * @var array - * @see getAuth() - */ - protected $auth; - - /** - * Request headers - * @var array - */ - protected $headers = array(); - - /** - * Configuration parameters - * @var array - * @see setConfig() - */ - protected $config = array( - 'adapter' => 'HTTP_Request2_Adapter_Socket', - 'connect_timeout' => 10, - 'timeout' => 0, - 'use_brackets' => true, - 'protocol_version' => '1.1', - 'buffer_size' => 16384, - 'store_body' => true, - - 'proxy_host' => '', - 'proxy_port' => '', - 'proxy_user' => '', - 'proxy_password' => '', - 'proxy_auth_scheme' => self::AUTH_BASIC, - - 'ssl_verify_peer' => true, - 'ssl_verify_host' => true, - 'ssl_cafile' => null, - 'ssl_capath' => null, - 'ssl_local_cert' => null, - 'ssl_passphrase' => null, - - 'digest_compat_ie' => false, - - 'follow_redirects' => false, - 'max_redirects' => 5, - 'strict_redirects' => false - ); - - /** - * Last event in request / response handling, intended for observers - * @var array - * @see getLastEvent() - */ - protected $lastEvent = array( - 'name' => 'start', - 'data' => null - ); - - /** - * Request body - * @var string|resource - * @see setBody() - */ - protected $body = ''; - - /** - * Array of POST parameters - * @var array - */ - protected $postParams = array(); - - /** - * Array of file uploads (for multipart/form-data POST requests) - * @var array
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/Adapter
Deleted
-(directory)
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/Adapter.php
Deleted
@@ -1,154 +0,0 @@ -<?php -/** - * Base class for HTTP_Request2 adapters - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Adapter.php 308322 2011-02-14 13:58:03Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Class representing a HTTP response - */ -require_once 'HTTP/Request2/Response.php'; - -/** - * Base class for HTTP_Request2 adapters - * - * HTTP_Request2 class itself only defines methods for aggregating the request - * data, all actual work of sending the request to the remote server and - * receiving its response is performed by adapters. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @version Release: 2.0.0 - */ -abstract class HTTP_Request2_Adapter -{ - /** - * A list of methods that MUST NOT have a request body, per RFC 2616 - * @var array - */ - protected static $bodyDisallowed = array('TRACE'); - - /** - * Methods having defined semantics for request body - * - * Content-Length header (indicating that the body follows, section 4.3 of - * RFC 2616) will be sent for these methods even if no body was added - * - * @var array - * @link http://pear.php.net/bugs/bug.php?id=12900 - * @link http://pear.php.net/bugs/bug.php?id=14740 - */ - protected static $bodyRequired = array('POST', 'PUT'); - - /** - * Request being sent - * @var HTTP_Request2 - */ - protected $request; - - /** - * Request body - * @var string|resource|HTTP_Request2_MultipartBody - * @see HTTP_Request2::getBody() - */ - protected $requestBody; - - /** - * Length of the request body - * @var integer - */ - protected $contentLength; - - /** - * Sends request to the remote server and returns its response - * - * @param HTTP_Request2 - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - abstract public function sendRequest(HTTP_Request2 $request); - - /** - * Calculates length of the request body, adds proper headers - * - * @param array associative array of request headers, this method will - * add proper 'Content-Length' and 'Content-Type' headers - * to this array (or remove them if not needed) - */ - protected function calculateRequestLength(&$headers) - { - $this->requestBody = $this->request->getBody(); - - if (is_string($this->requestBody)) { - $this->contentLength = strlen($this->requestBody); - } elseif (is_resource($this->requestBody)) { - $stat = fstat($this->requestBody); - $this->contentLength = $stat['size']; - rewind($this->requestBody); - } else { - $this->contentLength = $this->requestBody->getLength(); - $headers['content-type'] = 'multipart/form-data; boundary=' . - $this->requestBody->getBoundary(); - $this->requestBody->rewind(); - } - - if (in_array($this->request->getMethod(), self::$bodyDisallowed) || - 0 == $this->contentLength - ) { - // No body: send a Content-Length header nonetheless (request #12900), - // but do that only for methods that require a body (bug #14740) - if (in_array($this->request->getMethod(), self::$bodyRequired)) { - $headers['content-length'] = 0; - } else { - unset($headers['content-length']); - // if the method doesn't require a body and doesn't have a - // body, don't send a Content-Type header. (request #16799) - unset($headers['content-type']); - } - } else { - if (empty($headers['content-type'])) { - $headers['content-type'] = 'application/x-www-form-urlencoded'; - } - $headers['content-length'] = $this->contentLength; - } - } -} -?>
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/Adapter/Curl.php
Deleted
@@ -1,560 +0,0 @@ -<?php -/** - * Adapter for HTTP_Request2 wrapping around cURL extension - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Curl.php 310800 2011-05-06 07:29:56Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Base class for HTTP_Request2 adapters - */ -require_once 'HTTP/Request2/Adapter.php'; - -/** - * Adapter for HTTP_Request2 wrapping around cURL extension - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @version Release: 2.0.0 - */ -class HTTP_Request2_Adapter_Curl extends HTTP_Request2_Adapter -{ - /** - * Mapping of header names to cURL options - * @var array - */ - protected static $headerMap = array( - 'accept-encoding' => CURLOPT_ENCODING, - 'cookie' => CURLOPT_COOKIE, - 'referer' => CURLOPT_REFERER, - 'user-agent' => CURLOPT_USERAGENT - ); - - /** - * Mapping of SSL context options to cURL options - * @var array - */ - protected static $sslContextMap = array( - 'ssl_verify_peer' => CURLOPT_SSL_VERIFYPEER, - 'ssl_cafile' => CURLOPT_CAINFO, - 'ssl_capath' => CURLOPT_CAPATH, - 'ssl_local_cert' => CURLOPT_SSLCERT, - 'ssl_passphrase' => CURLOPT_SSLCERTPASSWD - ); - - /** - * Mapping of CURLE_* constants to Exception subclasses and error codes - * @var array - */ - protected static $errorMap = array( - CURLE_UNSUPPORTED_PROTOCOL => array('HTTP_Request2_MessageException', - HTTP_Request2_Exception::NON_HTTP_REDIRECT), - CURLE_COULDNT_RESOLVE_PROXY => array('HTTP_Request2_ConnectionException'), - CURLE_COULDNT_RESOLVE_HOST => array('HTTP_Request2_ConnectionException'), - CURLE_COULDNT_CONNECT => array('HTTP_Request2_ConnectionException'), - // error returned from write callback - CURLE_WRITE_ERROR => array('HTTP_Request2_MessageException', - HTTP_Request2_Exception::NON_HTTP_REDIRECT), - CURLE_OPERATION_TIMEOUTED => array('HTTP_Request2_MessageException', - HTTP_Request2_Exception::TIMEOUT), - CURLE_HTTP_RANGE_ERROR => array('HTTP_Request2_MessageException'), - CURLE_SSL_CONNECT_ERROR => array('HTTP_Request2_ConnectionException'), - CURLE_LIBRARY_NOT_FOUND => array('HTTP_Request2_LogicException', - HTTP_Request2_Exception::MISCONFIGURATION), - CURLE_FUNCTION_NOT_FOUND => array('HTTP_Request2_LogicException', - HTTP_Request2_Exception::MISCONFIGURATION), - CURLE_ABORTED_BY_CALLBACK => array('HTTP_Request2_MessageException', - HTTP_Request2_Exception::NON_HTTP_REDIRECT), - CURLE_TOO_MANY_REDIRECTS => array('HTTP_Request2_MessageException', - HTTP_Request2_Exception::TOO_MANY_REDIRECTS), - CURLE_SSL_PEER_CERTIFICATE => array('HTTP_Request2_ConnectionException'), - CURLE_GOT_NOTHING => array('HTTP_Request2_MessageException'), - CURLE_SSL_ENGINE_NOTFOUND => array('HTTP_Request2_LogicException', - HTTP_Request2_Exception::MISCONFIGURATION), - CURLE_SSL_ENGINE_SETFAILED => array('HTTP_Request2_LogicException', - HTTP_Request2_Exception::MISCONFIGURATION), - CURLE_SEND_ERROR => array('HTTP_Request2_MessageException'), - CURLE_RECV_ERROR => array('HTTP_Request2_MessageException'), - CURLE_SSL_CERTPROBLEM => array('HTTP_Request2_LogicException', - HTTP_Request2_Exception::INVALID_ARGUMENT), - CURLE_SSL_CIPHER => array('HTTP_Request2_ConnectionException'), - CURLE_SSL_CACERT => array('HTTP_Request2_ConnectionException'), - CURLE_BAD_CONTENT_ENCODING => array('HTTP_Request2_MessageException'), - ); - - /** - * Response being received - * @var HTTP_Request2_Response - */ - protected $response; - - /** - * Whether 'sentHeaders' event was sent to observers - * @var boolean - */ - protected $eventSentHeaders = false; - - /** - * Whether 'receivedHeaders' event was sent to observers - * @var boolean - */ - protected $eventReceivedHeaders = false; - - /** - * Position within request body - * @var integer - * @see callbackReadBody() - */ - protected $position = 0; - - /** - * Information about last transfer, as returned by curl_getinfo() - * @var array - */ - protected $lastInfo; - - /** - * Creates a subclass of HTTP_Request2_Exception from curl error data - * - * @param resource curl handle - * @return HTTP_Request2_Exception - */ - protected static function wrapCurlError($ch) - { - $nativeCode = curl_errno($ch); - $message = 'Curl error: ' . curl_error($ch); - if (!isset(self::$errorMap[$nativeCode])) { - return new HTTP_Request2_Exception($message, 0, $nativeCode); - } else { - $class = self::$errorMap[$nativeCode][0]; - $code = empty(self::$errorMap[$nativeCode][1]) - ? 0 : self::$errorMap[$nativeCode][1]; - return new $class($message, $code, $nativeCode); - } - } - - /** - * Sends request to the remote server and returns its response - * - * @param HTTP_Request2 - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - public function sendRequest(HTTP_Request2 $request) - { - if (!extension_loaded('curl')) { - throw new HTTP_Request2_LogicException( - 'cURL extension not available', HTTP_Request2_Exception::MISCONFIGURATION - ); - } - - $this->request = $request; - $this->response = null; - $this->position = 0; - $this->eventSentHeaders = false; - $this->eventReceivedHeaders = false; - - try { - if (false === curl_exec($ch = $this->createCurlHandle())) { - $e = self::wrapCurlError($ch); - } - } catch (Exception $e) { - }
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/Adapter/Mock.php
Deleted
@@ -1,171 +0,0 @@ -<?php -/** - * Mock adapter intended for testing - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Mock.php 308322 2011-02-14 13:58:03Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Base class for HTTP_Request2 adapters - */ -require_once 'HTTP/Request2/Adapter.php'; - -/** - * Mock adapter intended for testing - * - * Can be used to test applications depending on HTTP_Request2 package without - * actually performing any HTTP requests. This adapter will return responses - * previously added via addResponse() - * <code> - * $mock = new HTTP_Request2_Adapter_Mock(); - * $mock->addResponse("HTTP/1.1 ... "); - * - * $request = new HTTP_Request2(); - * $request->setAdapter($mock); - * - * // This will return the response set above - * $response = $req->send(); - * </code> - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @version Release: 2.0.0 - */ -class HTTP_Request2_Adapter_Mock extends HTTP_Request2_Adapter -{ - /** - * A queue of responses to be returned by sendRequest() - * @var array - */ - protected $responses = array(); - - /** - * Returns the next response from the queue built by addResponse() - * - * If the queue is empty it will return default empty response with status 400, - * if an Exception object was added to the queue it will be thrown. - * - * @param HTTP_Request2 - * @return HTTP_Request2_Response - * @throws Exception - */ - public function sendRequest(HTTP_Request2 $request) - { - if (count($this->responses) > 0) { - $response = array_shift($this->responses); - if ($response instanceof HTTP_Request2_Response) { - return $response; - } else { - // rethrow the exception - $class = get_class($response); - $message = $response->getMessage(); - $code = $response->getCode(); - throw new $class($message, $code); - } - } else { - return self::createResponseFromString("HTTP/1.1 400 Bad Request\r\n\r\n"); - } - } - - /** - * Adds response to the queue - * - * @param mixed either a string, a pointer to an open file, - * an instance of HTTP_Request2_Response or Exception - * @throws HTTP_Request2_Exception - */ - public function addResponse($response) - { - if (is_string($response)) { - $response = self::createResponseFromString($response); - } elseif (is_resource($response)) { - $response = self::createResponseFromFile($response); - } elseif (!$response instanceof HTTP_Request2_Response && - !$response instanceof Exception - ) { - throw new HTTP_Request2_Exception('Parameter is not a valid response'); - } - $this->responses[] = $response; - } - - /** - * Creates a new HTTP_Request2_Response object from a string - * - * @param string - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - public static function createResponseFromString($str) - { - $parts = preg_split('!(\r?\n){2}!m', $str, 2); - $headerLines = explode("\n", $parts[0]); - $response = new HTTP_Request2_Response(array_shift($headerLines)); - foreach ($headerLines as $headerLine) { - $response->parseHeaderLine($headerLine); - } - $response->parseHeaderLine(''); - if (isset($parts[1])) { - $response->appendBody($parts[1]); - } - return $response; - } - - /** - * Creates a new HTTP_Request2_Response object from a file - * - * @param resource file pointer returned by fopen() - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - public static function createResponseFromFile($fp) - { - $response = new HTTP_Request2_Response(fgets($fp)); - do { - $headerLine = fgets($fp); - $response->parseHeaderLine($headerLine); - } while ('' != trim($headerLine)); - - while (!feof($fp)) { - $response->appendBody(fread($fp, 8192)); - } - return $response; - } -} -?> \ No newline at end of file
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/Adapter/Socket.php
Deleted
@@ -1,1084 +0,0 @@ -<?php -/** - * Socket-based adapter for HTTP_Request2 - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Socket.php 309921 2011-04-03 16:43:02Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Base class for HTTP_Request2 adapters - */ -require_once 'HTTP/Request2/Adapter.php'; - -/** - * Socket-based adapter for HTTP_Request2 - * - * This adapter uses only PHP sockets and will work on almost any PHP - * environment. Code is based on original HTTP_Request PEAR package. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @version Release: 2.0.0 - */ -class HTTP_Request2_Adapter_Socket extends HTTP_Request2_Adapter -{ - /** - * Regular expression for 'token' rule from RFC 2616 - */ - const REGEXP_TOKEN = '[^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+'; - - /** - * Regular expression for 'quoted-string' rule from RFC 2616 - */ - const REGEXP_QUOTED_STRING = '"(?:\\\\.|[^\\\\"])*"'; - - /** - * Connected sockets, needed for Keep-Alive support - * @var array - * @see connect() - */ - protected static $sockets = array(); - - /** - * Data for digest authentication scheme - * - * The keys for the array are URL prefixes. - * - * The values are associative arrays with data (realm, nonce, nonce-count, - * opaque...) needed for digest authentication. Stored here to prevent making - * duplicate requests to digest-protected resources after we have already - * received the challenge. - * - * @var array - */ - protected static $challenges = array(); - - /** - * Connected socket - * @var resource - * @see connect() - */ - protected $socket; - - /** - * Challenge used for server digest authentication - * @var array - */ - protected $serverChallenge; - - /** - * Challenge used for proxy digest authentication - * @var array - */ - protected $proxyChallenge; - - /** - * Sum of start time and global timeout, exception will be thrown if request continues past this time - * @var integer - */ - protected $deadline = null; - - /** - * Remaining length of the current chunk, when reading chunked response - * @var integer - * @see readChunked() - */ - protected $chunkLength = 0; - - /** - * Remaining amount of redirections to follow - * - * Starts at 'max_redirects' configuration parameter and is reduced on each - * subsequent redirect. An Exception will be thrown once it reaches zero. - * - * @var integer - */ - protected $redirectCountdown = null; - - /** - * Sends request to the remote server and returns its response - * - * @param HTTP_Request2 - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - public function sendRequest(HTTP_Request2 $request) - { - $this->request = $request; - - // Use global request timeout if given, see feature requests #5735, #8964 - if ($timeout = $request->getConfig('timeout')) { - $this->deadline = time() + $timeout; - } else { - $this->deadline = null; - } - - try { - $keepAlive = $this->connect(); - $headers = $this->prepareHeaders(); - if (false === @fwrite($this->socket, $headers, strlen($headers))) { - throw new HTTP_Request2_MessageException('Error writing request'); - } - // provide request headers to the observer, see request #7633 - $this->request->setLastEvent('sentHeaders', $headers); - $this->writeBody(); - - if ($this->deadline && time() > $this->deadline) { - throw new HTTP_Request2_MessageException( - 'Request timed out after ' . - $request->getConfig('timeout') . ' second(s)', - HTTP_Request2_Exception::TIMEOUT - ); - } - - $response = $this->readResponse(); - - if ($jar = $request->getCookieJar()) { - $jar->addCookiesFromResponse($response, $request->getUrl()); - } - - if (!$this->canKeepAlive($keepAlive, $response)) { - $this->disconnect(); - } - - if ($this->shouldUseProxyDigestAuth($response)) { - return $this->sendRequest($request); - } - if ($this->shouldUseServerDigestAuth($response)) { - return $this->sendRequest($request); - } - if ($authInfo = $response->getHeader('authentication-info')) { - $this->updateChallenge($this->serverChallenge, $authInfo); - } - if ($proxyInfo = $response->getHeader('proxy-authentication-info')) { - $this->updateChallenge($this->proxyChallenge, $proxyInfo); - } - - } catch (Exception $e) { - $this->disconnect(); - } - - unset($this->request, $this->requestBody); -
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/CookieJar.php
Deleted
@@ -1,499 +0,0 @@ -<?php -/** - * Stores cookies and passes them between HTTP requests - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: CookieJar.php 308629 2011-02-24 17:34:24Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** Class representing a HTTP request message */ -require_once 'HTTP/Request2.php'; - -/** - * Stores cookies and passes them between HTTP requests - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @version Release: @package_version@ - */ -class HTTP_Request2_CookieJar implements Serializable -{ - /** - * Array of stored cookies - * - * The array is indexed by domain, path and cookie name - * .example.com - * / - * some_cookie => cookie data - * /subdir - * other_cookie => cookie data - * .example.org - * ... - * - * @var array - */ - protected $cookies = array(); - - /** - * Whether session cookies should be serialized when serializing the jar - * @var bool - */ - protected $serializeSession = false; - - /** - * Whether Public Suffix List should be used for domain matching - * @var bool - */ - protected $useList = true; - - /** - * Array with Public Suffix List data - * @var array - * @link http://publicsuffix.org/ - */ - protected static $psl = array(); - - /** - * Class constructor, sets various options - * - * @param bool Controls serializing session cookies, see {@link serializeSessionCookies()} - * @param bool Controls using Public Suffix List, see {@link usePublicSuffixList()} - */ - public function __construct($serializeSessionCookies = false, $usePublicSuffixList = true) - { - $this->serializeSessionCookies($serializeSessionCookies); - $this->usePublicSuffixList($usePublicSuffixList); - } - - /** - * Returns current time formatted in ISO-8601 at UTC timezone - * - * @return string - */ - protected function now() - { - $dt = new DateTime(); - $dt->setTimezone(new DateTimeZone('UTC')); - return $dt->format(DateTime::ISO8601); - } - - /** - * Checks cookie array for correctness, possibly updating its 'domain', 'path' and 'expires' fields - * - * The checks are as follows: - * - cookie array should contain 'name' and 'value' fields; - * - name and value should not contain disallowed symbols; - * - 'expires' should be either empty parseable by DateTime; - * - 'domain' and 'path' should be either not empty or an URL where - * cookie was set should be provided. - * - if $setter is provided, then document at that URL should be allowed - * to set a cookie for that 'domain'. If $setter is not provided, - * then no domain checks will be made. - * - * 'expires' field will be converted to ISO8601 format from COOKIE format, - * 'domain' and 'path' will be set from setter URL if empty. - * - * @param array cookie data, as returned by {@link HTTP_Request2_Response::getCookies()} - * @param Net_URL2 URL of the document that sent Set-Cookie header - * @return array Updated cookie array - * @throws HTTP_Request2_LogicException - * @throws HTTP_Request2_MessageException - */ - protected function checkAndUpdateFields(array $cookie, Net_URL2 $setter = null) - { - if ($missing = array_diff(array('name', 'value'), array_keys($cookie))) { - throw new HTTP_Request2_LogicException( - "Cookie array should contain 'name' and 'value' fields", - HTTP_Request2_Exception::MISSING_VALUE - ); - } - if (preg_match(HTTP_Request2::REGEXP_INVALID_COOKIE, $cookie['name'])) { - throw new HTTP_Request2_LogicException( - "Invalid cookie name: '{$cookie['name']}'", - HTTP_Request2_Exception::INVALID_ARGUMENT - ); - } - if (preg_match(HTTP_Request2::REGEXP_INVALID_COOKIE, $cookie['value'])) { - throw new HTTP_Request2_LogicException( - "Invalid cookie value: '{$cookie['value']}'", - HTTP_Request2_Exception::INVALID_ARGUMENT - ); - } - $cookie += array('domain' => '', 'path' => '', 'expires' => null, 'secure' => false); - - // Need ISO-8601 date @ UTC timezone - if (!empty($cookie['expires']) - && !preg_match('/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+0000$/', $cookie['expires']) - ) { - try { - $dt = new DateTime($cookie['expires']); - $dt->setTimezone(new DateTimeZone('UTC')); - $cookie['expires'] = $dt->format(DateTime::ISO8601); - } catch (Exception $e) { - throw new HTTP_Request2_LogicException($e->getMessage()); - } - } - - if (empty($cookie['domain']) || empty($cookie['path'])) { - if (!$setter) { - throw new HTTP_Request2_LogicException( - 'Cookie misses domain and/or path component, cookie setter URL needed', - HTTP_Request2_Exception::MISSING_VALUE - ); - } - if (empty($cookie['domain'])) { - if ($host = $setter->getHost()) { - $cookie['domain'] = $host; - } else { - throw new HTTP_Request2_LogicException( - 'Setter URL does not contain host part, can\'t set cookie domain', - HTTP_Request2_Exception::MISSING_VALUE - ); - } - } - if (empty($cookie['path'])) { - $path = $setter->getPath(); - $cookie['path'] = empty($path)? '/': substr($path, 0, strrpos($path, '/') + 1); - } - } - - if ($setter && !$this->domainMatch($setter->getHost(), $cookie['domain'])) { - throw new HTTP_Request2_MessageException( - "Domain " . $setter->getHost() . " cannot set cookies for " - . $cookie['domain']
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/Exception.php
Deleted
@@ -1,160 +0,0 @@ -<?php -/** - * Exception classes for HTTP_Request2 package - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Exception.php 308629 2011-02-24 17:34:24Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Base class for exceptions in PEAR - */ -require_once 'PEAR/Exception.php'; - -/** - * Base exception class for HTTP_Request2 package - * - * @category HTTP - * @package HTTP_Request2 - * @version Release: 2.0.0 - * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=132 - */ -class HTTP_Request2_Exception extends PEAR_Exception -{ - /** An invalid argument was passed to a method */ - const INVALID_ARGUMENT = 1; - /** Some required value was not available */ - const MISSING_VALUE = 2; - /** Request cannot be processed due to errors in PHP configuration */ - const MISCONFIGURATION = 3; - /** Error reading the local file */ - const READ_ERROR = 4; - - /** Server returned a response that does not conform to HTTP protocol */ - const MALFORMED_RESPONSE = 10; - /** Failure decoding Content-Encoding or Transfer-Encoding of response */ - const DECODE_ERROR = 20; - /** Operation timed out */ - const TIMEOUT = 30; - /** Number of redirects exceeded 'max_redirects' configuration parameter */ - const TOO_MANY_REDIRECTS = 40; - /** Redirect to a protocol other than http(s):// */ - const NON_HTTP_REDIRECT = 50; - - /** - * Native error code - * @var int - */ - private $_nativeCode; - - /** - * Constructor, can set package error code and native error code - * - * @param string exception message - * @param int package error code, one of class constants - * @param int error code from underlying PHP extension - */ - public function __construct($message = null, $code = null, $nativeCode = null) - { - parent::__construct($message, $code); - $this->_nativeCode = $nativeCode; - } - - /** - * Returns error code produced by underlying PHP extension - * - * For Socket Adapter this may contain error number returned by - * stream_socket_client(), for Curl Adapter this will contain error number - * returned by curl_errno() - * - * @return integer - */ - public function getNativeCode() - { - return $this->_nativeCode; - } -} - -/** - * Exception thrown in case of missing features - * - * @category HTTP - * @package HTTP_Request2 - * @version Release: 2.0.0 - */ -class HTTP_Request2_NotImplementedException extends HTTP_Request2_Exception {} - -/** - * Exception that represents error in the program logic - * - * This exception usually implies a programmer's error, like passing invalid - * data to methods or trying to use PHP extensions that weren't installed or - * enabled. Usually exceptions of this kind will be thrown before request even - * starts. - * - * The exception will usually contain a package error code. - * - * @category HTTP - * @package HTTP_Request2 - * @version Release: 2.0.0 - */ -class HTTP_Request2_LogicException extends HTTP_Request2_Exception {} - -/** - * Exception thrown when connection to a web or proxy server fails - * - * The exception will not contain a package error code, but will contain - * native error code, as returned by stream_socket_client() or curl_errno(). - * - * @category HTTP - * @package HTTP_Request2 - * @version Release: 2.0.0 - */ -class HTTP_Request2_ConnectionException extends HTTP_Request2_Exception {} - -/** - * Exception thrown when sending or receiving HTTP message fails - * - * The exception may contain both package error code and native error code. - * - * @category HTTP - * @package HTTP_Request2 - * @version Release: 2.0.0 - */ -class HTTP_Request2_MessageException extends HTTP_Request2_Exception {} -?> \ No newline at end of file
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/MultipartBody.php
Deleted
@@ -1,274 +0,0 @@ -<?php -/** - * Helper class for building multipart/form-data request body - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: MultipartBody.php 308322 2011-02-14 13:58:03Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Class for building multipart/form-data request body - * - * The class helps to reduce memory consumption by streaming large file uploads - * from disk, it also allows monitoring of upload progress (see request #7630) - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @version Release: 2.0.0 - * @link http://tools.ietf.org/html/rfc1867 - */ -class HTTP_Request2_MultipartBody -{ - /** - * MIME boundary - * @var string - */ - private $_boundary; - - /** - * Form parameters added via {@link HTTP_Request2::addPostParameter()} - * @var array - */ - private $_params = array(); - - /** - * File uploads added via {@link HTTP_Request2::addUpload()} - * @var array - */ - private $_uploads = array(); - - /** - * Header for parts with parameters - * @var string - */ - private $_headerParam = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n"; - - /** - * Header for parts with uploads - * @var string - */ - private $_headerUpload = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n"; - - /** - * Current position in parameter and upload arrays - * - * First number is index of "current" part, second number is position within - * "current" part - * - * @var array - */ - private $_pos = array(0, 0); - - - /** - * Constructor. Sets the arrays with POST data. - * - * @param array values of form fields set via {@link HTTP_Request2::addPostParameter()} - * @param array file uploads set via {@link HTTP_Request2::addUpload()} - * @param bool whether to append brackets to array variable names - */ - public function __construct(array $params, array $uploads, $useBrackets = true) - { - $this->_params = self::_flattenArray('', $params, $useBrackets); - foreach ($uploads as $fieldName => $f) { - if (!is_array($f['fp'])) { - $this->_uploads[] = $f + array('name' => $fieldName); - } else { - for ($i = 0; $i < count($f['fp']); $i++) { - $upload = array( - 'name' => ($useBrackets? $fieldName . '[' . $i . ']': $fieldName) - ); - foreach (array('fp', 'filename', 'size', 'type') as $key) { - $upload[$key] = $f[$key][$i]; - } - $this->_uploads[] = $upload; - } - } - } - } - - /** - * Returns the length of the body to use in Content-Length header - * - * @return integer - */ - public function getLength() - { - $boundaryLength = strlen($this->getBoundary()); - $headerParamLength = strlen($this->_headerParam) - 4 + $boundaryLength; - $headerUploadLength = strlen($this->_headerUpload) - 8 + $boundaryLength; - $length = $boundaryLength + 6; - foreach ($this->_params as $p) { - $length += $headerParamLength + strlen($p[0]) + strlen($p[1]) + 2; - } - foreach ($this->_uploads as $u) { - $length += $headerUploadLength + strlen($u['name']) + strlen($u['type']) + - strlen($u['filename']) + $u['size'] + 2; - } - return $length; - } - - /** - * Returns the boundary to use in Content-Type header - * - * @return string - */ - public function getBoundary() - { - if (empty($this->_boundary)) { - $this->_boundary = '--' . md5('PEAR-HTTP_Request2-' . microtime()); - } - return $this->_boundary; - } - - /** - * Returns next chunk of request body - * - * @param integer Amount of bytes to read - * @return string Up to $length bytes of data, empty string if at end - */ - public function read($length) - { - $ret = ''; - $boundary = $this->getBoundary(); - $paramCount = count($this->_params); - $uploadCount = count($this->_uploads); - while ($length > 0 && $this->_pos[0] <= $paramCount + $uploadCount) { - $oldLength = $length; - if ($this->_pos[0] < $paramCount) { - $param = sprintf($this->_headerParam, $boundary, - $this->_params[$this->_pos[0]][0]) . - $this->_params[$this->_pos[0]][1] . "\r\n"; - $ret .= substr($param, $this->_pos[1], $length); - $length -= min(strlen($param) - $this->_pos[1], $length); - - } elseif ($this->_pos[0] < $paramCount + $uploadCount) { - $pos = $this->_pos[0] - $paramCount; - $header = sprintf($this->_headerUpload, $boundary, - $this->_uploads[$pos]['name'], - $this->_uploads[$pos]['filename'], - $this->_uploads[$pos]['type']); - if ($this->_pos[1] < strlen($header)) { - $ret .= substr($header, $this->_pos[1], $length); - $length -= min(strlen($header) - $this->_pos[1], $length); - } - $filePos = max(0, $this->_pos[1] - strlen($header)); - if ($length > 0 && $filePos < $this->_uploads[$pos]['size']) { - $ret .= fread($this->_uploads[$pos]['fp'], $length); - $length -= min($length, $this->_uploads[$pos]['size'] - $filePos); - } - if ($length > 0) { - $start = $this->_pos[1] + ($oldLength - $length) - - strlen($header) - $this->_uploads[$pos]['size']; - $ret .= substr("\r\n", $start, $length);
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/Observer
Deleted
-(directory)
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/Observer/Log.php
Deleted
@@ -1,215 +0,0 @@ -<?php -/** - * An observer useful for debugging / testing. - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author David Jean Louis <izi@php.net> - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Log.php 308680 2011-02-25 17:40:17Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Exception class for HTTP_Request2 package - */ -require_once 'HTTP/Request2/Exception.php'; - -/** - * A debug observer useful for debugging / testing. - * - * This observer logs to a log target data corresponding to the various request - * and response events, it logs by default to php://output but can be configured - * to log to a file or via the PEAR Log package. - * - * A simple example: - * <code> - * require_once 'HTTP/Request2.php'; - * require_once 'HTTP/Request2/Observer/Log.php'; - * - * $request = new HTTP_Request2('http://www.example.com'); - * $observer = new HTTP_Request2_Observer_Log(); - * $request->attach($observer); - * $request->send(); - * </code> - * - * A more complex example with PEAR Log: - * <code> - * require_once 'HTTP/Request2.php'; - * require_once 'HTTP/Request2/Observer/Log.php'; - * require_once 'Log.php'; - * - * $request = new HTTP_Request2('http://www.example.com'); - * // we want to log with PEAR log - * $observer = new HTTP_Request2_Observer_Log(Log::factory('console')); - * - * // we only want to log received headers - * $observer->events = array('receivedHeaders'); - * - * $request->attach($observer); - * $request->send(); - * </code> - * - * @category HTTP - * @package HTTP_Request2 - * @author David Jean Louis <izi@php.net> - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 2.0.0 - * @link http://pear.php.net/package/HTTP_Request2 - */ -class HTTP_Request2_Observer_Log implements SplObserver -{ - // properties {{{ - - /** - * The log target, it can be a a resource or a PEAR Log instance. - * - * @var resource|Log $target - */ - protected $target = null; - - /** - * The events to log. - * - * @var array $events - */ - public $events = array( - 'connect', - 'sentHeaders', - 'sentBody', - 'receivedHeaders', - 'receivedBody', - 'disconnect', - ); - - // }}} - // __construct() {{{ - - /** - * Constructor. - * - * @param mixed $target Can be a file path (default: php://output), a resource, - * or an instance of the PEAR Log class. - * @param array $events Array of events to listen to (default: all events) - * - * @return void - */ - public function __construct($target = 'php://output', array $events = array()) - { - if (!empty($events)) { - $this->events = $events; - } - if (is_resource($target) || $target instanceof Log) { - $this->target = $target; - } elseif (false === ($this->target = @fopen($target, 'ab'))) { - throw new HTTP_Request2_Exception("Unable to open '{$target}'"); - } - } - - // }}} - // update() {{{ - - /** - * Called when the request notifies us of an event. - * - * @param HTTP_Request2 $subject The HTTP_Request2 instance - * - * @return void - */ - public function update(SplSubject $subject) - { - $event = $subject->getLastEvent(); - if (!in_array($event['name'], $this->events)) { - return; - } - - switch ($event['name']) { - case 'connect': - $this->log('* Connected to ' . $event['data']); - break; - case 'sentHeaders': - $headers = explode("\r\n", $event['data']); - array_pop($headers); - foreach ($headers as $header) { - $this->log('> ' . $header); - } - break; - case 'sentBody': - $this->log('> ' . $event['data'] . ' byte(s) sent'); - break; - case 'receivedHeaders': - $this->log(sprintf('< HTTP/%s %s %s', - $event['data']->getVersion(), - $event['data']->getStatus(), - $event['data']->getReasonPhrase())); - $headers = $event['data']->getHeader(); - foreach ($headers as $key => $val) { - $this->log('< ' . $key . ': ' . $val); - } - $this->log('< '); - break; - case 'receivedBody': - $this->log($event['data']->getBody()); - break; - case 'disconnect': - $this->log('* Disconnected'); - break; - } - } - - // }}} - // log() {{{ - - /** - * Logs the given message to the configured target. - * - * @param string $message Message to display
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/HTTP/Request2/Response.php
Deleted
@@ -1,643 +0,0 @@ -<?php -/** - * Class representing a HTTP response - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net> - * 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. - * * The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Response.php 317591 2011-10-01 08:37:49Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Exception class for HTTP_Request2 package - */ -require_once 'HTTP/Request2/Exception.php'; - -/** - * Class representing a HTTP response - * - * The class is designed to be used in "streaming" scenario, building the - * response as it is being received: - * <code> - * $statusLine = read_status_line(); - * $response = new HTTP_Request2_Response($statusLine); - * do { - * $headerLine = read_header_line(); - * $response->parseHeaderLine($headerLine); - * } while ($headerLine != ''); - * - * while ($chunk = read_body()) { - * $response->appendBody($chunk); - * } - * - * var_dump($response->getHeader(), $response->getCookies(), $response->getBody()); - * </code> - * - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov <avb@php.net> - * @version Release: 2.0.0 - * @link http://tools.ietf.org/html/rfc2616#section-6 - */ -class HTTP_Request2_Response -{ - /** - * HTTP protocol version (e.g. 1.0, 1.1) - * @var string - */ - protected $version; - - /** - * Status code - * @var integer - * @link http://tools.ietf.org/html/rfc2616#section-6.1.1 - */ - protected $code; - - /** - * Reason phrase - * @var string - * @link http://tools.ietf.org/html/rfc2616#section-6.1.1 - */ - protected $reasonPhrase; - - /** - * Effective URL (may be different from original request URL in case of redirects) - * @var string - */ - protected $effectiveUrl; - - /** - * Associative array of response headers - * @var array - */ - protected $headers = array(); - - /** - * Cookies set in the response - * @var array - */ - protected $cookies = array(); - - /** - * Name of last header processed by parseHederLine() - * - * Used to handle the headers that span multiple lines - * - * @var string - */ - protected $lastHeader = null; - - /** - * Response body - * @var string - */ - protected $body = ''; - - /** - * Whether the body is still encoded by Content-Encoding - * - * cURL provides the decoded body to the callback; if we are reading from - * socket the body is still gzipped / deflated - * - * @var bool - */ - protected $bodyEncoded; - - /** - * Associative array of HTTP status code / reason phrase. - * - * @var array - * @link http://tools.ietf.org/html/rfc2616#section-10 - */ - protected static $phrases = array( - - // 1xx: Informational - Request received, continuing process - 100 => 'Continue', - 101 => 'Switching Protocols', - - // 2xx: Success - The action was successfully received, understood and - // accepted - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - - // 3xx: Redirection - Further action must be taken in order to complete - // the request - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', // 1.1 - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 307 => 'Temporary Redirect', - - // 4xx: Client Error - The request contains bad syntax or cannot be - // fulfilled - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Timeout', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Long', - 415 => 'Unsupported Media Type', - 416 => 'Requested Range Not Satisfiable', - 417 => 'Expectation Failed', - - // 5xx: Server Error - The server failed to fulfill an apparently - // valid request - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable',
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Mail
Deleted
-(directory)
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Mail.php
Deleted
@@ -1,270 +0,0 @@ -<?php -/** - * PEAR's Mail:: interface. - * - * PHP versions 4 and 5 - * - * LICENSE: - * - * Copyright (c) 2002-2007, Richard Heyes - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * o 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. - * o The names of the authors may not 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. - * - * @category Mail - * @package Mail - * @author Chuck Hagenbuch <chuck@horde.org> - * @copyright 1997-2010 Chuck Hagenbuch - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Mail.php 294747 2010-02-08 08:18:33Z clockwerx $ - * @link http://pear.php.net/package/Mail/ - */ - -require_once 'PEAR.php'; - -/** - * PEAR's Mail:: interface. Defines the interface for implementing - * mailers under the PEAR hierarchy, and provides supporting functions - * useful in multiple mailer backends. - * - * @access public - * @version $Revision: 294747 $ - * @package Mail - */ -class Mail -{ - /** - * Line terminator used for separating header lines. - * @var string - */ - var $sep = "\r\n"; - - /** - * Provides an interface for generating Mail:: objects of various - * types - * - * @param string $driver The kind of Mail:: object to instantiate. - * @param array $params The parameters to pass to the Mail:: object. - * @return object Mail a instance of the driver class or if fails a PEAR Error - * @access public - */ - function &factory($driver, $params = array()) - { - $driver = strtolower($driver); - @include_once 'Mail/' . $driver . '.php'; - $class = 'Mail_' . $driver; - if (class_exists($class)) { - $mailer = new $class($params); - return $mailer; - } else { - return PEAR::raiseError('Unable to find class for driver ' . $driver); - } - } - - /** - * Implements Mail::send() function using php's built-in mail() - * command. - * - * @param mixed $recipients Either a comma-seperated list of recipients - * (RFC822 compliant), or an array of recipients, - * each RFC822 valid. This may contain recipients not - * specified in the headers, for Bcc:, resending - * messages, etc. - * - * @param array $headers The array of headers to send with the mail, in an - * associative array, where the array key is the - * header name (ie, 'Subject'), and the array value - * is the header value (ie, 'test'). The header - * produced from those values would be 'Subject: - * test'. - * - * @param string $body The full text of the message body, including any - * Mime parts, etc. - * - * @return mixed Returns true on success, or a PEAR_Error - * containing a descriptive error message on - * failure. - * - * @access public - * @deprecated use Mail_mail::send instead - */ - function send($recipients, $headers, $body) - { - if (!is_array($headers)) { - return PEAR::raiseError('$headers must be an array'); - } - - $result = $this->_sanitizeHeaders($headers); - if (is_a($result, 'PEAR_Error')) { - return $result; - } - - // if we're passed an array of recipients, implode it. - if (is_array($recipients)) { - $recipients = implode(', ', $recipients); - } - - // get the Subject out of the headers array so that we can - // pass it as a seperate argument to mail(). - $subject = ''; - if (isset($headers['Subject'])) { - $subject = $headers['Subject']; - unset($headers['Subject']); - } - - // flatten the headers out. - list(, $text_headers) = Mail::prepareHeaders($headers); - - return mail($recipients, $subject, $body, $text_headers); - } - - /** - * Sanitize an array of mail headers by removing any additional header - * strings present in a legitimate header's value. The goal of this - * filter is to prevent mail injection attacks. - * - * @param array $headers The associative array of headers to sanitize. - * - * @access private - */ - function _sanitizeHeaders(&$headers) - { - foreach ($headers as $key => $value) { - $headers[$key] = - preg_replace('=((<CR>|<LF>|0x0A/%0A|0x0D/%0D|\\n|\\r)\S).*=i', - null, $value); - } - } - - /** - * Take an array of mail headers and return a string containing - * text usable in sending a message. - * - * @param array $headers The array of headers to prepare, in an associative - * array, where the array key is the header name (ie, - * 'Subject'), and the array value is the header - * value (ie, 'test'). The header produced from those - * values would be 'Subject: test'. - * - * @return mixed Returns false if it encounters a bad address, - * otherwise returns an array containing two - * elements: Any From: address found in the headers, - * and the plain text version of the headers. - * @access private - */ - function prepareHeaders($headers) - { - $lines = array(); - $from = null; - - foreach ($headers as $key => $value) { - if (strcasecmp($key, 'From') === 0) { - include_once 'Mail/RFC822.php'; - $parser = new Mail_RFC822(); - $addresses = $parser->parseAddressList($value, 'localhost', false); - if (is_a($addresses, 'PEAR_Error')) { - return $addresses; - } - - $from = $addresses[0]->mailbox . '@' . $addresses[0]->host; - - // Reject envelope From: addresses with spaces. - if (strstr($from, ' ')) { - return false; - } - - $lines[] = $key . ': ' . $value;
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Mail/RFC822.php
Deleted
@@ -1,951 +0,0 @@ -<?php -/** - * RFC 822 Email address list validation Utility - * - * PHP versions 4 and 5 - * - * LICENSE: - * - * Copyright (c) 2001-2010, Richard Heyes - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * o 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. - * o The names of the authors may not 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. - * - * @category Mail - * @package Mail - * @author Richard Heyes <richard@phpguru.org> - * @author Chuck Hagenbuch <chuck@horde.org - * @copyright 2001-2010 Richard Heyes - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: RFC822.php 294749 2010-02-08 08:22:25Z clockwerx $ - * @link http://pear.php.net/package/Mail/ - */ - -/** - * RFC 822 Email address list validation Utility - * - * What is it? - * - * This class will take an address string, and parse it into it's consituent - * parts, be that either addresses, groups, or combinations. Nested groups - * are not supported. The structure it returns is pretty straight forward, - * and is similar to that provided by the imap_rfc822_parse_adrlist(). Use - * print_r() to view the structure. - * - * How do I use it? - * - * $address_string = 'My Group: "Richard" <richard@localhost> (A comment), ted@example.com (Ted Bloggs), Barney;'; - * $structure = Mail_RFC822::parseAddressList($address_string, 'example.com', true) - * print_r($structure); - * - * @author Richard Heyes <richard@phpguru.org> - * @author Chuck Hagenbuch <chuck@horde.org> - * @version $Revision: 294749 $ - * @license BSD - * @package Mail - */ -class Mail_RFC822 { - - /** - * The address being parsed by the RFC822 object. - * @var string $address - */ - var $address = ''; - - /** - * The default domain to use for unqualified addresses. - * @var string $default_domain - */ - var $default_domain = 'localhost'; - - /** - * Should we return a nested array showing groups, or flatten everything? - * @var boolean $nestGroups - */ - var $nestGroups = true; - - /** - * Whether or not to validate atoms for non-ascii characters. - * @var boolean $validate - */ - var $validate = true; - - /** - * The array of raw addresses built up as we parse. - * @var array $addresses - */ - var $addresses = array(); - - /** - * The final array of parsed address information that we build up. - * @var array $structure - */ - var $structure = array(); - - /** - * The current error message, if any. - * @var string $error - */ - var $error = null; - - /** - * An internal counter/pointer. - * @var integer $index - */ - var $index = null; - - /** - * The number of groups that have been found in the address list. - * @var integer $num_groups - * @access public - */ - var $num_groups = 0; - - /** - * A variable so that we can tell whether or not we're inside a - * Mail_RFC822 object. - * @var boolean $mailRFC822 - */ - var $mailRFC822 = true; - - /** - * A limit after which processing stops - * @var int $limit - */ - var $limit = null; - - /** - * Sets up the object. The address must either be set here or when - * calling parseAddressList(). One or the other. - * - * @access public - * @param string $address The address(es) to validate. - * @param string $default_domain Default domain/host etc. If not supplied, will be set to localhost. - * @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing. - * @param boolean $validate Whether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance. - * - * @return object Mail_RFC822 A new Mail_RFC822 object. - */ - function Mail_RFC822($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null) - { - if (isset($address)) $this->address = $address; - if (isset($default_domain)) $this->default_domain = $default_domain; - if (isset($nest_groups)) $this->nestGroups = $nest_groups; - if (isset($validate)) $this->validate = $validate; - if (isset($limit)) $this->limit = $limit; - } - - /** - * Starts the whole process. The address must either be set here - * or when creating the object. One or the other. - * - * @access public - * @param string $address The address(es) to validate. - * @param string $default_domain Default domain/host etc. - * @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing. - * @param boolean $validate Whether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance. - * - * @return array A structured array of addresses. - */ - function parseAddressList($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null) - { - if (!isset($this) || !isset($this->mailRFC822)) { - $obj = new Mail_RFC822($address, $default_domain, $nest_groups, $validate, $limit); - return $obj->parseAddressList(); - } - - if (isset($address)) $this->address = $address; - if (isset($default_domain)) $this->default_domain = $default_domain; - if (isset($nest_groups)) $this->nestGroups = $nest_groups; - if (isset($validate)) $this->validate = $validate; - if (isset($limit)) $this->limit = $limit; - - $this->structure = array(); - $this->addresses = array(); - $this->error = null; - $this->index = null; - - // Unfold any long lines in $this->address. - $this->address = preg_replace('/\r?\n/', "\r\n", $this->address); - $this->address = preg_replace('/\r\n(\t| )+/', ' ', $this->address); - - while ($this->address = $this->_splitAddresses($this->address)); - - if ($this->address === false || isset($this->error)) { - require_once 'PEAR.php'; - return PEAR::raiseError($this->error);
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Mail/mail.php
Deleted
@@ -1,168 +0,0 @@ -<?php -/** - * internal PHP-mail() implementation of the PEAR Mail:: interface. - * - * PHP versions 4 and 5 - * - * LICENSE: - * - * Copyright (c) 2010 Chuck Hagenbuch - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * o 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. - * o The names of the authors may not 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. - * - * @category Mail - * @package Mail - * @author Chuck Hagenbuch <chuck@horde.org> - * @copyright 2010 Chuck Hagenbuch - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: mail.php 294747 2010-02-08 08:18:33Z clockwerx $ - * @link http://pear.php.net/package/Mail/ - */ - -/** - * internal PHP-mail() implementation of the PEAR Mail:: interface. - * @package Mail - * @version $Revision: 294747 $ - */ -class Mail_mail extends Mail { - - /** - * Any arguments to pass to the mail() function. - * @var string - */ - var $_params = ''; - - /** - * Constructor. - * - * Instantiates a new Mail_mail:: object based on the parameters - * passed in. - * - * @param array $params Extra arguments for the mail() function. - */ - function Mail_mail($params = null) - { - // The other mail implementations accept parameters as arrays. - // In the interest of being consistent, explode an array into - // a string of parameter arguments. - if (is_array($params)) { - $this->_params = join(' ', $params); - } else { - $this->_params = $params; - } - - /* Because the mail() function may pass headers as command - * line arguments, we can't guarantee the use of the standard - * "\r\n" separator. Instead, we use the system's native line - * separator. */ - if (defined('PHP_EOL')) { - $this->sep = PHP_EOL; - } else { - $this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n"; - } - } - - /** - * Implements Mail_mail::send() function using php's built-in mail() - * command. - * - * @param mixed $recipients Either a comma-seperated list of recipients - * (RFC822 compliant), or an array of recipients, - * each RFC822 valid. This may contain recipients not - * specified in the headers, for Bcc:, resending - * messages, etc. - * - * @param array $headers The array of headers to send with the mail, in an - * associative array, where the array key is the - * header name (ie, 'Subject'), and the array value - * is the header value (ie, 'test'). The header - * produced from those values would be 'Subject: - * test'. - * - * @param string $body The full text of the message body, including any - * Mime parts, etc. - * - * @return mixed Returns true on success, or a PEAR_Error - * containing a descriptive error message on - * failure. - * - * @access public - */ - function send($recipients, $headers, $body) - { - if (!is_array($headers)) { - return PEAR::raiseError('$headers must be an array'); - } - - $result = $this->_sanitizeHeaders($headers); - if (is_a($result, 'PEAR_Error')) { - return $result; - } - - // If we're passed an array of recipients, implode it. - if (is_array($recipients)) { - $recipients = implode(', ', $recipients); - } - - // Get the Subject out of the headers array so that we can - // pass it as a seperate argument to mail(). - $subject = ''; - if (isset($headers['Subject'])) { - $subject = $headers['Subject']; - unset($headers['Subject']); - } - - // Also remove the To: header. The mail() function will add its own - // To: header based on the contents of $recipients. - unset($headers['To']); - - // Flatten the headers out. - $headerElements = $this->prepareHeaders($headers); - if (is_a($headerElements, 'PEAR_Error')) { - return $headerElements; - } - list(, $text_headers) = $headerElements; - - // We only use mail()'s optional fifth parameter if the additional - // parameters have been provided and we're not running in safe mode. - if (empty($this->_params) || ini_get('safe_mode')) { - $result = mail($recipients, $subject, $body, $text_headers); - } else { - $result = mail($recipients, $subject, $body, $text_headers, - $this->_params); - } - - // If the mail() function returned failure, we need to create a - // PEAR_Error object and return it instead of the boolean result. - if ($result === false) { - $result = PEAR::raiseError('mail() returned failure'); - } - - return $result; - } - -}
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Mail/mock.php
Deleted
@@ -1,143 +0,0 @@ -<?php -/** - * Mock implementation - * - * PHP versions 4 and 5 - * - * LICENSE: - * - * Copyright (c) 2010 Chuck Hagenbuch - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * o 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. - * o The names of the authors may not 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. - * - * @category Mail - * @package Mail - * @author Chuck Hagenbuch <chuck@horde.org> - * @copyright 2010 Chuck Hagenbuch - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: mock.php 294747 2010-02-08 08:18:33Z clockwerx $ - * @link http://pear.php.net/package/Mail/ - */ - -/** - * Mock implementation of the PEAR Mail:: interface for testing. - * @access public - * @package Mail - * @version $Revision: 294747 $ - */ -class Mail_mock extends Mail { - - /** - * Array of messages that have been sent with the mock. - * - * @var array - * @access public - */ - var $sentMessages = array(); - - /** - * Callback before sending mail. - * - * @var callback - */ - var $_preSendCallback; - - /** - * Callback after sending mai. - * - * @var callback - */ - var $_postSendCallback; - - /** - * Constructor. - * - * Instantiates a new Mail_mock:: object based on the parameters - * passed in. It looks for the following parameters, both optional: - * preSendCallback Called before an email would be sent. - * postSendCallback Called after an email would have been sent. - * - * @param array Hash containing any parameters. - * @access public - */ - function Mail_mock($params) - { - if (isset($params['preSendCallback']) && - is_callable($params['preSendCallback'])) { - $this->_preSendCallback = $params['preSendCallback']; - } - - if (isset($params['postSendCallback']) && - is_callable($params['postSendCallback'])) { - $this->_postSendCallback = $params['postSendCallback']; - } - } - - /** - * Implements Mail_mock::send() function. Silently discards all - * mail. - * - * @param mixed $recipients Either a comma-seperated list of recipients - * (RFC822 compliant), or an array of recipients, - * each RFC822 valid. This may contain recipients not - * specified in the headers, for Bcc:, resending - * messages, etc. - * - * @param array $headers The array of headers to send with the mail, in an - * associative array, where the array key is the - * header name (ie, 'Subject'), and the array value - * is the header value (ie, 'test'). The header - * produced from those values would be 'Subject: - * test'. - * - * @param string $body The full text of the message body, including any - * Mime parts, etc. - * - * @return mixed Returns true on success, or a PEAR_Error - * containing a descriptive error message on - * failure. - * @access public - */ - function send($recipients, $headers, $body) - { - if ($this->_preSendCallback) { - call_user_func_array($this->_preSendCallback, - array(&$this, $recipients, $headers, $body)); - } - - $entry = array('recipients' => $recipients, 'headers' => $headers, 'body' => $body); - $this->sentMessages[] = $entry; - - if ($this->_postSendCallback) { - call_user_func_array($this->_postSendCallback, - array(&$this, $recipients, $headers, $body)); - } - - return true; - } - -}
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Mail/null.php
Deleted
@@ -1,84 +0,0 @@ -<?php -/** - * Null implementation of the PEAR Mail interface - * - * PHP versions 4 and 5 - * - * LICENSE: - * - * Copyright (c) 2010 Phil Kernick - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * o 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. - * o The names of the authors may not 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. - * - * @category Mail - * @package Mail - * @author Phil Kernick <philk@rotfl.com.au> - * @copyright 2010 Phil Kernick - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: null.php 294747 2010-02-08 08:18:33Z clockwerx $ - * @link http://pear.php.net/package/Mail/ - */ - -/** - * Null implementation of the PEAR Mail:: interface. - * @access public - * @package Mail - * @version $Revision: 294747 $ - */ -class Mail_null extends Mail { - - /** - * Implements Mail_null::send() function. Silently discards all - * mail. - * - * @param mixed $recipients Either a comma-seperated list of recipients - * (RFC822 compliant), or an array of recipients, - * each RFC822 valid. This may contain recipients not - * specified in the headers, for Bcc:, resending - * messages, etc. - * - * @param array $headers The array of headers to send with the mail, in an - * associative array, where the array key is the - * header name (ie, 'Subject'), and the array value - * is the header value (ie, 'test'). The header - * produced from those values would be 'Subject: - * test'. - * - * @param string $body The full text of the message body, including any - * Mime parts, etc. - * - * @return mixed Returns true on success, or a PEAR_Error - * containing a descriptive error message on - * failure. - * @access public - */ - function send($recipients, $headers, $body) - { - return true; - } - -}
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Mail/sendmail.php
Deleted
@@ -1,171 +0,0 @@ -<?php -// -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Author: Chuck Hagenbuch <chuck@horde.org> | -// +----------------------------------------------------------------------+ - -/** - * Sendmail implementation of the PEAR Mail:: interface. - * @access public - * @package Mail - * @version $Revision: 294744 $ - */ -class Mail_sendmail extends Mail { - - /** - * The location of the sendmail or sendmail wrapper binary on the - * filesystem. - * @var string - */ - var $sendmail_path = '/usr/sbin/sendmail'; - - /** - * Any extra command-line parameters to pass to the sendmail or - * sendmail wrapper binary. - * @var string - */ - var $sendmail_args = '-i'; - - /** - * Constructor. - * - * Instantiates a new Mail_sendmail:: object based on the parameters - * passed in. It looks for the following parameters: - * sendmail_path The location of the sendmail binary on the - * filesystem. Defaults to '/usr/sbin/sendmail'. - * - * sendmail_args Any extra parameters to pass to the sendmail - * or sendmail wrapper binary. - * - * If a parameter is present in the $params array, it replaces the - * default. - * - * @param array $params Hash containing any parameters different from the - * defaults. - * @access public - */ - function Mail_sendmail($params) - { - if (isset($params['sendmail_path'])) { - $this->sendmail_path = $params['sendmail_path']; - } - if (isset($params['sendmail_args'])) { - $this->sendmail_args = $params['sendmail_args']; - } - - /* - * Because we need to pass message headers to the sendmail program on - * the commandline, we can't guarantee the use of the standard "\r\n" - * separator. Instead, we use the system's native line separator. - */ - if (defined('PHP_EOL')) { - $this->sep = PHP_EOL; - } else { - $this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n"; - } - } - - /** - * Implements Mail::send() function using the sendmail - * command-line binary. - * - * @param mixed $recipients Either a comma-seperated list of recipients - * (RFC822 compliant), or an array of recipients, - * each RFC822 valid. This may contain recipients not - * specified in the headers, for Bcc:, resending - * messages, etc. - * - * @param array $headers The array of headers to send with the mail, in an - * associative array, where the array key is the - * header name (ie, 'Subject'), and the array value - * is the header value (ie, 'test'). The header - * produced from those values would be 'Subject: - * test'. - * - * @param string $body The full text of the message body, including any - * Mime parts, etc. - * - * @return mixed Returns true on success, or a PEAR_Error - * containing a descriptive error message on - * failure. - * @access public - */ - function send($recipients, $headers, $body) - { - if (!is_array($headers)) { - return PEAR::raiseError('$headers must be an array'); - } - - $result = $this->_sanitizeHeaders($headers); - if (is_a($result, 'PEAR_Error')) { - return $result; - } - - $recipients = $this->parseRecipients($recipients); - if (is_a($recipients, 'PEAR_Error')) { - return $recipients; - } - $recipients = implode(' ', array_map('escapeshellarg', $recipients)); - - $headerElements = $this->prepareHeaders($headers); - if (is_a($headerElements, 'PEAR_Error')) { - return $headerElements; - } - list($from, $text_headers) = $headerElements; - - /* Since few MTAs are going to allow this header to be forged - * unless it's in the MAIL FROM: exchange, we'll use - * Return-Path instead of From: if it's set. */ - if (!empty($headers['Return-Path'])) { - $from = $headers['Return-Path']; - } - - if (!isset($from)) { - return PEAR::raiseError('No from address given.'); - } elseif (strpos($from, ' ') !== false || - strpos($from, ';') !== false || - strpos($from, '&') !== false || - strpos($from, '`') !== false) { - return PEAR::raiseError('From address specified with dangerous characters.'); - } - - $from = escapeshellarg($from); // Security bug #16200 - - $mail = @popen($this->sendmail_path . (!empty($this->sendmail_args) ? ' ' . $this->sendmail_args : '') . " -f$from -- $recipients", 'w'); - if (!$mail) { - return PEAR::raiseError('Failed to open sendmail [' . $this->sendmail_path . '] for execution.'); - } - - // Write the headers following by two newlines: one to end the headers - // section and a second to separate the headers block from the body. - fputs($mail, $text_headers . $this->sep . $this->sep); - - fputs($mail, $body); - $result = pclose($mail); - if (version_compare(phpversion(), '4.2.3') == -1) { - // With older php versions, we need to shift the pclose - // result to get the exit code. - $result = $result >> 8 & 0xFF; - } - - if ($result != 0) { - return PEAR::raiseError('sendmail returned error code ' . $result, - $result); - } - - return true; - } - -}
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Mail/smtp.php
Deleted
@@ -1,444 +0,0 @@ -<?php -/** - * SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class. - * - * PHP versions 4 and 5 - * - * LICENSE: - * - * Copyright (c) 2010, Chuck Hagenbuch - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * o 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. - * o The names of the authors may not 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. - * - * @category HTTP - * @package HTTP_Request - * @author Jon Parise <jon@php.net> - * @author Chuck Hagenbuch <chuck@horde.org> - * @copyright 2010 Chuck Hagenbuch - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: smtp.php 294747 2010-02-08 08:18:33Z clockwerx $ - * @link http://pear.php.net/package/Mail/ - */ - -/** Error: Failed to create a Net_SMTP object */ -define('PEAR_MAIL_SMTP_ERROR_CREATE', 10000); - -/** Error: Failed to connect to SMTP server */ -define('PEAR_MAIL_SMTP_ERROR_CONNECT', 10001); - -/** Error: SMTP authentication failure */ -define('PEAR_MAIL_SMTP_ERROR_AUTH', 10002); - -/** Error: No From: address has been provided */ -define('PEAR_MAIL_SMTP_ERROR_FROM', 10003); - -/** Error: Failed to set sender */ -define('PEAR_MAIL_SMTP_ERROR_SENDER', 10004); - -/** Error: Failed to add recipient */ -define('PEAR_MAIL_SMTP_ERROR_RECIPIENT', 10005); - -/** Error: Failed to send data */ -define('PEAR_MAIL_SMTP_ERROR_DATA', 10006); - -/** - * SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class. - * @access public - * @package Mail - * @version $Revision: 294747 $ - */ -class Mail_smtp extends Mail { - - /** - * SMTP connection object. - * - * @var object - * @access private - */ - var $_smtp = null; - - /** - * The list of service extension parameters to pass to the Net_SMTP - * mailFrom() command. - * @var array - */ - var $_extparams = array(); - - /** - * The SMTP host to connect to. - * @var string - */ - var $host = 'localhost'; - - /** - * The port the SMTP server is on. - * @var integer - */ - var $port = 25; - - /** - * Should SMTP authentication be used? - * - * This value may be set to true, false or the name of a specific - * authentication method. - * - * If the value is set to true, the Net_SMTP package will attempt to use - * the best authentication method advertised by the remote SMTP server. - * - * @var mixed - */ - var $auth = false; - - /** - * The username to use if the SMTP server requires authentication. - * @var string - */ - var $username = ''; - - /** - * The password to use if the SMTP server requires authentication. - * @var string - */ - var $password = ''; - - /** - * Hostname or domain that will be sent to the remote SMTP server in the - * HELO / EHLO message. - * - * @var string - */ - var $localhost = 'localhost'; - - /** - * SMTP connection timeout value. NULL indicates no timeout. - * - * @var integer - */ - var $timeout = null; - - /** - * Turn on Net_SMTP debugging? - * - * @var boolean $debug - */ - var $debug = false; - - /** - * Indicates whether or not the SMTP connection should persist over - * multiple calls to the send() method. - * - * @var boolean - */ - var $persist = false; - - /** - * Use SMTP command pipelining (specified in RFC 2920) if the SMTP server - * supports it. This speeds up delivery over high-latency connections. By - * default, use the default value supplied by Net_SMTP. - * @var bool - */ - var $pipelining; - - /** - * Constructor. - * - * Instantiates a new Mail_smtp:: object based on the parameters - * passed in. It looks for the following parameters: - * host The server to connect to. Defaults to localhost. - * port The port to connect to. Defaults to 25. - * auth SMTP authentication. Defaults to none. - * username The username to use for SMTP auth. No default. - * password The password to use for SMTP auth. No default. - * localhost The local hostname / domain. Defaults to localhost. - * timeout The SMTP connection timeout. Defaults to none. - * verp Whether to use VERP or not. Defaults to false. - * DEPRECATED as of 1.2.0 (use setMailParams()). - * debug Activate SMTP debug mode? Defaults to false. - * persist Should the SMTP connection persist? - * pipelining Use SMTP command pipelining - * - * If a parameter is present in the $params array, it replaces the - * default. - * - * @param array Hash containing any parameters different from the - * defaults. - * @access public - */ - function Mail_smtp($params) - { - if (isset($params['host'])) $this->host = $params['host']; - if (isset($params['port'])) $this->port = $params['port']; - if (isset($params['auth'])) $this->auth = $params['auth']; - if (isset($params['username'])) $this->username = $params['username']; - if (isset($params['password'])) $this->password = $params['password']; - if (isset($params['localhost'])) $this->localhost = $params['localhost']; - if (isset($params['timeout'])) $this->timeout = $params['timeout'];
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Mail/smtpmx.php
Deleted
@@ -1,502 +0,0 @@ -<?PHP -/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ - -/** - * SMTP MX - * - * SMTP MX implementation of the PEAR Mail interface. Requires the Net_SMTP class. - * - * PHP versions 4 and 5 - * - * LICENSE: - * - * Copyright (c) 2010, gERD Schaufelberger - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * o 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. - * o The names of the authors may not 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. - * - * @category Mail - * @package Mail_smtpmx - * @author gERD Schaufelberger <gerd@php-tools.net> - * @copyright 2010 gERD Schaufelberger - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: smtpmx.php 294747 2010-02-08 08:18:33Z clockwerx $ - * @link http://pear.php.net/package/Mail/ - */ - -require_once 'Net/SMTP.php'; - -/** - * SMTP MX implementation of the PEAR Mail interface. Requires the Net_SMTP class. - * - * - * @access public - * @author gERD Schaufelberger <gerd@php-tools.net> - * @package Mail - * @version $Revision: 294747 $ - */ -class Mail_smtpmx extends Mail { - - /** - * SMTP connection object. - * - * @var object - * @access private - */ - var $_smtp = null; - - /** - * The port the SMTP server is on. - * @var integer - * @see getservicebyname() - */ - var $port = 25; - - /** - * Hostname or domain that will be sent to the remote SMTP server in the - * HELO / EHLO message. - * - * @var string - * @see posix_uname() - */ - var $mailname = 'localhost'; - - /** - * SMTP connection timeout value. NULL indicates no timeout. - * - * @var integer - */ - var $timeout = 10; - - /** - * use either PEAR:Net_DNS or getmxrr - * - * @var boolean - */ - var $withNetDns = true; - - /** - * PEAR:Net_DNS_Resolver - * - * @var object - */ - var $resolver; - - /** - * Whether to use VERP or not. If not a boolean, the string value - * will be used as the VERP separators. - * - * @var mixed boolean or string - */ - var $verp = false; - - /** - * Whether to use VRFY or not. - * - * @var boolean $vrfy - */ - var $vrfy = false; - - /** - * Switch to test mode - don't send emails for real - * - * @var boolean $debug - */ - var $test = false; - - /** - * Turn on Net_SMTP debugging? - * - * @var boolean $peardebug - */ - var $debug = false; - - /** - * internal error codes - * - * translate internal error identifier to PEAR-Error codes and human - * readable messages. - * - * @var boolean $debug - * @todo as I need unique error-codes to identify what exactly went wrond - * I did not use intergers as it should be. Instead I added a "namespace" - * for each code. This avoids conflicts with error codes from different - * classes. How can I use unique error codes and stay conform with PEAR? - */ - var $errorCode = array( - 'not_connected' => array( - 'code' => 1, - 'msg' => 'Could not connect to any mail server ({HOST}) at port {PORT} to send mail to {RCPT}.' - ), - 'failed_vrfy_rcpt' => array( - 'code' => 2, - 'msg' => 'Recipient "{RCPT}" could not be veryfied.' - ), - 'failed_set_from' => array( - 'code' => 3, - 'msg' => 'Failed to set sender: {FROM}.' - ), - 'failed_set_rcpt' => array( - 'code' => 4, - 'msg' => 'Failed to set recipient: {RCPT}.' - ), - 'failed_send_data' => array( - 'code' => 5, - 'msg' => 'Failed to send mail to: {RCPT}.' - ), - 'no_from' => array( - 'code' => 5, - 'msg' => 'No from address has be provided.' - ), - 'send_data' => array( - 'code' => 7, - 'msg' => 'Failed to create Net_SMTP object.' - ), - 'no_mx' => array( - 'code' => 8, - 'msg' => 'No MX-record for {RCPT} found.' - ), - 'no_resolver' => array( - 'code' => 9, - 'msg' => 'Could not start resolver! Install PEAR:Net_DNS or switch off "netdns"' - ), - 'failed_rset' => array( - 'code' => 10, - 'msg' => 'RSET command failed, SMTP-connection corrupt.' - ), - ); - - /** - * Constructor. - * - * Instantiates a new Mail_smtp:: object based on the parameters - * passed in. It looks for the following parameters: - * mailname The name of the local mail system (a valid hostname which matches the reverse lookup) - * port smtp-port - the default comes from getservicebyname() and should work fine - * timeout The SMTP connection timeout. Defaults to 30 seconds.
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Net
Deleted
-(directory)
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Net/LDAP3
Deleted
-(directory)
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Net/LDAP3.php
Deleted
@@ -1,3118 +0,0 @@ -<?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 -{ - 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 - * '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, - ); - - 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 $_supported_control = array(); - protected $_vlv_indexes_and_searches; - - /** - * Constructor - * - * @param array $config Configuration parameters that have not already - * been initialized. For configuration parameters - * that have in fact been set, use the config_set() - * method after initialization. - */ - public function __construct($config = array()) - { - if (!empty($config) && is_array($config)) { - foreach ($config as $key => $value) { - if (empty($this->config[$key])) { - $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("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). - $this->_debug("Entry DN", $entry_dn); - $this->_debug("Attributes", $attributes); - - foreach ($attributes as $attr_name => $attr_value) { - if (empty($attr_value)) {
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Net/LDAP3/Result.php
Deleted
@@ -1,161 +0,0 @@ -<?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; - - 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; - } - - public function get($property, $default = null) - { - if (isset($this->$property)) { - return $this->$property; - } else { - return $default; - } - } - - public function set($property, $value) - { - $this->$property = $value; - } - - /** - * Wrapper for ldap_sort() - */ - public function sort($attr) - { - return ldap_sort($this->conn, $this->result, $attr); - } - - /** - * Get entries count - */ - 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
kolab-webadmin-3.2.11.tar.gz/lib/ext/Net/SMTP.php
Deleted
@@ -1,1342 +0,0 @@ -<?php -/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Chuck Hagenbuch <chuck@horde.org> | -// | Jon Parise <jon@php.net> | -// | Damian Alejandro Fernandez Sosa <damlists@cnba.uba.ar> | -// +----------------------------------------------------------------------+ -// -// $Id: SMTP.php 314875 2011-08-13 17:03:30Z jon $ - -require_once 'PEAR.php'; -require_once 'Net/Socket.php'; - -/** - * Provides an implementation of the SMTP protocol using PEAR's - * Net_Socket:: class. - * - * @package Net_SMTP - * @author Chuck Hagenbuch <chuck@horde.org> - * @author Jon Parise <jon@php.net> - * @author Damian Alejandro Fernandez Sosa <damlists@cnba.uba.ar> - * - * @example basic.php A basic implementation of the Net_SMTP package. - */ -class Net_SMTP -{ - /** - * The server to connect to. - * @var string - * @access public - */ - var $host = 'localhost'; - - /** - * The port to connect to. - * @var int - * @access public - */ - var $port = 25; - - /** - * The value to give when sending EHLO or HELO. - * @var string - * @access public - */ - var $localhost = 'localhost'; - - /** - * List of supported authentication methods, in preferential order. - * @var array - * @access public - */ - var $auth_methods = array(); - - /** - * Use SMTP command pipelining (specified in RFC 2920) if the SMTP - * server supports it. - * - * When pipeling is enabled, rcptTo(), mailFrom(), sendFrom(), - * somlFrom() and samlFrom() do not wait for a response from the - * SMTP server but return immediately. - * - * @var bool - * @access public - */ - var $pipelining = false; - - /** - * Number of pipelined commands. - * @var int - * @access private - */ - var $_pipelined_commands = 0; - - /** - * Should debugging output be enabled? - * @var boolean - * @access private - */ - var $_debug = false; - - /** - * Debug output handler. - * @var callback - * @access private - */ - var $_debug_handler = null; - - /** - * The socket resource being used to connect to the SMTP server. - * @var resource - * @access private - */ - var $_socket = null; - - /** - * Array of socket options that will be passed to Net_Socket::connect(). - * @see stream_context_create() - * @var array - * @access private - */ - var $_socket_options = null; - - /** - * The socket I/O timeout value in seconds. - * @var int - * @access private - */ - var $_timeout = 0; - - /** - * The most recent server response code. - * @var int - * @access private - */ - var $_code = -1; - - /** - * The most recent server response arguments. - * @var array - * @access private - */ - var $_arguments = array(); - - /** - * Stores the SMTP server's greeting string. - * @var string - * @access private - */ - var $_greeting = null; - - /** - * Stores detected features of the SMTP server. - * @var array - * @access private - */ - var $_esmtp = array(); - - /** - * Instantiates a new Net_SMTP object, overriding any defaults - * with parameters that are passed in. - * - * If you have SSL support in PHP, you can connect to a server - * over SSL using an 'ssl://' prefix: - * - * // 465 is a common smtps port. - * $smtp = new Net_SMTP('ssl://mail.host.com', 465); - * $smtp->connect(); - * - * @param string $host The server to connect to. - * @param integer $port The port to connect to. - * @param string $localhost The value to give when sending EHLO or HELO. - * @param boolean $pipeling Use SMTP command pipelining - * @param integer $timeout Socket I/O timeout in seconds. - * @param array $socket_options Socket stream_context_create() options. - * - * @access public - * @since 1.0 - */ - function Net_SMTP($host = null, $port = null, $localhost = null, - $pipelining = false, $timeout = 0, $socket_options = null) - { - if (isset($host)) { - $this->host = $host; - } - if (isset($port)) { - $this->port = $port; - } - if (isset($localhost)) { - $this->localhost = $localhost; - } - $this->pipelining = $pipelining; - - $this->_socket = new Net_Socket(); - $this->_socket_options = $socket_options; - $this->_timeout = $timeout; - - /* Include the Auth_SASL package. If the package is available, we - * enable the authentication methods that depend upon it. */ - if (@include_once 'Auth/SASL.php') { - $this->setAuthMethod('CRAM-MD5', array($this, '_authCram_MD5')); - $this->setAuthMethod('DIGEST-MD5', array($this, '_authDigest_MD5')); - } - - /* These standard authentication methods are always available. */ - $this->setAuthMethod('LOGIN', array($this, '_authLogin'), false); - $this->setAuthMethod('PLAIN', array($this, '_authPlain'), false);
View file
kolab-webadmin-3.2.11.tar.gz/lib/ext/Net/URL2.php
Deleted
@@ -1,942 +0,0 @@ -<?php -/** - * Net_URL2, a class representing a URL as per RFC 3986. - * - * PHP version 5 - * - * LICENSE: - * - * Copyright (c) 2007-2009, Peytz & Co. A/S - * 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 the Net_URL2 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. - * - * @category Networking - * @package Net_URL2 - * @author Christian Schmidt <schmidt@php.net> - * @copyright 2007-2009 Peytz & Co. A/S - * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: URL2.php 309223 2011-03-14 14:26:32Z till $ - * @link http://www.rfc-editor.org/rfc/rfc3986.txt - */ - -/** - * Represents a URL as per RFC 3986. - * - * @category Networking - * @package Net_URL2 - * @author Christian Schmidt <schmidt@php.net> - * @copyright 2007-2009 Peytz & Co. A/S - * @license http://www.opensource.org/licenses/bsd-license.php New BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/Net_URL2 - */ -class Net_URL2 -{ - /** - * Do strict parsing in resolve() (see RFC 3986, section 5.2.2). Default - * is true. - */ - const OPTION_STRICT = 'strict'; - - /** - * Represent arrays in query using PHP's [] notation. Default is true. - */ - const OPTION_USE_BRACKETS = 'use_brackets'; - - /** - * URL-encode query variable keys. Default is true. - */ - const OPTION_ENCODE_KEYS = 'encode_keys'; - - /** - * Query variable separators when parsing the query string. Every character - * is considered a separator. Default is "&". - */ - const OPTION_SEPARATOR_INPUT = 'input_separator'; - - /** - * Query variable separator used when generating the query string. Default - * is "&". - */ - const OPTION_SEPARATOR_OUTPUT = 'output_separator'; - - /** - * Default options corresponds to how PHP handles $_GET. - */ - private $_options = array( - self::OPTION_STRICT => true, - self::OPTION_USE_BRACKETS => true, - self::OPTION_ENCODE_KEYS => true, - self::OPTION_SEPARATOR_INPUT => '&', - self::OPTION_SEPARATOR_OUTPUT => '&', - ); - - /** - * @var string|bool - */ - private $_scheme = false; - - /** - * @var string|bool - */ - private $_userinfo = false; - - /** - * @var string|bool - */ - private $_host = false; - - /** - * @var string|bool - */ - private $_port = false; - - /** - * @var string - */ - private $_path = ''; - - /** - * @var string|bool - */ - private $_query = false; - - /** - * @var string|bool - */ - private $_fragment = false; - - /** - * Constructor. - * - * @param string $url an absolute or relative URL - * @param array $options an array of OPTION_xxx constants - * - * @return $this - * @uses self::parseUrl() - */ - public function __construct($url, array $options = array()) - { - foreach ($options as $optionName => $value) { - if (array_key_exists($optionName, $this->_options)) { - $this->_options[$optionName] = $value; - } - } - - $this->parseUrl($url); - } - - /** - * Magic Setter. - * - * This method will magically set the value of a private variable ($var) - * with the value passed as the args - * - * @param string $var The private variable to set. - * @param mixed $arg An argument of any type. - * @return void - */ - public function __set($var, $arg) - { - $method = 'set' . $var; - if (method_exists($this, $method)) { - $this->$method($arg); - } - } - - /** - * Magic Getter. - * - * This is the magic get method to retrieve the private variable - * that was set by either __set() or it's setter... - * - * @param string $var The property name to retrieve. - * @return mixed $this->$var Either a boolean false if the - * property is not set or the value - * of the private property. - */ - public function __get($var) - { - $method = 'get' . $var; - if (method_exists($this, $method)) { - return $this->$method(); - } - - return false; - } - - /** - * Returns the scheme, e.g. "http" or "urn", or false if there is no - * scheme specified, i.e. if this is a relative URL. - * - * @return string|bool - */ - public function getScheme() - {
View file
kolab-webadmin-3.2.12.tar.gz/README.md
Added
@@ -0,0 +1,36 @@ +This is the source code of Kolab Web Administration Panel + + +INTALLATION PROCEDURE +===================== + +This package uses [Composer][1] to install and maintain required PHP libraries. +See doc/INSTALL for more details. + +1. Install Composer + +Execute this in the project root directory: + +$ curl -s http://getcomposer.org/installer | php + +This will create a file named composer.phar in the project directory. + +2. Install Dependencies + +$ cp composer.json-dist composer.json +$ php composer.phar install + +4. Create database structure from doc/kolab_wap.sql. + +5. Configure/Add [kolab_wap] section of /etc/kolab/kolab.conf file. +See doc/sample-kolab.conf. + +6. Give write access for the webserver user to the 'logs' and 'cache' folders: + +$ chown <www-user> logs +$ chown <www-user> cache + +7. Configure your webserver to point to the public_html directory of this +package as document root. See doc/kolab-webadmin.conf for an example Apache config. + +[1]: http://getcomposer.org
View file
kolab-webadmin-3.2.12.tar.gz/composer.json-dist
Added
@@ -0,0 +1,21 @@ +{ + "name": "kolab/webadmin", + "description": "The Kolab Web Administration Panel", + "license": "AGPL-3.0+", + "repositories": [ + { + "type": "vcs", + "url": "https://git.kolab.org/diffusion/PNL/php-net_ldap.git" + } + ], + "require": { + "php": ">=5.4.0", + "pear/pear-core-minimal": "~1.10.1", + "pear/http_request2": "~2.3.0", + "pear/mail": "~1.4.1", + "pear/net_smtp": "~1.7.3", + "pear/net_ldap2": "~2.2.0", + "kolab/net_ldap3": "dev-master", + "smarty/smarty": "~3.1.31" + } +}
View file
kolab-webadmin-3.2.11.tar.gz/doc/sample-kolab.conf -> kolab-webadmin-3.2.12.tar.gz/doc/sample-kolab.conf
Changed
@@ -102,3 +102,19 @@ [klab.cc] default_quota = 131072 + +[kolab_wap] +sql_uri = mysql://kolab:password@localhost/kolab +api_url = +log_file = +debug_mode = warning +devel_mode = false +smarty_path = +skin = default +session_timeout = 3600 +admin_auto_fields_rw = false +autocomplete_min_length = 1 +recaptcha_public_key = +recaptcha_private_key = +send_signup_mail = false +mail_address =
View file
kolab-webadmin-3.2.11.tar.gz/lib/Auth/LDAP.php -> kolab-webadmin-3.2.12.tar.gz/lib/Auth/LDAP.php
Changed
@@ -23,8 +23,6 @@ +--------------------------------------------------------------------------+ */ -require_once "Net/LDAP3.php"; - /** * Kolab LDAP handling abstraction class. */ @@ -90,7 +88,6 @@ $this->config_set('unique_attribute', $unique_attr); $this->_ldap_uri = $this->conf->get('ldap_uri'); - $this->_ldap_server = parse_url($this->_ldap_uri, PHP_URL_HOST); $this->_ldap_port = parse_url($this->_ldap_uri, PHP_URL_PORT); $this->_ldap_scheme = parse_url($this->_ldap_uri, PHP_URL_SCHEME); @@ -104,7 +101,7 @@ } } - $this->config_set("host", $this->_ldap_server); + $this->config_set("host", $this->_ldap_uri); $this->config_set("port", $this->_ldap_port); $this->config_set("use_tls", $this->_ldap_scheme == 'tls');
View file
kolab-webadmin-3.2.11.tar.gz/lib/functions.php -> kolab-webadmin-3.2.12.tar.gz/lib/functions.php
Changed
@@ -60,6 +60,11 @@ mb_internal_encoding(KADM_CHARSET); @mb_regex_encoding(KADM_CHARSET); +// include composer autoloader (if available) +if (@file_exists(INSTALL_PATH . '/../vendor/autoload.php')) { + require INSTALL_PATH . '/../vendor/autoload.php'; +} + // register autoloader function class_autoloader($classname) {
View file
kolab-webadmin-3.2.11.tar.gz/lib/kolab_client_output.php -> kolab-webadmin-3.2.12.tar.gz/lib/kolab_client_output.php
Changed
@@ -145,7 +145,7 @@ $this->tpl->assign($name, $value); } - $script = ''; + $script = array(); if (!empty($this->env)) { $script[] = 'kadm.env = ' . json_encode($this->env) . ';'; @@ -171,7 +171,7 @@ } $this->tpl->assign('skin_path', 'skins/' . $this->skin . '/'); - if ($script) { + if (!empty($script)) { $script = "<script type=\"text/javascript\">\n" . implode("\n", $script) . "\n</script>"; $this->tpl->assign('script', $script); }
View file
kolab-webadmin-3.2.11.tar.gz/lib/kolab_client_task.php -> kolab-webadmin-3.2.12.tar.gz/lib/kolab_client_task.php
Changed
@@ -543,7 +543,7 @@ $caps = (array) $this->get_capability('actions'); foreach ($this->menu as $idx => $label) { - if (in_array($task, array('domain', 'group', 'resource', 'role', 'user'))) { + if (in_array($task, $this->object_types)) { if (!array_key_exists($task . "." . $idx, $caps)) { continue; }
View file
kolab-webadmin.dsc
Changed
@@ -2,7 +2,7 @@ Source: kolab-webadmin Binary: kolab-webadmin Architecture: all -Version: 3.2.11~dev20160627-0~kolab2 +Version: 3.2.12-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.kolab.org/ @@ -13,5 +13,5 @@ Package-List: kolab-webadmin deb admin extra Files: - 00000000000000000000000000000000 0 kolab-webadmin-3.2.11.tar.gz + 00000000000000000000000000000000 0 kolab-webadmin-3.2.12.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
.