From 1d1e6bc5b41c9a95c4ada79b12aeba149887d92e Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 15 Dec 2005 22:06:22 +0000 Subject: Added support to use the following tag defining a user with some roles, --- framework/Security/TUserManager.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'framework/Security') diff --git a/framework/Security/TUserManager.php b/framework/Security/TUserManager.php index a6d3b8de..8faa7f96 100644 --- a/framework/Security/TUserManager.php +++ b/framework/Security/TUserManager.php @@ -254,7 +254,15 @@ class TUserManager extends TModule private function loadUserData($xmlNode) { foreach($xmlNode->getElementsByTagName('user') as $node) - $this->_users[strtolower($node->getAttribute('name'))]=$node->getAttribute('password'); + { + $name=strtolower($node->getAttribute('name')); + $this->_users[$name]=$node->getAttribute('password'); + if(($roles=trim($node->getAttribute('roles')))!=='') + { + foreach(explode(',',$roles) as $role) + $this->_roles[$name][]=$role; + } + } foreach($xmlNode->getElementsByTagName('role') as $node) { foreach(explode(',',$node->getAttribute('users')) as $user) -- cgit v1.2.3