cvs: pear /LiveUser_Admin/Perm Simple.php /LiveUser_Admin/Perm/Storage MDB2.php
| From: | Lukas Smith | Date: | Sun, 12 Dec 2004 21:26:38 +0000 |
| Subject: | cvs: pear /LiveUser_Admin/Perm Simple.php /LiveUser_Admin/Perm/Storage MDB2.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-27261@lists.php.net to get a copy of this message | ||
lsmith Sun Dec 12 16:26:38 2004 EDT
Modified files:
/pear/LiveUser_Admin/Perm/Storage MDB2.php
/pear/LiveUser_Admin/Perm Simple.php
Log:
- moved default for config arrays inside static methods in the client
http://cvs.php.net/diff.php/pear/LiveUser_Admin/Perm/Storage/MDB2.php?r1=1.11&r2=1.12&ty=u Index: pear/LiveUser_Admin/Perm/Storage/MDB2.php diff -u pear/LiveUser_Admin/Perm/Storage/MDB2.php:1.11 pear/LiveUser_Admin/Perm/Storage/MDB2.php:1.12 --- pear/LiveUser_Admin/Perm/Storage/MDB2.php:1.11 Sat Dec 11 16:42:16 2004 +++ pear/LiveUser_Admin/Perm/Storage/MDB2.php Sun Dec 12 16:26:38 2004 @@ -27,6 +27,7 @@ * Require parent class definition. */ require_once 'LiveUser/Admin/Storage/MDB2.php'; +require_once 'LiveUser/Perm/Storage/SQL.php'; /** * This is a PEAR::MDB2 backend driver for the LiveUser class. @@ -43,192 +44,15 @@ * * @author Lukas Smith <smith@backendmedia.com> * @author Bjoern Kraus <krausbn@php.net> - * @version $Id: MDB2.php,v 1.11 2004/12/11 21:42:16 lsmith Exp $ + * @version $Id: MDB2.php,v 1.12 2004/12/12 21:26:38 lsmith Exp $ * @package LiveUser * @category authentication */ class LiveUser_Admin_Perm_Storage_MDB2 extends LiveUser_Admin_Storage_MDB2 { - var $tables = array( - 'perm_users' => array( - 'fields' => array( - 'perm_user_id' => 'seq', - 'auth_user_id' => true, - 'auth_container_name' => true, - 'perm_type' => false, - ), - 'joins' => array( - 'userrights' => 'perm_user_id', - 'groupusers' => 'perm_user_id', - ), - 'id' => 'perm_user_id', - ), - 'userrights' => array( - 'fields' => array( - 'perm_user_id' => true, - 'right_id' => true, - 'right_level' => false, - ), - 'joins' => array( - 'perm_users' => 'perm_user_id', - 'rights' => 'right_id', - ), - ), - 'rights' => array( - 'fields' => array( - 'right_id' => 'seq', - 'area_id' => false, - 'right_define_name' => false, - ), - 'joins' => array( - 'areas' => 'area_id', - 'userrights' => 'right_id', - 'grouprights' => 'right_id', - 'rights_implied' => array( - 'right_id' => 'right_id', - 'right_id' => 'implied_right_id', - ), - 'translations' => array( - 'right_id' => 'section_id', - LIVEUSER_SECTION_RIGHT => 'section_type', - ), - ), - 'id' => 'right_id', - ), - 'rights_implied' => array( - 'fields' => array( - 'right_id' => true, - 'implied_right_id' => true, - ), - 'joins' => array( - 'rights' => array( - 'right_id' => 'right_id', - 'implied_right_id' => 'right_id', - ), - ), - ), - 'translations' => array( - 'fields' => array( - 'section_id' => true, - 'section_type' => true, - 'name' => false, - 'description' => false, - ), - 'joins' => array( - 'rights' => array( - 'section_id' => 'right_id', - 'section_type' => LIVEUSER_SECTION_RIGHT, - ), - 'areas' => array( - 'section_id' => 'area_id', - 'section_type' => LIVEUSER_SECTION_AREA, - ), - 'applications' => array( - 'section_id' => 'application_id', - 'section_type' => LIVEUSER_SECTION_APPLICATION, - ), - 'groups' => array( - 'section_id' => 'group_id', - 'section_type' => LIVEUSER_SECTION_GROUP, - ), - ), - ), - 'areas' => array( - 'fields' => array( - 'area_id' => 'seq', - 'application_id' => false, - 'area_define_name' => false, - ), - 'joins' => array( - 'rights' => 'area_id', - 'applications' => 'application_id', - 'translations' => array( - 'area_id' => 'section_id', - LIVEUSER_SECTION_AREA => 'section_type', - ), - ), - 'id' => 'area_id', - ), - 'applications' => array( - 'fields' => array( - 'application_id' => 'seq', - 'application_define_name' => false, - ), - 'joins' => array( - 'areas' => 'application_id', - 'translations' => array( - 'application_id' => 'section_id', - LIVEUSER_SECTION_APPLICATION => 'section_type', - ), - ), - 'id' => 'application_id', - ), - 'groups' => array( - 'fields' => array( - 'group_id' => 'seq', - 'group_type' => false, - 'group_define_name' => false, - 'is_active' => false, - 'owner_user_id' => false, - 'owner_group_id' => false, - ), - 'joins' => array( - 'groupusers' => 'group_id', - 'grouprights' => 'group_id', - 'translations' => array( - 'group_id' => 'section_id', - LIVEUSER_SECTION_GROUP => 'section_type', - ), - ), - 'id' => 'group_id', - ), - 'groupusers' => array( - 'fields' => array( - 'perm_user_id' => true, - 'group_id' => true, - ), - 'joins' => array( - 'groups' => 'group_id', - 'perm_users' => 'perm_user_id', - ), - ), - 'grouprights' => array( - 'fields' => array( - 'group_id' => true, - 'right_id' => true, - 'right_level' => false, - ), - 'joins' => array( - 'rights' => 'right_id', - 'groups' => 'group_id', - ), - ), - ); + var $tables = array(); - var $fields = array( - 'perm_user_id' => 'integer', - 'auth_user_id' => 'integer', - 'auth_container_name' => 'text', - 'perm_type' => 'integer', - 'right_id' => 'integer', - 'right_level' => 'integer', - 'area_id' => 'integer', - 'application_id' => 'integer', - 'right_define_name' => 'text', - 'area_define_name' => 'text', - 'application_define_name' => 'text', - 'section_id' => 'integer', - 'section_type' => 'integer', - 'name' => 'text', - 'description' => 'text', - 'group_id' => 'integer', - 'group_type' => 'integer', - 'group_define_name' => 'text', - 'is_active' => 'boolean', - 'owner_user_id' => 'integer', - 'owner_group_id' => 'integer', - 'implied_right_id' => 'integer', - ); + var $fields = array(); /** * Constructor @@ -240,6 +64,9 @@ function LiveUser_Admin_Perm_Storage_MDB2(&$confArray, &$storageConf) { $this->LiveUser_Admin_Storage_MDB2($confArray, $storageConf); + + $this->tables = LiveUser::arrayMergeClobber(LiveUser_Perm_Storage_SQL::getTableDefaults(), $this->tables); + $this->fields = LiveUser::arrayMergeClobber(LiveUser_Perm_Storage_SQL::getFieldDefaults(), $this->fields); } } ?> http://cvs.php.net/diff.php/pear/LiveUser_Admin/Perm/Simple.php?r1=1.27&r2=1.28&ty=u Index: pear/LiveUser_Admin/Perm/Simple.php diff -u pear/LiveUser_Admin/Perm/Simple.php:1.27 pear/LiveUser_Admin/Perm/Simple.php:1.28 --- pear/LiveUser_Admin/Perm/Simple.php:1.27 Sat Dec 11 16:43:20 2004 +++ pear/LiveUser_Admin/Perm/Simple.php Sun Dec 12 16:26:38 2004 @@ -23,6 +23,8 @@ * @category authentication */ +require_once 'LiveUser/Perm/Simple.php'; + /** * This class provides a set of functions for implementing a user * permission management system on live websites. All authorisation @@ -30,36 +32,13 @@ * * @author Markus Wolff <wolff@21st.de> * @author Bjoern Kraus <krausbn@php.net> - * @version $Id: Simple.php,v 1.27 2004/12/11 21:43:20 lsmith Exp $ + * @version $Id: Simple.php,v 1.28 2004/12/12 21:26:38 lsmith Exp $ * @package LiveUser * @category authentication */ class LiveUser_Admin_Perm_Simple { - var $alias = array( - 'perm_user_id' => null, - 'auth_user_id' => null, - 'auth_container_name' => null, - 'perm_type' => null, - 'right_id' => null, - 'right_level' => null, - 'area_id' => null, - 'application_id' => null, - 'right_define_name' => null, - 'area_define_name' => null, - 'application_define_name' => null, - 'section_id' => null, - 'section_type' => null, - 'name' => null, - 'description' => null, - 'group_id' => null, - 'group_type' => null, - 'group_define_name' => null, - 'is_active' => null, - 'owner_user_id' => null, - 'owner_group_id' => null, - 'implied_right_id' => null, - ); + var $alias = array(); /** * Class constructor. Feel free to override in backend subclasses. @@ -79,6 +58,7 @@ } } } + $this->alias = LiveUser::arrayMergeClobber(LiveUser_Perm_Simple::getAliasDefaults(), $this->alias); } /**
http://cvs.php.net/diff.php/pear/LiveUser_Admin/Perm/Storage/MDB2.php?r1=1.11&r2=1.12&ty=u Index: pear/LiveUser_Admin/Perm/Storage/MDB2.php diff -u pear/LiveUser_Admin/Perm/Storage/MDB2.php:1.11 pear/LiveUser_Admin/Perm/Storage/MDB2.php:1.12 --- pear/LiveUser_Admin/Perm/Storage/MDB2.php:1.11 Sat Dec 11 16:42:16 2004 +++ pear/LiveUser_Admin/Perm/Storage/MDB2.php Sun Dec 12 16:26:38 2004 @@ -27,6 +27,7 @@ * Require parent class definition. */ require_once 'LiveUser/Admin/Storage/MDB2.php'; +require_once 'LiveUser/Perm/Storage/SQL.php'; /** * This is a PEAR::MDB2 backend driver for the LiveUser class. @@ -43,192 +44,15 @@ * * @author Lukas Smith <smith@backendmedia.com> * @author Bjoern Kraus <krausbn@php.net> - * @version $Id: MDB2.php,v 1.11 2004/12/11 21:42:16 lsmith Exp $ + * @version $Id: MDB2.php,v 1.12 2004/12/12 21:26:38 lsmith Exp $ * @package LiveUser * @category authentication */ class LiveUser_Admin_Perm_Storage_MDB2 extends LiveUser_Admin_Storage_MDB2 { - var $tables = array( - 'perm_users' => array( - 'fields' => array( - 'perm_user_id' => 'seq', - 'auth_user_id' => true, - 'auth_container_name' => true, - 'perm_type' => false, - ), - 'joins' => array( - 'userrights' => 'perm_user_id', - 'groupusers' => 'perm_user_id', - ), - 'id' => 'perm_user_id', - ), - 'userrights' => array( - 'fields' => array( - 'perm_user_id' => true, - 'right_id' => true, - 'right_level' => false, - ), - 'joins' => array( - 'perm_users' => 'perm_user_id', - 'rights' => 'right_id', - ), - ), - 'rights' => array( - 'fields' => array( - 'right_id' => 'seq', - 'area_id' => false, - 'right_define_name' => false, - ), - 'joins' => array( - 'areas' => 'area_id', - 'userrights' => 'right_id', - 'grouprights' => 'right_id', - 'rights_implied' => array( - 'right_id' => 'right_id', - 'right_id' => 'implied_right_id', - ), - 'translations' => array( - 'right_id' => 'section_id', - LIVEUSER_SECTION_RIGHT => 'section_type', - ), - ), - 'id' => 'right_id', - ), - 'rights_implied' => array( - 'fields' => array( - 'right_id' => true, - 'implied_right_id' => true, - ), - 'joins' => array( - 'rights' => array( - 'right_id' => 'right_id', - 'implied_right_id' => 'right_id', - ), - ), - ), - 'translations' => array( - 'fields' => array( - 'section_id' => true, - 'section_type' => true, - 'name' => false, - 'description' => false, - ), - 'joins' => array( - 'rights' => array( - 'section_id' => 'right_id', - 'section_type' => LIVEUSER_SECTION_RIGHT, - ), - 'areas' => array( - 'section_id' => 'area_id', - 'section_type' => LIVEUSER_SECTION_AREA, - ), - 'applications' => array( - 'section_id' => 'application_id', - 'section_type' => LIVEUSER_SECTION_APPLICATION, - ), - 'groups' => array( - 'section_id' => 'group_id', - 'section_type' => LIVEUSER_SECTION_GROUP, - ), - ), - ), - 'areas' => array( - 'fields' => array( - 'area_id' => 'seq', - 'application_id' => false, - 'area_define_name' => false, - ), - 'joins' => array( - 'rights' => 'area_id', - 'applications' => 'application_id', - 'translations' => array( - 'area_id' => 'section_id', - LIVEUSER_SECTION_AREA => 'section_type', - ), - ), - 'id' => 'area_id', - ), - 'applications' => array( - 'fields' => array( - 'application_id' => 'seq', - 'application_define_name' => false, - ), - 'joins' => array( - 'areas' => 'application_id', - 'translations' => array( - 'application_id' => 'section_id', - LIVEUSER_SECTION_APPLICATION => 'section_type', - ), - ), - 'id' => 'application_id', - ), - 'groups' => array( - 'fields' => array( - 'group_id' => 'seq', - 'group_type' => false, - 'group_define_name' => false, - 'is_active' => false, - 'owner_user_id' => false, - 'owner_group_id' => false, - ), - 'joins' => array( - 'groupusers' => 'group_id', - 'grouprights' => 'group_id', - 'translations' => array( - 'group_id' => 'section_id', - LIVEUSER_SECTION_GROUP => 'section_type', - ), - ), - 'id' => 'group_id', - ), - 'groupusers' => array( - 'fields' => array( - 'perm_user_id' => true, - 'group_id' => true, - ), - 'joins' => array( - 'groups' => 'group_id', - 'perm_users' => 'perm_user_id', - ), - ), - 'grouprights' => array( - 'fields' => array( - 'group_id' => true, - 'right_id' => true, - 'right_level' => false, - ), - 'joins' => array( - 'rights' => 'right_id', - 'groups' => 'group_id', - ), - ), - ); + var $tables = array(); - var $fields = array( - 'perm_user_id' => 'integer', - 'auth_user_id' => 'integer', - 'auth_container_name' => 'text', - 'perm_type' => 'integer', - 'right_id' => 'integer', - 'right_level' => 'integer', - 'area_id' => 'integer', - 'application_id' => 'integer', - 'right_define_name' => 'text', - 'area_define_name' => 'text', - 'application_define_name' => 'text', - 'section_id' => 'integer', - 'section_type' => 'integer', - 'name' => 'text', - 'description' => 'text', - 'group_id' => 'integer', - 'group_type' => 'integer', - 'group_define_name' => 'text', - 'is_active' => 'boolean', - 'owner_user_id' => 'integer', - 'owner_group_id' => 'integer', - 'implied_right_id' => 'integer', - ); + var $fields = array(); /** * Constructor @@ -240,6 +64,9 @@ function LiveUser_Admin_Perm_Storage_MDB2(&$confArray, &$storageConf) { $this->LiveUser_Admin_Storage_MDB2($confArray, $storageConf); + + $this->tables = LiveUser::arrayMergeClobber(LiveUser_Perm_Storage_SQL::getTableDefaults(), $this->tables); + $this->fields = LiveUser::arrayMergeClobber(LiveUser_Perm_Storage_SQL::getFieldDefaults(), $this->fields); } } ?> http://cvs.php.net/diff.php/pear/LiveUser_Admin/Perm/Simple.php?r1=1.27&r2=1.28&ty=u Index: pear/LiveUser_Admin/Perm/Simple.php diff -u pear/LiveUser_Admin/Perm/Simple.php:1.27 pear/LiveUser_Admin/Perm/Simple.php:1.28 --- pear/LiveUser_Admin/Perm/Simple.php:1.27 Sat Dec 11 16:43:20 2004 +++ pear/LiveUser_Admin/Perm/Simple.php Sun Dec 12 16:26:38 2004 @@ -23,6 +23,8 @@ * @category authentication */ +require_once 'LiveUser/Perm/Simple.php'; + /** * This class provides a set of functions for implementing a user * permission management system on live websites. All authorisation @@ -30,36 +32,13 @@ * * @author Markus Wolff <wolff@21st.de> * @author Bjoern Kraus <krausbn@php.net> - * @version $Id: Simple.php,v 1.27 2004/12/11 21:43:20 lsmith Exp $ + * @version $Id: Simple.php,v 1.28 2004/12/12 21:26:38 lsmith Exp $ * @package LiveUser * @category authentication */ class LiveUser_Admin_Perm_Simple { - var $alias = array( - 'perm_user_id' => null, - 'auth_user_id' => null, - 'auth_container_name' => null, - 'perm_type' => null, - 'right_id' => null, - 'right_level' => null, - 'area_id' => null, - 'application_id' => null, - 'right_define_name' => null, - 'area_define_name' => null, - 'application_define_name' => null, - 'section_id' => null, - 'section_type' => null, - 'name' => null, - 'description' => null, - 'group_id' => null, - 'group_type' => null, - 'group_define_name' => null, - 'is_active' => null, - 'owner_user_id' => null, - 'owner_group_id' => null, - 'implied_right_id' => null, - ); + var $alias = array(); /** * Class constructor. Feel free to override in backend subclasses. @@ -79,6 +58,7 @@ } } } + $this->alias = LiveUser::arrayMergeClobber(LiveUser_Perm_Simple::getAliasDefaults(), $this->alias); } /**