cvs: pear /Auth/Container MDB.php MDB2.php

From: Date: Sun, 04 Jul 2004 21:34:07 +0000
Subject: cvs: pear /Auth/Container MDB.php MDB2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-21509@lists.php.net to get a copy of this message
quipo Sun Jul 4 17:34:07 2004 EDT Modified files: /pear/Auth/Container MDB.php MDB2.php Log: sync with DB container http://cvs.php.net/diff.php/pear/Auth/Container/MDB.php?r1=1.18&r2=1.19&ty=u Index: pear/Auth/Container/MDB.php diff -u pear/Auth/Container/MDB.php:1.18 pear/Auth/Container/MDB.php:1.19 --- pear/Auth/Container/MDB.php:1.18 Sun Jul 4 16:59:13 2004 +++ pear/Auth/Container/MDB.php Sun Jul 4 17:34:07 2004 @@ -16,7 +16,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: MDB.php,v 1.18 2004/07/04 20:59:13 quipo Exp $ +// $Id: MDB.php,v 1.19 2004/07/04 21:34:07 quipo Exp $ // require_once 'Auth/Container.php'; @@ -30,7 +30,7 @@ * * @author Lorenzo Alberton <l.alberton@quipo.it> * @package Auth - * @version $Revision: 1.18 $ + * @version $Revision: 1.19 $ */ class Auth_Container_MDB extends Auth_Container { @@ -276,11 +276,7 @@ } // 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 - if (is_object($this->_auth_obj)) { - $this->_auth_obj->setAuthData($key, $value); - } else { - Auth::setAuthData($key, $value); - } + $this->_auth_obj->setAuthData($key, $value); } return true; } @@ -292,9 +288,12 @@ // }}} // {{{ listUsers() - /** - * @return array - */ + /** + * Returns a list of users from the container + * + * @return mixed array|PEAR_Error + * @access public + */ function listUsers() { $err = $this->_prepare(); @@ -450,23 +449,23 @@ // }}} // {{{ supportsChallengeResponse() - /** - * Check if challenge response is supported - * - * @return boolean - */ + /** + * Determine if this container supports + * password authentication with challenge response + * + * @return bool + * @access public + */ function supportsChallengeResponse() { - return ($this->options['cryptType'] == 'md5' || - $this->options['cryptType'] == 'none' || - $this->options['cryptType'] == ''); + return in_array($this->options['cryptType'], array('md5', 'none', '')); } // }}} // {{{ getCryptType() /** - * Get the crypt function name + * Returns the selected crypt type for this container * * @return string Function used to crypt the password */ http://cvs.php.net/diff.php/pear/Auth/Container/MDB2.php?r1=1.4&r2=1.5&ty=u Index: pear/Auth/Container/MDB2.php diff -u pear/Auth/Container/MDB2.php:1.4 pear/Auth/Container/MDB2.php:1.5 --- pear/Auth/Container/MDB2.php:1.4 Sun Jul 4 16:59:13 2004 +++ pear/Auth/Container/MDB2.php Sun Jul 4 17:34:07 2004 @@ -16,7 +16,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.4 2004/07/04 20:59:13 quipo Exp $ +// $Id: MDB2.php,v 1.5 2004/07/04 21:34:07 quipo Exp $ // require_once 'Auth/Container.php'; @@ -30,7 +30,7 @@ * * @author Lorenzo Alberton <l.alberton@quipo.it> * @package Auth - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ class Auth_Container_MDB2 extends Auth_Container { @@ -263,8 +263,8 @@ $res[$this->options['passwordcol']] = md5($res[$this->options['passwordcol']]); } } - if ($this->verifyPassword(trim($password, "\r\n"), - trim($res[$this->options['passwordcol']], "\r\n"), + if ($this->verifyPassword($password, + $res[$this->options['passwordcol']], $this->options['cryptType'])) { // Store additional field values in the session foreach ($res as $key => $value) { @@ -274,13 +274,8 @@ } // 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 - if (isset($this->_auth_obj) && is_object($this->_auth_obj)) { - $this->_auth_obj->setAuthData($key, $value); - } else { - Auth::setAuthData($key, $value); - } + $this->_auth_obj->setAuthData($key, $value); } - return true; } @@ -291,9 +286,12 @@ // }}} // {{{ listUsers() - /** - * @return array - */ + /** + * Returns a list of users from the container + * + * @return mixed array|PEAR_Error + * @access public + */ function listUsers() { $err = $this->_prepare(); @@ -448,23 +446,23 @@ // }}} // {{{ supportsChallengeResponse() - /** - * Check if challenge response is supported - * - * @return boolean - */ + /** + * Determine if this container supports + * password authentication with challenge response + * + * @return bool + * @access public + */ function supportsChallengeResponse() { - return ($this->options['cryptType'] == 'md5' || - $this->options['cryptType'] == 'none' || - $this->options['cryptType'] == ''); + return in_array($this->options['cryptType'], array('md5', 'none', '')); } // }}} // {{{ getCryptType() /** - * Get the crypt function name + * Returns the selected crypt type for this container * * @return string Function used to crypt the password */

« previous php.pear.cvs (#21509) next »