/trunk/api/pear/Pager.php |
---|
New file |
0,0 → 1,193 |
<?php |
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
/** |
* Contains the Pager class |
* |
* PHP versions 4 and 5 |
* |
* LICENSE: Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* 1. Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* 2. 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. |
* 3. The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "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 FREEBSD PROJECT 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 HTML |
* @package Pager |
* @author Lorenzo Alberton <l dot alberton at quipo dot it> |
* @author Richard Heyes <richard@phpguru.org> |
* @copyright 2003-2006 Lorenzo Alberton, Richard Heyes |
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) |
* @version CVS: $Id: Pager.php,v 1.2 2007-11-19 15:10:59 jp_milcent Exp $ |
* @link http://pear.php.net/package/Pager |
*/ |
/** |
* Pager - Wrapper class for [Sliding|Jumping]-window Pager |
* Usage examples can be found in the PEAR manual |
* |
* @category HTML |
* @package Pager |
* @author Lorenzo Alberton <l dot alberton at quipo dot it> |
* @author Richard Heyes <richard@phpguru.org>, |
* @copyright 2003-2005 Lorenzo Alberton, Richard Heyes |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @link http://pear.php.net/package/Pager |
*/ |
class Pager |
{ |
// {{{ Pager() |
/** |
* Constructor |
* |
* ------------------------------------------------------------------------- |
* VALID options are (default values are set some lines before): |
* - mode (string): "Jumping" or "Sliding" -window - It determines |
* pager behaviour. See the manual for more details |
* - totalItems (int): # of items to page. |
* - perPage (int): # of items per page. |
* - delta (int): # of page #s to show before and after the current |
* one |
* - linkClass (string): name of CSS class used for link styling. |
* - append (bool): if true pageID is appended as GET value to the |
* URL - if false it is embedded in the URL |
* according to "fileName" specs |
* - httpMethod (string): Specifies the HTTP method to use. Valid values |
* are 'GET' or 'POST' |
* according to "fileName" specs |
* - importQuery (bool): if true (default behaviour), variables and |
* values are imported from the submitted data |
* (query string) and used in the generated links |
* otherwise they're ignored completely |
* - path (string): complete path to the page (without the page name) |
* - fileName (string): name of the page, with a %d if append=true |
* - urlVar (string): name of pageNumber URL var, for example "pageID" |
* - altPrev (string): alt text to display for prev page, on prev link. |
* - altNext (string): alt text to display for next page, on next link. |
* - altPage (string): alt text to display before the page number. |
* - prevImg (string): sth (it can be text such as "<< PREV" or an |
* <img/> as well...) to display instead of "<<". |
* - nextImg (string): same as prevImg, used for NEXT link, instead of |
* the default value, which is ">>". |
* - separator (string): what to use to separate numbers (can be an |
* <img/>, a comma, an hyphen, or whatever. |
* - spacesBeforeSeparator |
* (int): number of spaces before the separator. |
* - firstPagePre (string): |
* string used before first page number (can be an |
* <img/>, a "{", an empty string, or whatever. |
* - firstPageText (string): |
* string used in place of first page number |
* - firstPagePost (string): |
* string used after first page number (can be an |
* <img/>, a "}", an empty string, or whatever. |
* - lastPagePre (string): |
* similar to firstPagePre. |
* - lastPageText (string): |
* similar to firstPageText. |
* - lastPagePost (string): |
* similar to firstPagePost. |
* - spacesAfterSeparator |
* (int): number of spaces after the separator. |
* - firstLinkTitle (string): |
* string used as title in <link rel="first"> tag |
* - lastLinkTitle (string): |
* string used as title in <link rel="last"> tag |
* - prevLinkTitle (string): |
* string used as title in <link rel="prev"> tag |
* - nextLinkTitle (string): |
* string used as title in <link rel="next"> tag |
* - curPageLinkClassName |
* (string): name of CSS class used for current page link. |
* - clearIfVoid(bool): if there's only one page, don't display pager. |
* - extraVars (array): additional URL vars to be added to the querystring |
* - excludeVars (array): URL vars to be excluded in the querystring |
* - itemData (array): array of items to page. |
* - useSessions (bool): if true, number of items to display per page is |
* stored in the $_SESSION[$_sessionVar] var. |
* - closeSession (bool): if true, the session is closed just after R/W. |
* - sessionVar (string): name of the session var for perPage value. |
* A value != from default can be useful when |
* using more than one Pager istance in the page. |
* - pearErrorMode (constant): |
* PEAR_ERROR mode for raiseError(). |
* Default is PEAR_ERROR_RETURN. |
* ------------------------------------------------------------------------- |
* REQUIRED options are: |
* - fileName IF append==false (default is true) |
* - itemData OR totalItems (if itemData is set, totalItems is overwritten) |
* ------------------------------------------------------------------------- |
* |
* @param mixed $options An associative array of option names and |
* their values. |
* @access public |
*/ |
function Pager($options = array()) |
{ |
//this check evaluates to true on 5.0.0RC-dev, |
//so i'm using another one, for now... |
//if (version_compare(phpversion(), '5.0.0') == -1) { |
if (get_class($this) == 'pager') { //php4 lowers class names |
// assign factoried method to this for PHP 4 |
eval('$this = Pager::factory($options);'); |
} else { //php5 is case sensitive |
$msg = 'Pager constructor is deprecated.' |
.' You must use the "Pager::factory($params)" method' |
.' instead of "new Pager($params)"'; |
trigger_error($msg, E_USER_ERROR); |
} |
} |
// }}} |
// {{{ factory() |
/** |
* Return a pager based on $mode and $options |
* |
* @param array $options Optional parameters for the storage class |
* @return object Object Storage object |
* @static |
* @access public |
*/ |
static function &factory($options = array()) |
{ |
$mode = (isset($options['mode']) ? ucfirst($options['mode']) : 'Jumping'); |
$classname = 'Pager_' . $mode; |
$classfile = 'Pager' . DIRECTORY_SEPARATOR . $mode . '.php'; |
// Attempt to include a custom version of the named class, but don't treat |
// a failure as fatal. The caller may have already included their own |
// version of the named class. |
if (!class_exists($classname)) { |
include_once $classfile; |
} |
// If the class exists, return a new instance of it. |
if (class_exists($classname)) { |
$pager =& new $classname($options); |
return $pager; |
} |
$null = null; |
return $null; |
} |
// }}} |
} |
?> |
/trunk/api/pear/Auth.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: Auth.php,v 1.2 2006-12-14 15:04:29 jp_milcent Exp $ |
* @version CVS: $Id: Auth.php,v 1.3 2007-11-19 15:10:59 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
*/ |
48,6 → 48,16 |
define('AUTH_CALLBACK_ABORT', -6); |
/** |
* Auth Log level - INFO |
*/ |
define('AUTH_LOG_INFO', 6); |
/** |
* Auth Log level - DEBUG |
*/ |
define('AUTH_LOG_DEBUG', 7); |
/** |
* PEAR::Auth |
* |
* The PEAR::Auth class provides methods for creating an |
59,7 → 69,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
*/ |
class Auth { |
258,10 → 268,31 |
/** |
* How many times has checkAuth been called |
* var int |
* @var int |
*/ |
var $authChecks = 0; |
/** |
* PEAR::Log object |
* |
* @var object Log |
*/ |
var $logger = null; |
/** |
* Whether to enable logging of behaviour |
* |
* @var boolean |
*/ |
var $enableLogging = false; |
/** |
* Whether to regenerate session id everytime start is called |
* |
* @var boolean |
*/ |
var $regenerateSessionId = false; |
// }}} |
// {{{ Auth() [constructor] |
363,7 → 394,14 |
$this->advancedsecurity = $options['advancedsecurity']; |
unset($options['advancedsecurity']); |
} |
if (isset($options['enableLogging'])) { |
$this->enableLogging = $options['enableLogging']; |
unset($options['enableLogging']); |
} |
if (isset($options['regenerateSessionId']) && is_bool($options['regenerateSessionId'])) { |
$this->regenerateSessionId = $options['regenerateSessionId']; |
} |
} |
return($options); |
} |
386,6 → 424,7 |
$this->storage =& $this->_factory($this->storage_driver, |
$this->storage_options); |
$this->storage->_auth_obj =& $this; |
$this->log('Loaded storage container ('.$this->storage_driver.')', AUTH_LOG_DEBUG); |
return(true); |
} |
return(false); |
429,6 → 468,8 |
*/ |
function assignData() |
{ |
$this->log('Auth::assignData() called.', AUTH_LOG_DEBUG); |
if ( isset($this->post[$this->_postUsername]) |
&& $this->post[$this->_postUsername] != '') { |
$this->username = (get_magic_quotes_gpc() == 1 |
454,6 → 495,14 |
*/ |
function start() |
{ |
$this->log('Auth::start() called.', AUTH_LOG_DEBUG); |
// #10729 - Regenerate session id here if we are generating it on every |
// page load. |
if ($this->regenerateSessionId) { |
session_regenerate_id(true); |
} |
$this->assignData(); |
if (!$this->checkAuth() && $this->allowLogin) { |
$this->login(); |
471,6 → 520,8 |
*/ |
function login() |
{ |
$this->log('Auth::login() called.', AUTH_LOG_DEBUG); |
$login_ok = false; |
$this->_loadStorage(); |
485,6 → 536,7 |
if (true === $this->storage->fetchData($this->username, $this->password, $usingChap)) { |
$this->session['challengekey'] = md5($this->username.$this->password); |
$login_ok = true; |
$this->log('Successful login.', AUTH_LOG_INFO); |
} |
} |
491,6 → 543,7 |
if (!empty($this->username) && $login_ok) { |
$this->setAuth($this->username); |
if (is_callable($this->loginCallback)) { |
$this->log('Calling loginCallback ('.$this->loginCallback.').', AUTH_LOG_DEBUG); |
call_user_func_array($this->loginCallback, array($this->username, &$this)); |
} |
} |
498,22 → 551,29 |
// If the login failed or the user entered no username, |
// output the login screen again. |
if (!empty($this->username) && !$login_ok) { |
$this->log('Incorrect login.', AUTH_LOG_INFO); |
$this->status = AUTH_WRONG_LOGIN; |
if (is_callable($this->loginFailedCallback)) { |
$this->log('Calling loginFailedCallback ('.$this->loginFailedCallback.').', AUTH_LOG_DEBUG); |
call_user_func_array($this->loginFailedCallback, array($this->username, &$this)); |
} |
} |
if ((empty($this->username) || !$login_ok) && $this->showLogin) { |
$this->log('Rendering Login Form.', AUTH_LOG_INFO); |
if (is_callable($this->loginFunction)) { |
$this->log('Calling loginFunction ('.$this->loginFunction.').', AUTH_LOG_DEBUG); |
call_user_func_array($this->loginFunction, array($this->username, $this->status, &$this)); |
} else { |
// BC fix Auth used to use drawLogin for this |
// call is sub classes implement this |
if (is_callable(array($this, 'drawLogin'))) { |
$this->log('Calling Auth::drawLogin()', AUTH_LOG_DEBUG); |
return $this->drawLogin($this->username, $this); |
} |
$this->log('Using default Auth_Frontend_Html', AUTH_LOG_DEBUG); |
// New Login form |
include_once 'Auth/Frontend/Html.php'; |
return Auth_Frontend_Html::render($this, $this->username); |
574,6 → 634,10 |
function setSessionName($name = 'session') |
{ |
$this->_sessionName = '_auth_'.$name; |
// Make Sure Auth session variable is there |
if(!isset($_SESSION[$this->_sessionName])) { |
$_SESSION[$this->_sessionName] = array(); |
} |
$this->session =& $_SESSION[$this->_sessionName]; |
} |
736,9 → 800,15 |
*/ |
function setAuth($username) |
{ |
$this->log('Auth::setAuth() called.', AUTH_LOG_DEBUG); |
// #10729 - Regenerate session id here only if generating at login only |
// Don't do it if we are regenerating on every request so we don't |
// regenerate it twice in one request. |
if (!$this->regenerateSessionId) { |
// #2021 - Change the session id to avoid session fixation attacks php 4.3.3 > |
session_regenerate_id(true); |
} |
if (!isset($this->session) || !is_array($this->session)) { |
$this->session = array(); |
754,6 → 824,9 |
$this->session['sessionuseragent'] = isset($this->server['HTTP_USER_AGENT']) |
? $this->server['HTTP_USER_AGENT'] |
: ''; |
$this->session['sessionforwardedfor'] = isset($this->server['HTTP_X_FORWARDED_FOR']) |
? $this->server['HTTP_X_FORWARDED_FOR'] |
: ''; |
// This should be set by the container to something more safe |
// Like md5(passwd.microtime) |
801,6 → 874,7 |
*/ |
function checkAuth() |
{ |
$this->log('Auth::checkAuth() called.', AUTH_LOG_DEBUG); |
$this->authChecks++; |
if (isset($this->session)) { |
// Check if authentication session is expired |
807,6 → 881,7 |
if ( $this->expire > 0 |
&& isset($this->session['timestamp']) |
&& ($this->session['timestamp'] + $this->expire) < time()) { |
$this->log('Session Expired', AUTH_LOG_INFO); |
$this->expired = true; |
$this->status = AUTH_EXPIRED; |
$this->logout(); |
817,6 → 892,7 |
if ( $this->idle > 0 |
&& isset($this->session['idle']) |
&& ($this->session['idle'] + $this->idle) < time()) { |
$this->log('Session Idle Time Reached', AUTH_LOG_INFO); |
$this->idled = true; |
$this->status = AUTH_IDLED; |
$this->logout(); |
830,9 → 906,11 |
Auth::updateIdle(); |
if ($this->advancedsecurity) { |
$this->log('Advanced Security Mode Enabled.', AUTH_LOG_DEBUG); |
// Only Generate the challenge once |
if($this->authChecks == 1) { |
$this->log('Generating new Challenge Cookie.', AUTH_LOG_DEBUG); |
$this->session['challengecookieold'] = $this->session['challengecookie']; |
$this->session['challengecookie'] = md5($this->session['challengekey'].microtime()); |
setcookie('authchallenge', $this->session['challengecookie']); |
841,6 → 919,7 |
// Check for ip change |
if ( isset($this->server['REMOTE_ADDR']) |
&& $this->session['sessionip'] != $this->server['REMOTE_ADDR']) { |
$this->log('Security Breach. Remote IP Address changed.', AUTH_LOG_INFO); |
// Check if the IP of the user has changed, if so we |
// assume a man in the middle attack and log him out |
$this->expired = true; |
849,9 → 928,23 |
return false; |
} |
// Check for ip change (if connected via proxy) |
if ( isset($this->server['HTTP_X_FORWARDED_FOR']) |
&& $this->session['sessionforwardedfor'] != $this->server['HTTP_X_FORWARDED_FOR']) { |
$this->log('Security Breach. Forwarded For IP Address changed.', AUTH_LOG_INFO); |
// Check if the IP of the user connecting via proxy has |
// changed, if so we assume a man in the middle attack |
// and log him out. |
$this->expired = true; |
$this->status = AUTH_SECURITY_BREACH; |
$this->logout(); |
return false; |
} |
// Check for useragent change |
if ( isset($this->server['HTTP_USER_AGENT']) |
&& $this->session['sessionuseragent'] != $this->server['HTTP_USER_AGENT']) { |
$this->log('Security Breach. User Agent changed.', AUTH_LOG_INFO); |
// Check if the User-Agent of the user has changed, if |
// so we assume a man in the middle attack and log him out |
$this->expired = true; |
866,6 → 959,7 |
// in tab) auth breach is caused find out a way around that if possible |
if ( isset($this->session['challengecookieold']) |
&& $this->session['challengecookieold'] != $this->cookie['authchallenge']) { |
$this->log('Security Breach. Challenge Cookie mismatch.', AUTH_LOG_INFO); |
$this->expired = true; |
$this->status = AUTH_SECURITY_BREACH; |
$this->logout(); |
875,8 → 969,10 |
} |
if (is_callable($this->checkAuthCallback)) { |
$this->log('Calling checkAuthCallback ('.$this->checkAuthCallback.').', AUTH_LOG_DEBUG); |
$checkCallback = call_user_func_array($this->checkAuthCallback, array($this->username, &$this)); |
if ($checkCallback == false) { |
$this->log('checkAuthCallback failed.', AUTH_LOG_INFO); |
$this->expired = true; |
$this->status = AUTH_CALLBACK_ABORT; |
$this->logout(); |
884,9 → 980,11 |
} |
} |
$this->log('Session OK.', AUTH_LOG_INFO); |
return true; |
} |
} |
$this->log('Unable to locate session storage.', AUTH_LOG_DEBUG); |
return false; |
} |
907,6 → 1005,7 |
if(!isset($staticAuth)) { |
$staticAuth = new Auth('null', $options); |
} |
$staticAuth->log('Auth::staticCheckAuth() called', AUTH_LOG_DEBUG); |
return $staticAuth->checkAuth(); |
} |
921,6 → 1020,7 |
*/ |
function getAuth() |
{ |
$this->log('Auth::getAuth() called.', AUTH_LOG_DEBUG); |
return $this->checkAuth(); |
} |
939,7 → 1039,10 |
*/ |
function logout() |
{ |
if (is_callable($this->logoutCallback)) { |
$this->log('Auth::logout() called.', AUTH_LOG_DEBUG); |
if (is_callable($this->logoutCallback) && isset($this->session['username'])) { |
$this->log('Calling logoutCallback ('.$this->logoutCallback.').', AUTH_LOG_DEBUG); |
call_user_func_array($this->logoutCallback, array($this->session['username'], &$this)); |
} |
1054,6 → 1157,7 |
*/ |
function listUsers() |
{ |
$this->log('Auth::listUsers() called.', AUTH_LOG_DEBUG); |
$this->_loadStorage(); |
return $this->storage->listUsers(); |
} |
1073,6 → 1177,7 |
*/ |
function addUser($username, $password, $additional = '') |
{ |
$this->log('Auth::addUser() called.', AUTH_LOG_DEBUG); |
$this->_loadStorage(); |
return $this->storage->addUser($username, $password, $additional); |
} |
1090,6 → 1195,7 |
*/ |
function removeUser($username) |
{ |
$this->log('Auth::removeUser() called.', AUTH_LOG_DEBUG); |
$this->_loadStorage(); |
return $this->storage->removeUser($username); |
} |
1108,11 → 1214,78 |
*/ |
function changePassword($username, $password) |
{ |
$this->log('Auth::changePassword() called', AUTH_LOG_DEBUG); |
$this->_loadStorage(); |
return $this->storage->changePassword($username, $password); |
} |
// }}} |
// {{{ log() |
/** |
* Log a message from the Auth system |
* |
* @access public |
* @param string The message to log |
* @param string The log level to log the message under. See the Log documentation for more info. |
* @return boolean |
*/ |
function log($message, $level = AUTH_LOG_DEBUG) |
{ |
if (!$this->enableLogging) return false; |
$this->_loadLogger(); |
$this->logger->log('AUTH: '.$message, $level); |
} |
// }}} |
// {{{ _loadLogger() |
/** |
* Load Log object if not already loaded |
* |
* Suspend logger instantiation to make Auth lighter to use |
* for calls which do not require logging |
* |
* @return bool True if the logger is loaded, false if the logger |
* is already loaded |
* @access private |
*/ |
function _loadLogger() |
{ |
if(is_null($this->logger)) { |
if (!class_exists('Log')) { |
include_once 'Log.php'; |
} |
$this->logger =& Log::singleton('null', |
null, |
'auth['.getmypid().']', |
array(), |
AUTH_LOG_DEBUG); |
return(true); |
} |
return(false); |
} |
// }}} |
// {{{ attachLogObserver() |
/** |
* Attach an Observer to the Auth Log Source |
* |
* @param object Log_Observer A Log Observer instance |
* @return boolean |
*/ |
function attachLogObserver(&$observer) { |
$this->_loadLogger(); |
return $this->logger->attach($observer); |
} |
// }}} |
} |
?> |
/trunk/api/pear/Pager/examples/Pager_Wrapper.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/examples/example.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_wrapper_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_sliding_notExpanded_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_wrapper_include.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_include.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_post_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_sliding_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/README |
---|
File deleted |
/trunk/api/pear/Pager/tests/pager_jumping_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_jumping_noData_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/multibyte_post.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_noData_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_post_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_jumping_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_sliding_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_test_xss.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/all_tests.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/pager_sliding_noData_test.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/tests/simple_include.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Pager/Pager_savebc.php |
---|
New file |
0,0 → 1,3 |
<?php |
require_once 'Pager.php'; |
?> |
/trunk/api/pear/Pager/Common.php |
---|
42,8 → 42,9 |
* when the user doesn't set any other value |
*/ |
if (substr($_SERVER['PHP_SELF'], -1) == '/') { |
$http = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://'; |
define('CURRENT_FILENAME', ''); |
define('CURRENT_PATHNAME', 'http://'.$_SERVER['HTTP_HOST'].str_replace('\\', '/', $_SERVER['PHP_SELF'])); |
define('CURRENT_PATHNAME', $http.$_SERVER['HTTP_HOST'].str_replace('\\', '/', $_SERVER['PHP_SELF'])); |
} else { |
define('CURRENT_FILENAME', preg_replace('/(.*)\?.*/', '\\1', basename($_SERVER['PHP_SELF']))); |
define('CURRENT_PATHNAME', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))); |
201,6 → 202,12 |
var $_attributes = ''; |
/** |
* @var string onclick |
* @access private |
*/ |
var $_onclick = ''; |
/** |
* @var string alt text for "first page" (use "%d" placeholder for page number) |
* @access private |
*/ |
445,6 → 452,7 |
'expanded', |
'accesskey', |
'attributes', |
'onclick', |
'separator', |
'spacesBeforeSeparator', |
'spacesAfterSeparator', |
483,11 → 491,31 |
*/ |
function build() |
{ |
$msg = '<b>PEAR::Pager Error:</b>' |
.' function "build()" not implemented.'; |
return $this->raiseError($msg, ERROR_PAGER_NOT_IMPLEMENTED); |
//reset |
$this->_pageData = array(); |
$this->links = ''; |
$this->_generatePageData(); |
$this->_setFirstLastText(); |
if ($this->_totalPages > (2 * $this->_delta + 1)) { |
$this->links .= $this->_printFirstPage(); |
} |
$this->links .= $this->_getBackLink(); |
$this->links .= $this->_getPageLinks(); |
$this->links .= $this->_getNextLink(); |
$this->linkTags .= $this->_getFirstLinkTag(); |
$this->linkTags .= $this->_getPrevLinkTag(); |
$this->linkTags .= $this->_getNextLinkTag(); |
$this->linkTags .= $this->_getLastLinkTag(); |
if ($this->_totalPages > (2 * $this->_delta + 1)) { |
$this->links .= $this->_printLastPage(); |
} |
} |
// }}} |
// {{{ getPageData() |
752,11 → 780,16 |
} else { |
$href = str_replace('%d', $this->_linkData[$this->_urlVar], $this->_fileName); |
} |
return sprintf('<a href="%s"%s%s%s title="%s">%s</a>', |
$onclick = ''; |
if (array_key_exists($this->_urlVar, $this->_linkData)) { |
$onclick = str_replace('%d', $this->_linkData[$this->_urlVar], $this->_onclick); |
} |
return sprintf('<a href="%s"%s%s%s%s title="%s">%s</a>', |
htmlentities($this->_url . $href), |
empty($this->_classString) ? '' : ' '.$this->_classString, |
empty($this->_attributes) ? '' : ' '.$this->_attributes, |
empty($this->_accesskey) ? '' : ' accesskey="'.$this->_linkData[$this->_urlVar].'"', |
empty($onclick) ? '' : ' onclick="'.$onclick.'"', |
$altText, |
$linkText |
); |
894,15 → 927,15 |
$qs = $_GET; |
} |
} |
if (count($this->_extraVars)){ |
$this->_recursive_urldecode($this->_extraVars); |
} |
$qs = array_merge($qs, $this->_extraVars); |
foreach ($this->_excludeVars as $exclude) { |
if (array_key_exists($exclude, $qs)) { |
unset($qs[$exclude]); |
} |
} |
if (count($this->_extraVars)){ |
$this->_recursive_urldecode($this->_extraVars); |
$qs = array_merge($qs, $this->_extraVars); |
} |
if (count($qs) && get_magic_quotes_gpc()){ |
$this->_recursive_stripslashes($qs); |
} |
1293,6 → 1326,10 |
function __http_build_query($array, $name) |
{ |
$tmp = array (); |
$separator = ini_get('arg_separator.output'); |
if ($separator == '&') { |
$separator = '&'; //the string is escaped by htmlentities anyway... |
} |
foreach ($array as $key => $value) { |
if (is_array($value)) { |
//array_push($tmp, $this->__http_build_query($value, sprintf('%s[%s]', $name, $key))); |
1305,7 → 1342,7 |
array_push($tmp, $this->__http_build_query(get_object_vars($value), $name.'%5B'.$key.'%5D')); |
} |
} |
return implode(ini_get('arg_separator.output'), $tmp); |
return implode($separator, $tmp); |
} |
// }}} |
1386,7 → 1423,7 |
if (strncasecmp($this->_fileName, 'javascript', 10) != 0) { |
$this->_url .= '/'; |
} |
if (!strstr($this->_fileName, '%d')) { |
if (strpos($this->_fileName, '%d') === false) { |
trigger_error($this->errorMessage(ERROR_PAGER_INVALID_USAGE), E_USER_WARNING); |
} |
} |
/trunk/api/pear/Pager/Jumping.php |
---|
75,33 → 75,6 |
} |
// }}} |
// {{{ build() |
/** |
* Generate or refresh the links and paged data after a call to setOptions() |
* |
* @access public |
*/ |
function build() |
{ |
//reset |
$this->_pageData = array(); |
$this->links = ''; |
$this->_generatePageData(); |
$this->_setFirstLastText(); |
$this->links .= $this->_getBackLink(); |
$this->links .= $this->_getPageLinks(); |
$this->links .= $this->_getNextLink(); |
$this->linkTags .= $this->_getFirstLinkTag(); |
$this->linkTags .= $this->_getPrevLinkTag(); |
$this->linkTags .= $this->_getNextLinkTag(); |
$this->linkTags .= $this->_getLastLinkTag(); |
} |
// }}} |
// {{{ getPageIdByOffset() |
/** |
188,13 → 161,14 |
} |
if (!is_null($pageID)) { |
$_sav = $this->_currentPage; |
$this->_currentPage = $pageID; |
$this->links = ''; |
if ($this->_totalPages > $this->_delta) { |
$this->links .= $this->_printFirstPage(); |
} |
$_sav = $this->_currentPage; |
$this->_currentPage = $pageID; |
$this->links .= $this->_getBackLink('', $back_html); |
$this->links .= $this->_getPageLinks(); |
$this->links .= $this->_getNextLink('', $next_html); |
/trunk/api/pear/Pager/Sliding.php |
---|
84,41 → 84,6 |
} |
// }}} |
// {{{ build() |
/** |
* Generate or refresh the links and paged data after a call to setOptions() |
* |
* @access public |
*/ |
function build() |
{ |
//reset |
$this->_pageData = array(); |
$this->links = ''; |
$this->_generatePageData(); |
$this->_setFirstLastText(); |
if ($this->_totalPages > (2 * $this->_delta + 1)) { |
$this->links .= $this->_printFirstPage(); |
} |
$this->links .= $this->_getBackLink(); |
$this->links .= $this->_getPageLinks(); |
$this->links .= $this->_getNextLink(); |
$this->linkTags .= $this->_getFirstLinkTag(); |
$this->linkTags .= $this->_getPrevLinkTag(); |
$this->linkTags .= $this->_getNextLinkTag(); |
$this->linkTags .= $this->_getLastLinkTag(); |
if ($this->_totalPages > (2 * $this->_delta + 1)) { |
$this->links .= $this->_printLastPage(); |
} |
} |
// }}} |
// {{{ getPageIdByOffset() |
/** |
/trunk/api/pear/Pager/HtmlWidgets.php |
---|
71,6 → 71,8 |
* - 'attributes': (html attributes) Tag attributes or |
* HTML attributes (id="foo" pairs), will be inserted in the |
* <select> tag |
* - 'checkMaxLimit': if true, Pager checks if $end is bigger |
* than $totalItems, and doesn't show the extra select options |
* @return string xhtml select box |
* @access public |
*/ |
79,6 → 81,7 |
// FIXME: needs POST support |
$optionText = '%d'; |
$attributes = ''; |
$checkMaxLimit = false; |
if (is_string($extraParams)) { |
//old behavior, BC maintained |
$optionText = $extraParams; |
89,7 → 92,10 |
if (array_key_exists('attributes', $extraParams)) { |
$attributes = $extraParams['attributes']; |
} |
if (array_key_exists('checkMaxLimit', $extraParams)) { |
$checkMaxLimit = $extraParams['checkMaxLimit']; |
} |
} |
if (!strstr($optionText, '%d')) { |
return $this->pager->raiseError( |
106,12 → 112,18 |
$selected = $this->pager->_perPage; |
} |
if ($checkMaxLimit && $this->pager->_totalItems > 0 && $this->pager->_totalItems < $end) { |
$end = $this->pager->_totalItems; |
} |
$tmp = '<select name="'.$this->pager->_sessionVar.'"'; |
if (!empty($attributes)) { |
$tmp .= ' '.$attributes; |
} |
$tmp .= '>'; |
$last = $start; |
for ($i=$start; $i<=$end; $i+=$step) { |
$last = $i; |
$tmp .= '<option value="'.$i.'"'; |
if ($i == $selected) { |
$tmp .= ' selected="selected"'; |
118,7 → 130,7 |
} |
$tmp .= '>'.sprintf($optionText, $i).'</option>'; |
} |
if ($showAllData && $end < $this->pager->_totalItems) { |
if ($showAllData && $last != $this->pager->_totalItems) { |
$tmp .= '<option value="'.$this->pager->_totalItems.'"'; |
if ($this->pager->_totalItems == $selected) { |
$tmp .= ' selected="selected"'; |
/trunk/api/pear/Pager/Pager.php |
---|
165,7 → 165,7 |
* @static |
* @access public |
*/ |
function &factory($options = array()) |
static function &factory($options = array()) |
{ |
$mode = (isset($options['mode']) ? ucfirst($options['mode']) : 'Jumping'); |
$classname = 'Pager_' . $mode; |
/trunk/api/pear/XML/Parser.php |
---|
New file |
0,0 → 1,690 |
<?php |
// |
// +----------------------------------------------------------------------+ |
// | PHP Version 4 | |
// +----------------------------------------------------------------------+ |
// | Copyright (c) 1997-2004 The PHP Group | |
// +----------------------------------------------------------------------+ |
// | This source file is subject to version 3.0 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/3_0.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: Stig Bakken <ssb@fast.no> | |
// | Tomas V.V.Cox <cox@idecnet.com> | |
// | Stephan Schmidt <schst@php-tools.net> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Parser.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
/** |
* XML Parser class. |
* |
* This is an XML parser based on PHP's "xml" extension, |
* based on the bundled expat library. |
* |
* @category XML |
* @package XML_Parser |
* @author Stig Bakken <ssb@fast.no> |
* @author Tomas V.V.Cox <cox@idecnet.com> |
* @author Stephan Schmidt <schst@php-tools.net> |
*/ |
/** |
* uses PEAR's error handling |
*/ |
require_once 'PEAR.php'; |
/** |
* resource could not be created |
*/ |
define('XML_PARSER_ERROR_NO_RESOURCE', 200); |
/** |
* unsupported mode |
*/ |
define('XML_PARSER_ERROR_UNSUPPORTED_MODE', 201); |
/** |
* invalid encoding was given |
*/ |
define('XML_PARSER_ERROR_INVALID_ENCODING', 202); |
/** |
* specified file could not be read |
*/ |
define('XML_PARSER_ERROR_FILE_NOT_READABLE', 203); |
/** |
* invalid input |
*/ |
define('XML_PARSER_ERROR_INVALID_INPUT', 204); |
/** |
* remote file cannot be retrieved in safe mode |
*/ |
define('XML_PARSER_ERROR_REMOTE', 205); |
/** |
* XML Parser class. |
* |
* This is an XML parser based on PHP's "xml" extension, |
* based on the bundled expat library. |
* |
* Notes: |
* - It requires PHP 4.0.4pl1 or greater |
* - From revision 1.17, the function names used by the 'func' mode |
* are in the format "xmltag_$elem", for example: use "xmltag_name" |
* to handle the <name></name> tags of your xml file. |
* |
* @category XML |
* @package XML_Parser |
* @author Stig Bakken <ssb@fast.no> |
* @author Tomas V.V.Cox <cox@idecnet.com> |
* @author Stephan Schmidt <schst@php-tools.net> |
* @todo create XML_Parser_Namespace to parse documents with namespaces |
* @todo create XML_Parser_Pull |
* @todo Tests that need to be made: |
* - mixing character encodings |
* - a test using all expat handlers |
* - options (folding, output charset) |
* - different parsing modes |
*/ |
class XML_Parser extends PEAR |
{ |
// {{{ properties |
/** |
* XML parser handle |
* |
* @var resource |
* @see xml_parser_create() |
*/ |
var $parser; |
/** |
* File handle if parsing from a file |
* |
* @var resource |
*/ |
var $fp; |
/** |
* Whether to do case folding |
* |
* If set to true, all tag and attribute names will |
* be converted to UPPER CASE. |
* |
* @var boolean |
*/ |
var $folding = true; |
/** |
* Mode of operation, one of "event" or "func" |
* |
* @var string |
*/ |
var $mode; |
/** |
* Mapping from expat handler function to class method. |
* |
* @var array |
*/ |
var $handler = array( |
'character_data_handler' => 'cdataHandler', |
'default_handler' => 'defaultHandler', |
'processing_instruction_handler' => 'piHandler', |
'unparsed_entity_decl_handler' => 'unparsedHandler', |
'notation_decl_handler' => 'notationHandler', |
'external_entity_ref_handler' => 'entityrefHandler' |
); |
/** |
* source encoding |
* |
* @var string |
*/ |
var $srcenc; |
/** |
* target encoding |
* |
* @var string |
*/ |
var $tgtenc; |
/** |
* handler object |
* |
* @var object |
*/ |
var $_handlerObj; |
/** |
* valid encodings |
* |
* @var array |
*/ |
var $_validEncodings = array('ISO-8859-1', 'UTF-8', 'US-ASCII'); |
// }}} |
// {{{ constructor |
/** |
* Creates an XML parser. |
* |
* This is needed for PHP4 compatibility, it will |
* call the constructor, when a new instance is created. |
* |
* @param string $srcenc source charset encoding, use NULL (default) to use |
* whatever the document specifies |
* @param string $mode how this parser object should work, "event" for |
* startelement/endelement-type events, "func" |
* to have it call functions named after elements |
* @param string $tgenc a valid target encoding |
*/ |
function XML_Parser($srcenc = null, $mode = 'event', $tgtenc = null) |
{ |
XML_Parser::__construct($srcenc, $mode, $tgtenc); |
} |
// }}} |
/** |
* PHP5 constructor |
* |
* @param string $srcenc source charset encoding, use NULL (default) to use |
* whatever the document specifies |
* @param string $mode how this parser object should work, "event" for |
* startelement/endelement-type events, "func" |
* to have it call functions named after elements |
* @param string $tgenc a valid target encoding |
*/ |
function __construct($srcenc = null, $mode = 'event', $tgtenc = null) |
{ |
$this->PEAR('XML_Parser_Error'); |
$this->mode = $mode; |
$this->srcenc = $srcenc; |
$this->tgtenc = $tgtenc; |
} |
// }}} |
/** |
* Sets the mode of the parser. |
* |
* Possible modes are: |
* - func |
* - event |
* |
* You can set the mode using the second parameter |
* in the constructor. |
* |
* This method is only needed, when switching to a new |
* mode at a later point. |
* |
* @access public |
* @param string mode, either 'func' or 'event' |
* @return boolean|object true on success, PEAR_Error otherwise |
*/ |
function setMode($mode) |
{ |
if ($mode != 'func' && $mode != 'event') { |
$this->raiseError('Unsupported mode given', XML_PARSER_ERROR_UNSUPPORTED_MODE); |
} |
$this->mode = $mode; |
return true; |
} |
/** |
* Sets the object, that will handle the XML events |
* |
* This allows you to create a handler object independent of the |
* parser object that you are using and easily switch the underlying |
* parser. |
* |
* If no object will be set, XML_Parser assumes that you |
* extend this class and handle the events in $this. |
* |
* @access public |
* @param object object to handle the events |
* @return boolean will always return true |
* @since v1.2.0beta3 |
*/ |
function setHandlerObj(&$obj) |
{ |
$this->_handlerObj = &$obj; |
return true; |
} |
/** |
* Init the element handlers |
* |
* @access private |
*/ |
function _initHandlers() |
{ |
if (!is_resource($this->parser)) { |
return false; |
} |
if (!is_object($this->_handlerObj)) { |
$this->_handlerObj = &$this; |
} |
switch ($this->mode) { |
case 'func': |
xml_set_object($this->parser, $this->_handlerObj); |
xml_set_element_handler($this->parser, array(&$this, 'funcStartHandler'), array(&$this, 'funcEndHandler')); |
break; |
case 'event': |
xml_set_object($this->parser, $this->_handlerObj); |
xml_set_element_handler($this->parser, 'startHandler', 'endHandler'); |
break; |
default: |
return $this->raiseError('Unsupported mode given', XML_PARSER_ERROR_UNSUPPORTED_MODE); |
break; |
} |
/** |
* set additional handlers for character data, entities, etc. |
*/ |
foreach ($this->handler as $xml_func => $method) { |
if (method_exists($this->_handlerObj, $method)) { |
$xml_func = 'xml_set_' . $xml_func; |
$xml_func($this->parser, $method); |
} |
} |
} |
// {{{ _create() |
/** |
* create the XML parser resource |
* |
* Has been moved from the constructor to avoid |
* problems with object references. |
* |
* Furthermore it allows us returning an error |
* if something fails. |
* |
* @access private |
* @return boolean|object true on success, PEAR_Error otherwise |
* |
* @see xml_parser_create |
*/ |
function _create() |
{ |
if ($this->srcenc === null) { |
$xp = @xml_parser_create(); |
} else { |
$xp = @xml_parser_create($this->srcenc); |
} |
if (is_resource($xp)) { |
if ($this->tgtenc !== null) { |
if (!@xml_parser_set_option($xp, XML_OPTION_TARGET_ENCODING, |
$this->tgtenc)) { |
return $this->raiseError('invalid target encoding', XML_PARSER_ERROR_INVALID_ENCODING); |
} |
} |
$this->parser = $xp; |
$result = $this->_initHandlers($this->mode); |
if ($this->isError($result)) { |
return $result; |
} |
xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, $this->folding); |
return true; |
} |
if (!in_array(strtoupper($this->srcenc), $this->_validEncodings)) { |
return $this->raiseError('invalid source encoding', XML_PARSER_ERROR_INVALID_ENCODING); |
} |
return $this->raiseError('Unable to create XML parser resource.', XML_PARSER_ERROR_NO_RESOURCE); |
} |
// }}} |
// {{{ reset() |
/** |
* Reset the parser. |
* |
* This allows you to use one parser instance |
* to parse multiple XML documents. |
* |
* @access public |
* @return boolean|object true on success, PEAR_Error otherwise |
*/ |
function reset() |
{ |
$result = $this->_create(); |
if ($this->isError( $result )) { |
return $result; |
} |
return true; |
} |
// }}} |
// {{{ setInputFile() |
/** |
* Sets the input xml file to be parsed |
* |
* @param string Filename (full path) |
* @return resource fopen handle of the given file |
* @throws XML_Parser_Error |
* @see setInput(), setInputString(), parse() |
* @access public |
*/ |
function setInputFile($file) |
{ |
/** |
* check, if file is a remote file |
*/ |
if (eregi('^(http|ftp)://', substr($file, 0, 10))) { |
if (!ini_get('allow_url_fopen')) { |
return $this->raiseError('Remote files cannot be parsed, as safe mode is enabled.', XML_PARSER_ERROR_REMOTE); |
} |
} |
$fp = @fopen($file, 'rb'); |
if (is_resource($fp)) { |
$this->fp = $fp; |
return $fp; |
} |
return $this->raiseError('File could not be opened.', XML_PARSER_ERROR_FILE_NOT_READABLE); |
} |
// }}} |
// {{{ setInputString() |
/** |
* XML_Parser::setInputString() |
* |
* Sets the xml input from a string |
* |
* @param string $data a string containing the XML document |
* @return null |
**/ |
function setInputString($data) |
{ |
$this->fp = $data; |
return null; |
} |
// }}} |
// {{{ setInput() |
/** |
* Sets the file handle to use with parse(). |
* |
* You should use setInputFile() or setInputString() if you |
* pass a string |
* |
* @param mixed $fp Can be either a resource returned from fopen(), |
* a URL, a local filename or a string. |
* @access public |
* @see parse() |
* @uses setInputString(), setInputFile() |
*/ |
function setInput($fp) |
{ |
if (is_resource($fp)) { |
$this->fp = $fp; |
return true; |
} |
// see if it's an absolute URL (has a scheme at the beginning) |
elseif (eregi('^[a-z]+://', substr($fp, 0, 10))) { |
return $this->setInputFile($fp); |
} |
// see if it's a local file |
elseif (file_exists($fp)) { |
return $this->setInputFile($fp); |
} |
// it must be a string |
else { |
$this->fp = $fp; |
return true; |
} |
return $this->raiseError('Illegal input format', XML_PARSER_ERROR_INVALID_INPUT); |
} |
// }}} |
// {{{ parse() |
/** |
* Central parsing function. |
* |
* @return true|object PEAR error returns true on success, or a PEAR_Error otherwise |
* @access public |
*/ |
function parse() |
{ |
/** |
* reset the parser |
*/ |
$result = $this->reset(); |
if ($this->isError($result)) { |
return $result; |
} |
// if $this->fp was fopened previously |
if (is_resource($this->fp)) { |
while ($data = fread($this->fp, 4096)) { |
if (!$this->_parseString($data, feof($this->fp))) { |
$error = &$this->raiseError(); |
$this->free(); |
return $error; |
} |
} |
// otherwise, $this->fp must be a string |
} else { |
if (!$this->_parseString($this->fp, true)) { |
$error = &$this->raiseError(); |
$this->free(); |
return $error; |
} |
} |
$this->free(); |
return true; |
} |
/** |
* XML_Parser::_parseString() |
* |
* @param string $data |
* @param boolean $eof |
* @return bool |
* @access private |
* @see parseString() |
**/ |
function _parseString($data, $eof = false) |
{ |
return xml_parse($this->parser, $data, $eof); |
} |
// }}} |
// {{{ parseString() |
/** |
* XML_Parser::parseString() |
* |
* Parses a string. |
* |
* @param string $data XML data |
* @param boolean $eof If set and TRUE, data is the last piece of data sent in this parser |
* @throws XML_Parser_Error |
* @return Pear Error|true true on success or a PEAR Error |
* @see _parseString() |
*/ |
function parseString($data, $eof = false) |
{ |
if (!isset($this->parser) || !is_resource($this->parser)) { |
$this->reset(); |
} |
if (!$this->_parseString($data, $eof)) { |
$error = &$this->raiseError(); |
$this->free(); |
return $error; |
} |
if ($eof === true) { |
$this->free(); |
} |
return true; |
} |
/** |
* XML_Parser::free() |
* |
* Free the internal resources associated with the parser |
* |
* @return null |
**/ |
function free() |
{ |
if (isset($this->parser) && is_resource($this->parser)) { |
xml_parser_free($this->parser); |
unset( $this->parser ); |
} |
if (isset($this->fp) && is_resource($this->fp)) { |
fclose($this->fp); |
} |
unset($this->fp); |
return null; |
} |
/** |
* XML_Parser::raiseError() |
* |
* Throws a XML_Parser_Error |
* |
* @param string $msg the error message |
* @param integer $ecode the error message code |
* @return XML_Parser_Error |
**/ |
function raiseError($msg = null, $ecode = 0) |
{ |
$msg = !is_null($msg) ? $msg : $this->parser; |
$err = &new XML_Parser_Error($msg, $ecode); |
return parent::raiseError($err); |
} |
// }}} |
// {{{ funcStartHandler() |
function funcStartHandler($xp, $elem, $attribs) |
{ |
$func = 'xmltag_' . $elem; |
$func = str_replace(array('.', '-', ':'), '_', $func); |
if (method_exists($this->_handlerObj, $func)) { |
call_user_func(array(&$this->_handlerObj, $func), $xp, $elem, $attribs); |
} elseif (method_exists($this->_handlerObj, 'xmltag')) { |
call_user_func(array(&$this->_handlerObj, 'xmltag'), $xp, $elem, $attribs); |
} |
} |
// }}} |
// {{{ funcEndHandler() |
function funcEndHandler($xp, $elem) |
{ |
$func = 'xmltag_' . $elem . '_'; |
$func = str_replace(array('.', '-', ':'), '_', $func); |
if (method_exists($this->_handlerObj, $func)) { |
call_user_func(array(&$this->_handlerObj, $func), $xp, $elem); |
} elseif (method_exists($this->_handlerObj, 'xmltag_')) { |
call_user_func(array(&$this->_handlerObj, 'xmltag_'), $xp, $elem); |
} |
} |
// }}} |
// {{{ startHandler() |
/** |
* |
* @abstract |
*/ |
function startHandler($xp, $elem, &$attribs) |
{ |
return NULL; |
} |
// }}} |
// {{{ endHandler() |
/** |
* |
* @abstract |
*/ |
function endHandler($xp, $elem) |
{ |
return NULL; |
} |
// }}}me |
} |
/** |
* error class, replaces PEAR_Error |
* |
* An instance of this class will be returned |
* if an error occurs inside XML_Parser. |
* |
* There are three advantages over using the standard PEAR_Error: |
* - All messages will be prefixed |
* - check for XML_Parser error, using is_a( $error, 'XML_Parser_Error' ) |
* - messages can be generated from the xml_parser resource |
* |
* @package XML_Parser |
* @access public |
* @see PEAR_Error |
*/ |
class XML_Parser_Error extends PEAR_Error |
{ |
// {{{ properties |
/** |
* prefix for all messages |
* |
* @var string |
*/ |
var $error_message_prefix = 'XML_Parser: '; |
// }}} |
// {{{ constructor() |
/** |
* construct a new error instance |
* |
* You may either pass a message or an xml_parser resource as first |
* parameter. If a resource has been passed, the last error that |
* happened will be retrieved and returned. |
* |
* @access public |
* @param string|resource message or parser resource |
* @param integer error code |
* @param integer error handling |
* @param integer error level |
*/ |
function XML_Parser_Error($msgorparser = 'unknown error', $code = 0, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE) |
{ |
if (is_resource($msgorparser)) { |
$code = xml_get_error_code($msgorparser); |
$msgorparser = sprintf('%s at XML input line %d:%d', |
xml_error_string($code), |
xml_get_current_line_number($msgorparser), |
xml_get_current_column_number($msgorparser)); |
} |
$this->PEAR_Error($msgorparser, $code, $mode, $level); |
} |
// }}} |
} |
?> |
/trunk/api/pear/Auth/HTTP.php |
---|
File deleted |
/trunk/api/pear/Auth/SASL.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Auth/PrefManager.php |
---|
File deleted |
/trunk/api/pear/Auth/RADIUS.php |
---|
File deleted |
/trunk/api/pear/Auth/SASL/DigestMD5.php |
---|
File deleted |
/trunk/api/pear/Auth/SASL/Anonymous.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Auth/SASL/Common.php |
---|
File deleted |
/trunk/api/pear/Auth/SASL/CramMD5.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Auth/SASL/Login.php |
---|
File deleted |
\ No newline at end of file |
/trunk/api/pear/Auth/SASL/Plain.php |
---|
File deleted |
/trunk/api/pear/Auth/Container/LDAP.php |
---|
19,7 → 19,7 |
* @author Hugues Peeters <hugues.peeters@claroline.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: LDAP.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: LDAP.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
*/ |
197,7 → 197,7 |
* @author Hugues Peeters <hugues.peeters@claroline.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
*/ |
class Auth_Container_LDAP extends Auth_Container |
275,29 → 275,34 |
*/ |
function _connect() |
{ |
$this->log('Auth_Container_LDAP::_connect() called.', AUTH_LOG_DEBUG); |
// connect |
if (isset($this->options['url']) && $this->options['url'] != '') { |
$this->_debug('Connecting with URL', __LINE__); |
$this->log('Connecting with URL', AUTH_LOG_DEBUG); |
$conn_params = array($this->options['url']); |
} else { |
$this->_debug('Connecting with host:port', __LINE__); |
$this->log('Connecting with host:port', AUTH_LOG_DEBUG); |
$conn_params = array($this->options['host'], $this->options['port']); |
} |
if (($this->conn_id = @call_user_func_array('ldap_connect', $conn_params)) === false) { |
$this->log('Connection to server failed.', AUTH_LOG_DEBUG); |
$this->log('LDAP ERROR: '.ldap_errno($this->conn_id).': '.ldap_error($this->conn_id), AUTH_LOG_DEBUG); |
return PEAR::raiseError('Auth_Container_LDAP: Could not connect to server.', 41); |
} |
$this->_debug('Successfully connected to server', __LINE__); |
$this->log('Successfully connected to server', AUTH_LOG_DEBUG); |
// switch LDAP version |
if (is_numeric($this->options['version']) && $this->options['version'] > 2) { |
$this->_debug("Switching to LDAP version {$this->options['version']}", __LINE__); |
$this->log("Switching to LDAP version {$this->options['version']}", AUTH_LOG_DEBUG); |
@ldap_set_option($this->conn_id, LDAP_OPT_PROTOCOL_VERSION, $this->options['version']); |
// start TLS if available |
if (isset($this->options['start_tls']) && $this->options['start_tls']) { |
$this->_debug("Starting TLS session", __LINE__); |
$this->log("Starting TLS session", AUTH_LOG_DEBUG); |
if (@ldap_start_tls($this->conn_id) === false) { |
$this->log('Could not start TLS session', AUTH_LOG_DEBUG); |
$this->log('LDAP ERROR: '.ldap_errno($this->conn_id).': '.ldap_error($this->conn_id), AUTH_LOG_DEBUG); |
return PEAR::raiseError('Auth_Container_LDAP: Could not start tls.', 41); |
} |
} |
305,26 → 310,30 |
// switch LDAP referrals |
if (is_bool($this->options['referrals'])) { |
$this->_debug("Switching LDAP referrals to " . (($this->options['referrals']) ? 'true' : 'false'), __LINE__); |
@ldap_set_option($this->conn_id, LDAP_OPT_REFERRALS, $this->options['referrals']); |
$this->log("Switching LDAP referrals to " . (($this->options['referrals']) ? 'true' : 'false'), AUTH_LOG_DEBUG); |
if (@ldap_set_option($this->conn_id, LDAP_OPT_REFERRALS, $this->options['referrals']) === false) { |
$this->log('Could not change LDAP referrals options', AUTH_LOG_DEBUG); |
$this->log('LDAP ERROR: '.ldap_errno($this->conn_id).': '.ldap_error($this->conn_id), AUTH_LOG_DEBUG); |
} |
} |
// bind with credentials or anonymously |
if (strlen($this->options['binddn']) && strlen($this->options['bindpw'])) { |
$this->_debug('Binding with credentials', __LINE__); |
$this->log('Binding with credentials', AUTH_LOG_DEBUG); |
$bind_params = array($this->conn_id, $this->options['binddn'], $this->options['bindpw']); |
} else { |
$this->_debug('Binding anonymously', __LINE__); |
$this->log('Binding anonymously', AUTH_LOG_DEBUG); |
$bind_params = array($this->conn_id); |
} |
// bind for searching |
if ((@call_user_func_array('ldap_bind', $bind_params)) === false) { |
$this->_debug(); |
$this->log('Bind failed', AUTH_LOG_DEBUG); |
$this->log('LDAP ERROR: '.ldap_errno($this->conn_id).': '.ldap_error($this->conn_id), AUTH_LOG_DEBUG); |
$this->_disconnect(); |
return PEAR::raiseError("Auth_Container_LDAP: Could not bind to LDAP server.", 41); |
} |
$this->_debug('Binding was successful', __LINE__); |
$this->log('Binding was successful', AUTH_LOG_DEBUG); |
return true; |
} |
339,8 → 348,9 |
*/ |
function _disconnect() |
{ |
$this->log('Auth_Container_LDAP::_disconnect() called.', AUTH_LOG_DEBUG); |
if ($this->_isValidLink()) { |
$this->_debug('disconnecting from server'); |
$this->log('disconnecting from server'); |
@ldap_unbind($this->conn_id); |
} |
} |
355,6 → 365,7 |
*/ |
function _getBaseDN() |
{ |
$this->log('Auth_Container_LDAP::_getBaseDN() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
361,13 → 372,13 |
} |
if ($this->options['basedn'] == "" && $this->_isValidLink()) { |
$this->_debug("basedn not set, searching via namingContexts.", __LINE__); |
$this->log("basedn not set, searching via namingContexts.", AUTH_LOG_DEBUG); |
$result_id = @ldap_read($this->conn_id, "", "(objectclass=*)", array("namingContexts")); |
if (@ldap_count_entries($this->conn_id, $result_id) == 1) { |
$this->_debug("got result for namingContexts", __LINE__); |
$this->log("got result for namingContexts", AUTH_LOG_DEBUG); |
$entry_id = @ldap_first_entry($this->conn_id, $result_id); |
$attrs = @ldap_get_attributes($this->conn_id, $entry_id); |
374,7 → 385,7 |
$basedn = $attrs['namingContexts'][0]; |
if ($basedn != "") { |
$this->_debug("result for namingContexts was $basedn", __LINE__); |
$this->log("result for namingContexts was $basedn", AUTH_LOG_DEBUG); |
$this->options['basedn'] = $basedn; |
} |
} |
430,7 → 441,6 |
$this->options['userattr'] = 'uid'; |
$this->options['userfilter'] = '(objectClass=posixAccount)'; |
$this->options['attributes'] = array(''); // no attributes |
// $this->options['attrformat'] = 'LDAP'; // returns attribute array as PHP LDAP functions return it |
$this->options['attrformat'] = 'AUTH'; // returns attribute like other Auth containers |
$this->options['group'] = ''; |
$this->options['groupdn'] = ''; |
536,6 → 546,7 |
*/ |
function fetchData($username, $password) |
{ |
$this->log('Auth_Container_LDAP::fetchData() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
548,7 → 559,7 |
// UTF8 Encode username for LDAPv3 |
if (@ldap_get_option($this->conn_id, LDAP_OPT_PROTOCOL_VERSION, $ver) && $ver == 3) { |
$this->_debug('UTF8 encoding username for LDAPv3', __LINE__); |
$this->log('UTF8 encoding username for LDAPv3', AUTH_LOG_DEBUG); |
$username = utf8_encode($username); |
} |
566,22 → 577,22 |
$search_basedn .= $this->options['basedn']; |
// attributes |
$attributes = $this->options['attributes']; |
$searchAttributes = $this->options['attributes']; |
// make functions params array |
$func_params = array($this->conn_id, $search_basedn, $filter, $attributes); |
$func_params = array($this->conn_id, $search_basedn, $filter, $searchAttributes); |
// search function to use |
$func_name = $this->_scope2function($this->options['userscope']); |
$this->_debug("Searching with $func_name and filter $filter in $search_basedn", __LINE__); |
$this->log("Searching with $func_name and filter $filter in $search_basedn", AUTH_LOG_DEBUG); |
// search |
if (($result_id = @call_user_func_array($func_name, $func_params)) === false) { |
$this->_debug('User not found', __LINE__); |
$this->log('User not found', AUTH_LOG_DEBUG); |
} elseif (@ldap_count_entries($this->conn_id, $result_id) >= 1) { // did we get some possible results? |
$this->_debug('User(s) found', __LINE__); |
$this->log('User(s) found', AUTH_LOG_DEBUG); |
$first = true; |
$entry_id = null; |
600,8 → 611,8 |
$user_dn = @ldap_get_dn($this->conn_id, $entry_id); |
// as the dn is not fetched as an attribute, we save it anyway |
if (is_array($attributes) && in_array('dn', $attributes)) { |
$this->_debug('Saving DN to AuthData', __LINE__); |
if (is_array($searchAttributes) && in_array('dn', $searchAttributes)) { |
$this->log('Saving DN to AuthData', AUTH_LOG_DEBUG); |
$this->_auth_obj->setAuthData('dn', $user_dn); |
} |
625,7 → 636,7 |
// eg. $this->options['attrformat'] = 'AUTH' |
if ( strtoupper($this->options['attrformat']) == 'AUTH' ) { |
$this->_debug('Saving attributes to Auth data in AUTH format', __LINE__); |
$this->log('Saving attributes to Auth data in AUTH format', AUTH_LOG_DEBUG); |
unset ($attributes['count']); |
foreach ($attributes as $attributeName => $attributeValue ) { |
if (is_int($attributeName)) continue; |
633,12 → 644,13 |
unset ($attributeValue['count']); |
} |
if (count($attributeValue)<=1) $attributeValue = $attributeValue[0]; |
$this->log('Storing additional field: '.$attributeName, AUTH_LOG_DEBUG); |
$this->_auth_obj->setAuthData($attributeName, $attributeValue); |
} |
} |
else |
{ |
$this->_debug('Saving attributes to Auth data in LDAP format', __LINE__); |
$this->log('Saving attributes to Auth data in LDAP format', AUTH_LOG_DEBUG); |
$this->_auth_obj->setAuthData('attributes', $attributes); |
} |
} |
648,21 → 660,21 |
// need to catch an empty password as openldap seems to return TRUE |
// if anonymous binding is allowed |
if ($password != "") { |
$this->_debug("Bind as $user_dn", __LINE__); |
$this->log("Bind as $user_dn", AUTH_LOG_DEBUG); |
// try binding as this user with the supplied password |
if (@ldap_bind($this->conn_id, $user_dn, $password)) { |
$this->_debug('Bind successful', __LINE__); |
$this->log('Bind successful', AUTH_LOG_DEBUG); |
// check group if appropiate |
if (strlen($this->options['group'])) { |
// decide whether memberattr value is a dn or the username |
$this->_debug('Checking group membership', __LINE__); |
$this->log('Checking group membership', AUTH_LOG_DEBUG); |
$return = $this->checkGroup(($this->options['memberisdn']) ? $user_dn : $username); |
$this->_disconnect(); |
return $return; |
} else { |
$this->_debug('Authenticated', __LINE__); |
$this->log('Authenticated', AUTH_LOG_DEBUG); |
$this->_disconnect(); |
return true; // user authenticated |
} // checkGroup |
671,7 → 683,7 |
} while ($this->options['try_all'] == true); // interate through entries |
} // get results |
// default |
$this->_debug('NOT authenticated!', __LINE__); |
$this->log('NOT authenticated!', AUTH_LOG_DEBUG); |
$this->_disconnect(); |
return false; |
} |
691,6 → 703,7 |
*/ |
function checkGroup($user) |
{ |
$this->log('Auth_Container_LDAP::checkGroup() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
715,42 → 728,22 |
array($this->options['memberattr'])); |
$func_name = $this->_scope2function($this->options['groupscope']); |
$this->_debug("Searching with $func_name and filter $filter in $search_basedn", __LINE__); |
$this->log("Searching with $func_name and filter $filter in $search_basedn", AUTH_LOG_DEBUG); |
// search |
if (($result_id = @call_user_func_array($func_name, $func_params)) != false) { |
if (@ldap_count_entries($this->conn_id, $result_id) == 1) { |
@ldap_free_result($result_id); |
$this->_debug('User is member of group', __LINE__); |
$this->log('User is member of group', AUTH_LOG_DEBUG); |
return true; |
} |
} |
// default |
$this->_debug('User is NOT member of group', __LINE__); |
$this->log('User is NOT member of group', AUTH_LOG_DEBUG); |
return false; |
} |
// }}} |
// {{{ _debug() |
/** |
* Outputs debugging messages |
* |
* @access private |
* @param string Debugging Message |
* @param integer Line number |
*/ |
function _debug($msg = '', $line = 0) |
{ |
if ($this->options['debug'] == true) { |
if ($msg == '' && $this->_isValidLink()) { |
$msg = 'LDAP_Error: ' . @ldap_err2str(@ldap_errno($this->_conn_id)); |
} |
print("$line: $msg <br />"); |
} |
} |
// }}} |
// {{{ _quoteFilterString() |
/** |
/trunk/api/pear/Auth/Container/POP3.php |
---|
20,7 → 20,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: POP3.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: POP3.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.2.0 |
*/ |
48,7 → 48,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.2.0 |
*/ |
127,9 → 127,11 |
*/ |
function fetchData($username, $password) |
{ |
$this->log('Auth_Container_POP3::fetchData() called.', AUTH_LOG_DEBUG); |
$pop3 =& new Net_POP3(); |
$res = $pop3->connect($this->server, $this->port, $this->method); |
if (!$res) { |
$this->log('Connection to POP3 server failed.', AUTH_LOG_DEBUG); |
return $res; |
} |
$result = $pop3->login($username, $password); |
/trunk/api/pear/Auth/Container/SAP.php |
---|
20,7 → 20,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: SAP.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: SAP.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.4.0 |
*/ |
48,7 → 48,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @since Class available since Release 1.4.0 |
*/ |
class Auth_Container_SAP extends Auth_Container { |
116,6 → 116,7 |
*/ |
function fetchData($username, $password) |
{ |
$this->log('Auth_Container_SAP::fetchData() called.', AUTH_LOG_DEBUG); |
$connection_options = $this->options; |
$connection_options['USER'] = $username; |
$connection_options['PASSWD'] = $password; |
130,6 → 131,7 |
return false; |
} else { |
if (!empty($this->options['GETSSO2'])) { |
$this->log('Attempting to retrieve SSO2 ticket.', AUTH_LOG_DEBUG); |
if ($ticket = @saprfc_get_ticket($rfc)) { |
$this->options['MYSAPSSO2'] = $ticket; |
unset($this->options['GETSSO2']); |
/trunk/api/pear/Auth/Container/MDB2.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: MDB2.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: MDB2.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.3.0 |
*/ |
44,7 → 44,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.3.0 |
*/ |
109,6 → 109,7 |
*/ |
function _connect($dsn) |
{ |
$this->log('Auth_Container_MDB2::_connect() called.', AUTH_LOG_DEBUG); |
if (is_string($dsn) || is_array($dsn)) { |
$this->db =& MDB2::connect($dsn, $this->options['db_options']); |
} elseif (is_subclass_of($dsn, 'MDB2_Driver_Common')) { |
179,6 → 180,7 |
*/ |
function query($query) |
{ |
$this->log('Auth_Container_MDB2::query() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return $err; |
204,6 → 206,7 |
$this->options['db_fields'] = ''; |
$this->options['cryptType'] = 'md5'; |
$this->options['db_options'] = array(); |
$this->options['db_where'] = ''; |
$this->options['auto_quote'] = true; |
} |
283,6 → 286,7 |
*/ |
function fetchData($username, $password, $isChallengeResponse=false) |
{ |
$this->log('Auth_Container_MDB2::fetchData() called.', AUTH_LOG_DEBUG); |
// Prepare for a database query |
$err = $this->_prepare(); |
if ($err !== true) { |
308,6 → 312,14 |
$this->db->quote($username, 'text') |
); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " AND ".$this->options['db_where']; |
} |
$this->log('Running SQL against MDB2: '.$query, AUTH_LOG_DEBUG); |
$res = $this->db->queryRow($query, null, MDB2_FETCHMODE_ASSOC); |
if (MDB2::isError($res) || PEAR::isError($res)) { |
return PEAR::raiseError($res->getMessage(), $res->getCode()); |
338,6 → 350,9 |
$key == $this->options['usernamecol']) { |
continue; |
} |
$this->log('Storing additional field: '.$key, AUTH_LOG_DEBUG); |
// Use reference to the auth object if exists |
// This is because the auth session variable can change so a static call to setAuthData does not make sense |
$this->_auth_obj->setAuthData($key, $value); |
360,6 → 375,7 |
*/ |
function listUsers() |
{ |
$this->log('Auth_Container_MDB2::listUsers() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
385,6 → 401,14 |
$this->options['final_table'] |
); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " WHERE ".$this->options['db_where']; |
} |
$this->log('Running SQL against MDB2: '.$query, AUTH_LOG_DEBUG); |
$res = $this->db->queryAll($query, null, MDB2_FETCHMODE_ASSOC); |
if (MDB2::isError($res)) { |
return PEAR::raiseError($res->getMessage(), $res->getCode()); |
394,6 → 418,7 |
$retVal[] = $user; |
} |
} |
$this->log('Found '.count($retVal).' users.', AUTH_LOG_DEBUG); |
return $retVal; |
} |
412,6 → 437,7 |
*/ |
function addUser($username, $password, $additional = "") |
{ |
$this->log('Auth_Container_MDB2::addUser() called.', AUTH_LOG_DEBUG); |
// Prepare for a database query |
$err = $this->_prepare(); |
453,6 → 479,8 |
$additional_value |
); |
$this->log('Running SQL against MDB2: '.$query, AUTH_LOG_DEBUG); |
$res = $this->query($query); |
if (MDB2::isError($res)) { |
474,6 → 502,7 |
*/ |
function removeUser($username) |
{ |
$this->log('Auth_Container_MDB2::removeUser() called.', AUTH_LOG_DEBUG); |
// Prepare for a database query |
$err = $this->_prepare(); |
if ($err !== true) { |
486,6 → 515,14 |
$this->db->quote($username, 'text') |
); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " AND ".$this->options['db_where']; |
} |
$this->log('Running SQL against MDB2: '.$query, AUTH_LOG_DEBUG); |
$res = $this->query($query); |
if (MDB2::isError($res)) { |
505,6 → 542,7 |
*/ |
function changePassword($username, $password) |
{ |
$this->log('Auth_Container_MDB2::changePassword() called.', AUTH_LOG_DEBUG); |
// Prepare for a database query |
$err = $this->_prepare(); |
if ($err !== true) { |
529,6 → 567,14 |
$this->db->quote($username, 'text') |
); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " AND ".$this->options['db_where']; |
} |
$this->log('Running SQL against MDB2: '.$query, AUTH_LOG_DEBUG); |
$res = $this->query($query); |
if (MDB2::isError($res)) { |
/trunk/api/pear/Auth/Container/DB.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: DB.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: DB.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
*/ |
43,7 → 43,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
*/ |
class Auth_Container_DB extends Auth_Container |
109,6 → 109,8 |
*/ |
function _connect($dsn) |
{ |
$this->log('Auth_Container_DB::_connect() called.', AUTH_LOG_DEBUG); |
if (is_string($dsn) || is_array($dsn)) { |
$this->db = DB::Connect($dsn, $this->options['db_options']); |
} elseif (is_subclass_of($dsn, 'db_common')) { |
205,6 → 207,7 |
$this->options['db_fields'] = ''; |
$this->options['cryptType'] = 'md5'; |
$this->options['db_options'] = array(); |
$this->options['db_where'] = ''; |
$this->options['auto_quote'] = true; |
} |
284,6 → 287,7 |
*/ |
function fetchData($username, $password, $isChallengeResponse=false) |
{ |
$this->log('Auth_Container_DB::fetchData() called.', AUTH_LOG_DEBUG); |
// Prepare for a database query |
$err = $this->_prepare(); |
if ($err !== true) { |
307,6 → 311,14 |
" FROM ".$this->options['final_table']. |
" WHERE ".$this->options['final_usernamecol']." = ".$this->db->quoteSmart($username); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " AND ".$this->options['db_where']; |
} |
$this->log('Running SQL against DB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->db->getRow($query, null, DB_FETCHMODE_ASSOC); |
if (DB::isError($res)) { |
344,6 → 356,9 |
$key == $this->options['usernamecol']) { |
continue; |
} |
$this->log('Storing additional field: '.$key, AUTH_LOG_DEBUG); |
// Use reference to the auth object if exists |
// This is because the auth session variable can change so a |
// static call to setAuthData does not make sence |
366,6 → 381,7 |
*/ |
function listUsers() |
{ |
$this->log('Auth_Container_DB::listUsers() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
390,6 → 406,15 |
$sql_from, |
$this->options['final_table'] |
); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " WHERE ".$this->options['db_where']; |
} |
$this->log('Running SQL against DB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->db->getAll($query, null, DB_FETCHMODE_ASSOC); |
if (DB::isError($res)) { |
400,6 → 425,7 |
$retVal[] = $user; |
} |
} |
$this->log('Found '.count($retVal).' users.', AUTH_LOG_DEBUG); |
return $retVal; |
} |
418,6 → 444,7 |
*/ |
function addUser($username, $password, $additional = "") |
{ |
$this->log('Auth_Container_DB::addUser() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
459,6 → 486,8 |
$additional_value |
); |
$this->log('Running SQL against DB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->query($query); |
if (DB::isError($res)) { |
481,17 → 510,30 |
*/ |
function removeUser($username) |
{ |
$this->log('Auth_Container_DB::removeUser() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
} |
$query = sprintf("DELETE FROM %s WHERE %s = %s", |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$where = " AND ".$this->options['db_where']; |
} else { |
$where = ''; |
} |
$query = sprintf("DELETE FROM %s WHERE %s = %s %s", |
$this->options['final_table'], |
$this->options['final_usernamecol'], |
$this->db->quoteSmart($username) |
$this->db->quoteSmart($username), |
$where |
); |
$this->log('Running SQL against DB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->query($query); |
if (DB::isError($res)) { |
512,6 → 554,7 |
*/ |
function changePassword($username, $password) |
{ |
$this->log('Auth_Container_DB::changePassword() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
529,14 → 572,25 |
$password = $cryptFunction($password); |
$query = sprintf("UPDATE %s SET %s = %s WHERE %s = %s", |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$where = " AND ".$this->options['db_where']; |
} else { |
$where = ''; |
} |
$query = sprintf("UPDATE %s SET %s = %s WHERE %s = %s %s", |
$this->options['final_table'], |
$this->options['final_passwordcol'], |
$this->db->quoteSmart($password), |
$this->options['final_usernamecol'], |
$this->db->quoteSmart($username) |
$this->db->quoteSmart($username), |
$where |
); |
$this->log('Running SQL against DB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->query($query); |
if (DB::isError($res)) { |
/trunk/api/pear/Auth/Container/IMAP.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: IMAP.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: IMAP.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.2.0 |
*/ |
77,7 → 77,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.2.0 |
*/ |
148,6 → 148,7 |
* @access private |
*/ |
function _checkServer() { |
$this->log('Auth_Container_IMAP::_checkServer() called.', AUTH_LOG_DEBUG); |
$fp = @fsockopen ($this->options['host'], $this->options['port'], |
$errno, $errstr, $this->options['timeout']); |
if (is_resource($fp)) { |
188,13 → 189,16 |
*/ |
function fetchData($username, $password) |
{ |
$this->log('Auth_Container_IMAP::fetchData() called.', AUTH_LOG_DEBUG); |
$dsn = '{'.$this->options['host'].':'.$this->options['port'].$this->options['baseDSN'].'}'; |
$conn = @imap_open ($dsn, $username, $password, OP_HALFOPEN); |
if (is_resource($conn)) { |
$this->log('Successfully connected to IMAP server.', AUTH_LOG_DEBUG); |
$this->activeUser = $username; |
@imap_close($conn); |
return true; |
} else { |
$this->log('Connection to IMAP server failed.', AUTH_LOG_DEBUG); |
$this->activeUser = ''; |
return false; |
} |
/trunk/api/pear/Auth/Container/vpopmail.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: vpopmail.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: vpopmail.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.2.0 |
*/ |
41,7 → 41,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.2.0 |
*/ |
74,6 → 74,7 |
*/ |
function fetchData($username, $password) |
{ |
$this->log('Auth_Container_vpopmail::fetchData() called.', AUTH_LOG_DEBUG); |
$userdata = array(); |
$userdata = preg_split("/@/", $username, 2); |
$result = @vpopmail_auth_user($userdata[0], $userdata[1], $password); |
/trunk/api/pear/Auth/Container/SOAP5.php |
---|
19,7 → 19,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: SOAP5.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: SOAP5.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @since File available since Release 1.4.0 |
*/ |
101,7 → 101,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @since Class available since Release 1.4.0 |
*/ |
class Auth_Container_SOAP5 extends Auth_Container |
182,6 → 182,7 |
*/ |
function fetchData($username, $password) |
{ |
$this->log('Auth_Container_SOAP5::fetchData() called.', AUTH_LOG_DEBUG); |
$result = $this->_validateOptions(); |
if (PEAR::isError($result)) |
return $result; |
225,17 → 226,17 |
* @access private |
* @param array |
*/ |
function _validateOptions($array) |
function _validateOptions() |
{ |
if ( ( is_null($this->options['wsdl']) |
&& is_null($this->options['location']) |
&& is_null($this->options['uri'])) |
|| ( is_null($this->options['wsdl']) |
&& ( is_null($this->options['location']) |
|| is_null($this->options['uri'])))) { |
if ( ( is_null($this->_options['wsdl']) |
&& is_null($this->_options['location']) |
&& is_null($this->_options['uri'])) |
|| ( is_null($this->_options['wsdl']) |
&& ( is_null($this->_options['location']) |
|| is_null($this->_options['uri'])))) { |
return PEAR::raiseError('Either a WSDL file or a location/uri pair must be specified.'); |
} |
if (is_null($this->options['method'])) { |
if (is_null($this->_options['method'])) { |
return PEAR::raiseError('A method to call on the soap service must be specified.'); |
} |
return true; |
252,13 → 253,13 |
*/ |
function _setDefaults() |
{ |
$this->options['wsdl'] = null; |
$this->options['location'] = null; |
$this->options['uri'] = null; |
$this->options['method'] = null; |
$this->options['usernamefield'] = 'username'; |
$this->options['passwordfield'] = 'password'; |
$this->options['matchpasswords'] = true; |
$this->_options['wsdl'] = null; |
$this->_options['location'] = null; |
$this->_options['uri'] = null; |
$this->_options['method'] = null; |
$this->_options['usernamefield'] = 'username'; |
$this->_options['passwordfield'] = 'password'; |
$this->_options['matchpasswords'] = true; |
} |
// }}} |
/trunk/api/pear/Auth/Container/PEAR.php |
---|
18,19 → 18,19 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: PEAR.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: PEAR.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.3.0 |
*/ |
/** |
* Include PEAR HTTP_Client. |
*/ |
require_once 'HTTP/Client.php'; |
/** |
* Include Auth_Container base class |
*/ |
require_once 'Auth/Container.php'; |
/** |
* Include PEAR XML_RPC |
*/ |
require_once 'XML/RPC.php'; |
/** |
* Storage driver for authenticating against PEAR website |
42,9 → 42,10 |
* @package Auth |
* @author Yavor Shahpasov <yavo@netsmart.com.cy> |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @author Adam Harvey <aharvey@php.net> |
* @copyright 2001-2007 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.3.0 |
*/ |
80,22 → 81,33 |
*/ |
function fetchData($username, $password) |
{ |
$rpc = new XML_RPC_Client('/xmlrpc.php', 'pear.php.net'); |
$rpc_message = new XML_RPC_Message("user.info", array(new XML_RPC_Value($username, "string")) ); |
$this->log('Auth_Container_PEAR::fetchData() called.', AUTH_LOG_DEBUG); |
// Error Checking howto ??? |
$result = $rpc->send($rpc_message); |
$value = $result->value(); |
$userinfo = xml_rpc_decode($value); |
if ($userinfo['password'] == md5($password)) { |
$this->activeUser = $userinfo['handle']; |
foreach ($userinfo as $uk=>$uv) { |
$this->_auth_obj->setAuthData($uk, $uv); |
$client = new HTTP_Client; |
$this->log('Auth_Container_PEAR::fetchData() getting salt.', AUTH_LOG_DEBUG); |
$code = $client->get('https://pear.php.net/rest-login.php/getsalt'); |
if ($code != 200) { |
return PEAR::raiseError('Bad response to salt request.', $code); |
} |
$resp = $client->currentResponse(); |
$salt = $resp['body']; |
$this->log('Auth_Container_PEAR::fetchData() calling validate.', AUTH_LOG_DEBUG); |
$code = $client->post('https://pear.php.net/rest-login.php/validate', |
array('username' => $username, |
'password' => md5($salt.md5($password)))); |
if ($code != 200) { |
return PEAR::raiseError('Bad response to validate request.', $code); |
} |
$resp = $client->currentResponse(); |
list($code, $message) = explode(' ', $resp['body'], 1); |
if ($code != 8) { |
return PEAR::raiseError($message, $code); |
} |
return true; |
} |
return false; |
} |
// }}} |
/trunk/api/pear/Auth/Container/RADIUS.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: RADIUS.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: RADIUS.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.2.0 |
*/ |
41,7 → 41,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.2.0 |
*/ |
125,6 → 125,8 |
*/ |
function fetchData($username, $password, $challenge = null) |
{ |
$this->log('Auth_Container_RADIUS::fetchData() called.', AUTH_LOG_DEBUG); |
switch($this->authtype) { |
case 'CHAP_MD5': |
case 'MSCHAPv1': |
140,8 → 142,8 |
$this->radius->challenge = $crpt->challenge; |
$this->radius->chapid = $crpt->chapid; |
$this->radius->response = $crpt->challengeResponse(); |
} |
break; |
} |
case 'MSCHAPv2': |
require_once 'Crypt/CHAP.php'; |
/trunk/api/pear/Auth/Container/Multiple.php |
---|
New file |
0,0 → 1,188 |
<?php |
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */ |
/** |
* Storage driver for using multiple storage drivers in a fall through fashion |
* |
* PHP versions 4 and 5 |
* |
* LICENSE: This source file is subject to version 3.01 of the PHP license |
* that is available through the world-wide-web at the following URI: |
* http://www.php.net/license/3_01.txt. If you did not receive a copy of |
* the PHP License and are unable to obtain it through the web, please |
* send a note to license@php.net so we can mail you a copy immediately. |
* |
* @category Authentication |
* @package Auth |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: Multiple.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @since File available since Release 1.5.0 |
*/ |
/** |
* Include Auth_Container base class |
*/ |
require_once "Auth/Container.php"; |
/** |
* Include PEAR package for error handling |
*/ |
require_once "PEAR.php"; |
/** |
* Storage driver for using multiple storage drivers in a fall through fashion |
* |
* This storage driver provides a mechanism for working through multiple |
* storage drivers until either one allows successful login or the list is |
* exhausted. |
* |
* This container takes an array of options of the following form: |
* |
* array( |
* array( |
* 'type' => <standard container type name>, |
* 'options' => <normal array of options for container>, |
* ), |
* ); |
* |
* Full example: |
* |
* $options = array( |
* array( |
* 'type' => 'DB', |
* 'options' => array( |
* 'dsn' => "mysql://user:password@localhost/database", |
* ), |
* ), |
* array( |
* 'type' => 'Array', |
* 'options' => array( |
* 'cryptType' => 'md5', |
* 'users' => array( |
* 'admin' => md5('password'), |
* ), |
* ), |
* ), |
* ); |
* |
* $auth = new Auth('Multiple', $options); |
* |
* @category Authentication |
* @package Auth |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @since File available since Release 1.5.0 |
*/ |
class Auth_Container_Multiple extends Auth_Container { |
// {{{ properties |
/** |
* The options for each container |
* |
* @var array $options |
*/ |
var $options = array(); |
/** |
* The instanciated containers |
* |
* @var array $containers |
*/ |
var $containers = array(); |
// }}} |
// {{{ Auth_Container_Multiple() |
/** |
* Constructor for Array Container |
* |
* @param array $data Options for the container |
* @return void |
*/ |
function Auth_Container_Multiple($options) |
{ |
if (!is_array($options)) { |
PEAR::raiseError('The options for Auth_Container_Multiple must be an array'); |
} |
if (count($options) < 1) { |
PEAR::raiseError('You must define at least one sub container to use in Auth_Container_Multiple'); |
} |
foreach ($options as $option) { |
if (!isset($option['type'])) { |
PEAR::raiseError('No type defined for sub container'); |
} |
} |
$this->options = $options; |
} |
// }}} |
// {{{ fetchData() |
/** |
* Get user information from array |
* |
* This function uses the given username to fetch the corresponding |
* login data from the array. If an account that matches the passed |
* username and password is found, the function returns true. |
* Otherwise it returns false. |
* |
* @param string Username |
* @param string Password |
* @return boolean|PEAR_Error Error object or boolean |
*/ |
function fetchData($user, $pass) |
{ |
$this->log('Auth_Container_Multiple::fetchData() called.', AUTH_LOG_DEBUG); |
foreach ($this->options as $key => $options) { |
$this->log('Using Container '.$key.' of type '.$options['type'].'.', AUTH_LOG_DEBUG); |
if (isset($this->containers[$key]) && is_a($this->containers[$key], 'Auth_Container')) { |
$container = &$this->containers[$key]; |
} else { |
$this->containers[$key] = &$this->_auth_obj->_factory($options['type'], $options['options']); |
$this->containers[$key]->_auth_obj = &$this->_auth_obj; |
$container = &$this->containers[$key]; |
} |
$result = $container->fetchData($user, $pass); |
if (PEAR::isError($result)) { |
$this->log('Container '.$key.': '.$result->getMessage(), AUTH_LOG_ERR); |
return $result; |
} elseif ($result == true) { |
$this->log('Container '.$key.': Authentication successful.', AUTH_LOG_DEBUG); |
return true; |
} else { |
$this->log('Container '.$key.': Authentication failed.', AUTH_LOG_DEBUG); |
} |
} |
$this->log('Auth_Container_Multiple: All containers rejected user credentials.', AUTH_LOG_DEBUG); |
return false; |
} |
// }}} |
} |
?> |
/trunk/api/pear/Auth/Container/KADM5.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: KADM5.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: KADM5.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.4.0 |
*/ |
48,7 → 48,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.4.0 |
*/ |
114,6 → 114,7 |
* @return boolean |
*/ |
function fetchData($username, $password) { |
$this->log('Auth_Container_KADM5::fetchData() called.', AUTH_LOG_DEBUG); |
if ( ($username == NULL) || ($password == NULL) ) { |
return false; |
} |
/trunk/api/pear/Auth/Container/MDB.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: MDB.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: MDB.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.2.3 |
*/ |
44,7 → 44,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.2.3 |
*/ |
109,6 → 109,7 |
*/ |
function _connect($dsn) |
{ |
$this->log('Auth_Container_MDB::_connect() called.', AUTH_LOG_DEBUG); |
if (is_string($dsn) || is_array($dsn)) { |
$this->db =& MDB::connect($dsn, $this->options['db_options']); |
} elseif (is_subclass_of($dsn, 'mdb_common')) { |
179,6 → 180,7 |
*/ |
function query($query) |
{ |
$this->log('Auth_Container_MDB::query() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return $err; |
204,6 → 206,7 |
$this->options['db_fields'] = ''; |
$this->options['cryptType'] = 'md5'; |
$this->options['db_options'] = array(); |
$this->options['db_where'] = ''; |
$this->options['auto_quote'] = true; |
} |
283,6 → 286,7 |
*/ |
function fetchData($username, $password, $isChallengeResponse=false) |
{ |
$this->log('Auth_Container_MDB::fetchData() called.', AUTH_LOG_DEBUG); |
// Prepare for a database query |
$err = $this->_prepare(); |
if ($err !== true) { |
309,6 → 313,14 |
$this->db->getTextValue($username) |
); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " AND ".$this->options['db_where']; |
} |
$this->log('Running SQL against MDB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->db->getRow($query, null, null, null, MDB_FETCHMODE_ASSOC); |
if (MDB::isError($res) || PEAR::isError($res)) { |
342,6 → 354,8 |
$key == $this->options['usernamecol']) { |
continue; |
} |
$this->log('Storing additional field: '.$key, AUTH_LOG_DEBUG); |
// Use reference to the auth object if exists |
// This is because the auth session variable can change so a static |
// call to setAuthData does not make sense |
365,6 → 379,7 |
*/ |
function listUsers() |
{ |
$this->log('Auth_Container_MDB::listUsers() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
390,6 → 405,14 |
$this->options['final_table'] |
); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " WHERE ".$this->options['db_where']; |
} |
$this->log('Running SQL against MDB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->db->getAll($query, null, null, null, MDB_FETCHMODE_ASSOC); |
if (MDB::isError($res)) { |
400,6 → 423,7 |
$retVal[] = $user; |
} |
} |
$this->log('Found '.count($retVal).' users.', AUTH_LOG_DEBUG); |
return $retVal; |
} |
418,6 → 442,7 |
*/ |
function addUser($username, $password, $additional = "") |
{ |
$this->log('Auth_Container_MDB::addUser() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
457,6 → 482,8 |
$additional_value |
); |
$this->log('Running SQL against MDB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->query($query); |
if (MDB::isError($res)) { |
478,6 → 505,7 |
*/ |
function removeUser($username) |
{ |
$this->log('Auth_Container_MDB::removeUser() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
489,6 → 517,14 |
$this->db->getTextValue($username) |
); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " AND ".$this->options['db_where']; |
} |
$this->log('Running SQL against MDB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->query($query); |
if (MDB::isError($res)) { |
508,6 → 544,7 |
*/ |
function changePassword($username, $password) |
{ |
$this->log('Auth_Container_MDB::changePassword() called.', AUTH_LOG_DEBUG); |
$err = $this->_prepare(); |
if ($err !== true) { |
return PEAR::raiseError($err->getMessage(), $err->getCode()); |
531,6 → 568,14 |
$this->db->getTextValue($username) |
); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " AND ".$this->options['db_where']; |
} |
$this->log('Running SQL against MDB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->query($query); |
if (MDB::isError($res)) { |
/trunk/api/pear/Auth/Container/SOAP.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: SOAP.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: SOAP.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.2.0 |
*/ |
83,7 → 83,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.2.0 |
*/ |
170,6 → 170,7 |
*/ |
function fetchData($username, $password) |
{ |
$this->log('Auth_Container_SOAP::fetchData() called.', AUTH_LOG_DEBUG); |
// check if all required options are set |
if (array_intersect($this->_requiredOptions, array_keys($this->_options)) != $this->_requiredOptions) { |
return false; |
/trunk/api/pear/Auth/Container/SMBPasswd.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: SMBPasswd.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: SMBPasswd.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.2.3 |
*/ |
56,7 → 56,7 |
* @package Auth |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.2.3 |
*/ |
104,6 → 104,7 |
*/ |
function fetchData($username, $password) |
{ |
$this->log('Auth_Container_SMBPasswd::fetchData() called.', AUTH_LOG_DEBUG); |
return $this->pwfile->verifyAccount($username, $password); |
} |
112,6 → 113,7 |
function listUsers() |
{ |
$this->log('Auth_Container_SMBPasswd::fetchData() called.', AUTH_LOG_DEBUG); |
return $this->pwfile->getAccounts(); |
} |
129,6 → 131,7 |
*/ |
function addUser($username, $password, $additional = '') |
{ |
$this->log('Auth_Container_SMBPasswd::addUser() called.', AUTH_LOG_DEBUG); |
$res = $this->pwfile->addUser($user, $additional['userid'], $pass); |
if ($res === true) { |
return $this->pwfile->save(); |
146,6 → 149,7 |
*/ |
function removeUser($username) |
{ |
$this->log('Auth_Container_SMBPasswd::removeUser() called.', AUTH_LOG_DEBUG); |
$res = $this->pwfile->delUser($username); |
if ($res === true) { |
return $this->pwfile->save(); |
164,6 → 168,7 |
*/ |
function changePassword($username, $password) |
{ |
$this->log('Auth_Container_SMBPasswd::changePassword() called.', AUTH_LOG_DEBUG); |
$res = $this->pwfile->modUser($username, '', $password); |
if ($res === true) { |
return $this->pwfile->save(); |
/trunk/api/pear/Auth/Container/DBLite.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: DBLite.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: DBLite.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.3.0 |
*/ |
45,7 → 45,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.3.0 |
*/ |
93,6 → 93,7 |
$this->options['db_fields'] = ''; |
$this->options['cryptType'] = 'md5'; |
$this->options['db_options'] = array(); |
$this->options['db_where'] = ''; |
$this->options['auto_quote'] = true; |
if (is_array($dsn)) { |
117,6 → 118,7 |
*/ |
function _connect(&$dsn) |
{ |
$this->log('Auth_Container_DBLite::_connect() called.', AUTH_LOG_DEBUG); |
if (is_string($dsn) || is_array($dsn)) { |
$this->db =& DB::connect($dsn, $this->options['db_options']); |
} elseif (is_subclass_of($dsn, "db_common")) { |
237,6 → 239,7 |
*/ |
function fetchData($username, $password) |
{ |
$this->log('Auth_Container_DBLite::fetchData() called.', AUTH_LOG_DEBUG); |
// Prepare for a database query |
$err = $this->_prepare(); |
if ($err !== true) { |
259,6 → 262,15 |
$query = "SELECT ".$sql_from. |
" FROM ".$this->options['final_table']. |
" WHERE ".$this->options['final_usernamecol']." = ".$this->db->quoteSmart($username); |
// check if there is an optional parameter db_where |
if ($this->options['db_where'] != '') { |
// there is one, so add it to the query |
$query .= " AND ".$this->options['db_where']; |
} |
$this->log('Running SQL against DB: '.$query, AUTH_LOG_DEBUG); |
$res = $this->db->getRow($query, null, DB_FETCHMODE_ASSOC); |
if (DB::isError($res)) { |
277,6 → 289,9 |
$key == $this->options['usernamecol']) { |
continue; |
} |
$this->log('Storing additional field: '.$key, AUTH_LOG_DEBUG); |
// Use reference to the auth object if exists |
// This is because the auth session variable can change so a static call to setAuthData does not make sence |
if (is_object($this->_auth_obj)) { |
/trunk/api/pear/Auth/Container/Array.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: Array.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: Array.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @since File available since Release 1.4.0 |
*/ |
64,7 → 64,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @since File available since Release 1.4.0 |
*/ |
128,6 → 128,7 |
*/ |
function fetchData($user, $pass) |
{ |
$this->log('Auth_Container_Array::fetchData() called.', AUTH_LOG_DEBUG); |
if ( isset($this->users[$user]) |
&& $this->verifyPassword($pass, $this->users[$user], $this->cryptType)) { |
return true; |
145,6 → 146,7 |
*/ |
function listUsers() |
{ |
$this->log('Auth_Container_Array::listUsers() called.', AUTH_LOG_DEBUG); |
$ret = array(); |
foreach ($this->users as $username => $password) { |
$ret[]['username'] = $username; |
/trunk/api/pear/Auth/Container/File.php |
---|
21,7 → 21,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: File.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: File.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
*/ |
52,7 → 52,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
*/ |
class Auth_Container_File extends Auth_Container |
107,6 → 107,7 |
*/ |
function fetchData($user, $pass) |
{ |
$this->log('Auth_Container_File::fetchData() called.', AUTH_LOG_DEBUG); |
return File_Passwd::staticAuth($this->options['type'], $this->pwfile, $user, $pass); |
} |
120,6 → 121,8 |
*/ |
function listUsers() |
{ |
$this->log('Auth_Container_File::listUsers() called.', AUTH_LOG_DEBUG); |
$pw_obj = &$this->_load(); |
if (PEAR::isError($pw_obj)) { |
return array(); |
136,6 → 139,8 |
"cvsuser" => $value['system']); |
} |
$this->log('Found '.count($retVal).' users.', AUTH_LOG_DEBUG); |
return $retVal; |
} |
153,6 → 158,7 |
*/ |
function addUser($user, $pass, $additional='') |
{ |
$this->log('Auth_Container_File::addUser() called.', AUTH_LOG_DEBUG); |
$params = array($user, $pass); |
if (is_array($additional)) { |
foreach ($additional as $item) { |
191,6 → 197,7 |
*/ |
function removeUser($user) |
{ |
$this->log('Auth_Container_File::removeUser() called.', AUTH_LOG_DEBUG); |
$pw_obj = &$this->_load(); |
if (PEAR::isError($pw_obj)) { |
return false; |
220,6 → 227,7 |
*/ |
function changePassword($username, $password) |
{ |
$this->log('Auth_Container_File::changePassword() called.', AUTH_LOG_DEBUG); |
$pw_obj = &$this->_load(); |
if (PEAR::isError($pw_obj)) { |
return false; |
251,6 → 259,7 |
static $pw_obj; |
if (!isset($pw_obj)) { |
$this->log('Instanciating File_Password object of type '.$this->options['type'], AUTH_LOG_DEBUG); |
$pw_obj = File_Passwd::factory($this->options['type']); |
if (PEAR::isError($pw_obj)) { |
return $pw_obj; |
/trunk/api/pear/Auth/Auth.php |
---|
17,7 → 17,7 |
* @author Martin Jansen <mj@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: Auth.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: Auth.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @deprecated File deprecated since Release 1.2.0 |
*/ |
/trunk/api/pear/Auth/Container.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: Container.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: Container.php,v 1.3 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
*/ |
31,7 → 31,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.2 $ |
* @version Release: 1.5.4 File: $Revision: 1.3 $ |
* @link http://pear.php.net/package/Auth |
*/ |
class Auth_Container |
46,6 → 46,13 |
*/ |
var $activeUser = ""; |
/** |
* The Auth object this container is attached to. |
* |
* @access public |
*/ |
var $_auth_obj = null; |
// }}} |
// {{{ Auth_Container() [constructor] |
72,6 → 79,7 |
*/ |
function fetchData($username, $password, $isChallengeResponse=false) |
{ |
$this->log('Auth_Container::fetchData() called.', AUTH_LOG_DEBUG); |
} |
// }}} |
90,6 → 98,7 |
*/ |
function verifyPassword($password1, $password2, $cryptType = "md5") |
{ |
$this->log('Auth_Container::verifyPassword() called.', AUTH_LOG_DEBUG); |
switch ($cryptType) { |
case "crypt" : |
return ((string)crypt($password1, $password2) === (string)$password2); |
146,6 → 155,7 |
*/ |
function listUsers() |
{ |
$this->log('Auth_Container::listUsers() called.', AUTH_LOG_DEBUG); |
return AUTH_METHOD_NOT_SUPPORTED; |
} |
161,6 → 171,7 |
*/ |
function getUser($username) |
{ |
$this->log('Auth_Container::getUser() called.', AUTH_LOG_DEBUG); |
$users = $this->listUsers(); |
if ($users === AUTH_METHOD_NOT_SUPPORTED) { |
return AUTH_METHOD_NOT_SUPPORTED; |
187,6 → 198,7 |
*/ |
function addUser($username, $password, $additional=null) |
{ |
$this->log('Auth_Container::addUser() called.', AUTH_LOG_DEBUG); |
return AUTH_METHOD_NOT_SUPPORTED; |
} |
200,6 → 212,7 |
*/ |
function removeUser($username) |
{ |
$this->log('Auth_Container::removeUser() called.', AUTH_LOG_DEBUG); |
return AUTH_METHOD_NOT_SUPPORTED; |
} |
214,11 → 227,36 |
*/ |
function changePassword($username, $password) |
{ |
$this->log('Auth_Container::changePassword() called.', AUTH_LOG_DEBUG); |
return AUTH_METHOD_NOT_SUPPORTED; |
} |
// }}} |
// {{{ log() |
/** |
* Log a message to the Auth log |
* |
* @param string The message |
* @param int |
* @return boolean |
*/ |
function log($message, $level = AUTH_LOG_DEBUG) { |
if (is_null($this->_auth_obj)) { |
return false; |
} else { |
return $this->_auth_obj->log($message, $level); |
} |
} |
// }}} |
} |
?> |
/trunk/api/pear/Auth/Controller.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: Controller.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: Controller.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.3.0 |
*/ |
54,7 → 54,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.3.0 |
*/ |
/trunk/api/pear/Auth/Anonymous.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: Anonymous.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $ |
* @version CVS: $Id: Anonymous.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.3.0 |
*/ |
40,7 → 40,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.3.0 |
*/ |
/trunk/api/pear/Auth/Frontend/Html.php |
---|
18,7 → 18,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version CVS: $Id: Html.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $ |
* @version CVS: $Id: Html.php,v 1.2 2007-11-19 15:11:00 jp_milcent Exp $ |
* @link http://pear.php.net/package/Auth |
* @since File available since Release 1.3.0 |
*/ |
32,7 → 32,7 |
* @author Adam Ashley <aashley@php.net> |
* @copyright 2001-2006 The PHP Group |
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
* @version Release: 1.4.3 File: $Revision: 1.1 $ |
* @version Release: 1.5.4 File: $Revision: 1.2 $ |
* @link http://pear.php.net/package/Auth |
* @since Class available since Release 1.3.0 |
*/ |