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.InifileParser.php");
22 require_once(BASE.
"wcmf/3rdparty/adodb/adodb.inc.php");
72 $conn = &ADONewConnection($this->_initParams[
'dbType']);
73 $connected = $conn->PConnect($this->_initParams[
'dbHostName'],$this->_initParams[
'dbUserName'],$this->_initParams[
'dbPassword'],$this->_initParams[
'dbName']);
77 $conn->replaceQuote =
"\'";
78 $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
79 define(ADODB_OUTP,
"gError");
82 $this->_dbPrefix = $params[
'dbPrefix'];
86 if (($logSQL = $parser->getValue(
'logSQL',
'cms')) ===
false)
88 $conn->LogSQL($logSQL);
91 $sqlStr =
"SELECT ".$dbPrefix.
"user.id, ".$dbPrefix.
"user.name, ".$dbPrefix.
"user.firstname, ".$dbPrefix.
"user.config, ".$dbPrefix.
"role.name as rolename
92 FROM ".$dbPrefix.
"user LEFT JOIN ".$dbPrefix.
"nm_user_role ON ".$dbPrefix.
"user.id=".$dbPrefix.
"nm_user_role.fk_user_id LEFT JOIN ".$dbPrefix.
"role
93 ON ".$dbPrefix.
"nm_user_role.fk_role_id=".$dbPrefix.
"role.id
94 WHERE ".$dbPrefix.
"user.login='".$login.
"' AND ".$dbPrefix.
"user.password='".$password.
"';";
95 $rs = &$conn->Execute($sqlStr);
97 while ($rs && $row = $rs->FetchRow())
101 $userData[
'id'] = $row[
'id'];
102 $userData[
'name'] = $row[
'name'];
103 $userData[
'firstname'] = $row[
'firstname'];
104 $userData[
'config'] = $row[
'config'];
105 $userData[
'roles'] = array();
108 array_push($userData[
'roles'], $row[
'rolename']);
AuthUser provides a storage and methods for user data used for authentication/authorization purposes...
getUserData($login, $password)
throwEx($message, $file='', $line='')
AuthUser that gets configuration from an database.