cvs: pear /LiveUser_Admin/Auth Common.php /LiveUser_Admin/Perm Simple.php
| From: | Lukas Smith | Date: | Tue, 11 Apr 2006 17:31:43 +0000 |
| Subject: | cvs: pear /LiveUser_Admin/Auth Common.php /LiveUser_Admin/Perm Simple.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-39554@lists.php.net to get a copy of this message | ||
lsmith Tue Apr 11 17:31:43 2006 UTC
Modified files:
/pear/LiveUser_Admin/Auth Common.php
/pear/LiveUser_Admin/Perm Simple.php
Log:
- added selectable_tables property to auth backend
http://cvs.php.net/viewcvs.cgi/pear/LiveUser_Admin/Auth/Common.php?r1=1.30&r2=1.31&diff_format=u
Index: pear/LiveUser_Admin/Auth/Common.php
diff -u pear/LiveUser_Admin/Auth/Common.php:1.30 pear/LiveUser_Admin/Auth/Common.php:1.31
--- pear/LiveUser_Admin/Auth/Common.php:1.30 Tue Apr 11 17:27:39 2006
+++ pear/LiveUser_Admin/Auth/Common.php Tue Apr 11 17:31:42 2006
@@ -57,7 +57,7 @@
* @author Bjoern Kraus <krausbn@php.net>
* @copyright 2002-2006 Markus Wolff
* @license http://www.gnu.org/licenses/lgpl.txt
- * @version CVS: $Id: Common.php,v 1.30 2006/04/11 17:27:39 lsmith Exp $
+ * @version CVS: $Id: Common.php,v 1.31 2006/04/11 17:31:42 lsmith Exp $
* @link http://pear.php.net/LiveUser_Admin
*/
@@ -91,6 +91,16 @@
var $_storage = null;
/**
+ * Key (method names), with array lists of selectable tables for the given method
+ *
+ * @var array
+ * @access public
+ */
+ var $selectable_tables = array(
+ 'getUsers' => array('users'),
+ );
+
+ /**
* Set posible encryption modes.
*
* @access private
@@ -340,13 +350,11 @@
*/
function getUsers($params = array())
{
- if (array_key_exists('selectable_tables', $params)
- && !empty($params['selectable_tables'])
- && is_array($params['selectable_tables'])
- ) {
+ $selectable_tables = array();
+ if (array_key_exists('selectable_tables', $params)) {
$selectable_tables = $params['selectable_tables'];
- } else {
- $selectable_tables = array('users');
+ } elseif (array_key_exists('getUsers', $this->selectable_tables)) {
+ $selectable_tables = $this->selectable_tables[$method];
}
$root_table = reset($selectable_tables);
http://cvs.php.net/viewcvs.cgi/pear/LiveUser_Admin/Perm/Simple.php?r1=1.83&r2=1.84&diff_format=u
Index: pear/LiveUser_Admin/Perm/Simple.php
diff -u pear/LiveUser_Admin/Perm/Simple.php:1.83 pear/LiveUser_Admin/Perm/Simple.php:1.84
--- pear/LiveUser_Admin/Perm/Simple.php:1.83 Tue Apr 11 17:27:39 2006
+++ pear/LiveUser_Admin/Perm/Simple.php Tue Apr 11 17:31:43 2006
@@ -57,7 +57,7 @@
* @author Bjoern Kraus <krausbn@php.net>
* @copyright 2002-2006 Markus Wolff
* @license http://www.gnu.org/licenses/lgpl.txt
- * @version CVS: $Id: Simple.php,v 1.83 2006/04/11 17:27:39 lsmith Exp $
+ * @version CVS: $Id: Simple.php,v 1.84 2006/04/11 17:31:43 lsmith Exp $
* @link http://pear.php.net/LiveUser_Admin
*/
@@ -636,10 +636,7 @@
function _findSelectableTables($method, $params = array())
{
$selectable_tables = array();
- if (array_key_exists('selectable_tables', $params)
- && !empty($params['selectable_tables'])
- && is_array($params['selectable_tables'])
- ) {
+ if (array_key_exists('selectable_tables', $params)) {
$selectable_tables = $params['selectable_tables'];
} elseif (array_key_exists($method, $this->selectable_tables)) {
$selectable_tables = $this->selectable_tables[$method];