summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2005-12-15 22:06:22 +0000
committerxue <>2005-12-15 22:06:22 +0000
commit1d1e6bc5b41c9a95c4ada79b12aeba149887d92e (patch)
tree227123dcf9a1773bfa32ffbbeeecc1f7538b3906
parentb63e188cecb5d8ccc44d310aaca09ea8270cd797 (diff)
Added support to use the following tag defining a user with some roles,
<user name="xxx" password="xxx" roles="role1,role2" />
-rw-r--r--framework/Security/TUserManager.php10
1 files changed, 9 insertions, 1 deletions
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)