19 require_once(BASE.
"wcmf/lib/security/class.AuthUser.php");
20 require_once(BASE.
"wcmf/lib/security/class.UserManager.php");
21 require_once(BASE.
"wcmf/lib/util/class.XMLUtil.php");
64 $old_error_handler = set_error_handler(
"XMLUtilErrorHandler");
71 $aDbPermissions = array(
72 'GetNodeData' => XMLDB_PERMISSION_ENABLE,
73 'GetChildData' => XMLDB_PERMISSION_ENABLE
76 $xml->bSecureMode = TRUE;
77 foreach ($aDbPermissions as $MethodName => $Permission)
78 $xml->aPermissions[$MethodName] = $Permission;
81 if (!$xml->Open($this->_initParams[
'filename'], FALSE, FALSE))
85 $userQuery =
"*/users/user[child::login[.='".$login.
"']][child::password[.='".$password.
"']]";
86 $userPathArray = $xml->XmlDb->evaluate($userQuery);
87 $userPath = $userPathArray[0];
92 $userData[
'id'] = $xml->XmlDb->getAttributes($userPath,
'id');
93 $userData[
'name'] = $xml->XmlDb->getData($userPath.
"/name");
94 $userData[
'firstname'] = $xml->XmlDb->getData($userPath.
"/firstname");
95 $userData[
'config'] = $xml->XmlDb->getData($userPath.
"/config");
98 $userData[
'roles'] = array();
99 $userRolesPathArray = $xml->XmlDb->evaluate($userPath.
'/userroles/roleid');
100 foreach ($userRolesPathArray as $userRolePath)
102 $roleId = $xml->XmlDb->getData($userRolePath);
103 $rolePathArray = $xml->XmlDb->evaluate(
'*/roles/role[@id="'.$roleId.
'"]/name');
104 array_push($userData[
'roles'], $xml->XmlDb->getData($rolePathArray[0]));
108 set_error_handler($old_error_handler);
AuthUser provides a storage and methods for user data used for authentication/authorization purposes...
throwEx($message, $file='', $line='')
XMLUtil helps in using XML files as storage. XMLUtil is a subclass of CXmlDb that is customized for u...
getUserData($login, $password)
AuthUser that gets configuration from an XML file.