Lines Matching refs:user

26  protected $checkPass = "SELECT pass FROM %{drupalPrefix}users_field_data WHERE name='%{user}'";
27 protected $getUserInfo = "SELECT name, mail FROM %{drupalPrefix}users_field_data WHERE name='%{user}'";
28 protected $getGroups = "SELECT roles_target_id FROM %{drupalPrefix}user__roles userroles INNER JOIN %{drupalPrefix}users_field_data userdata ON userroles.entity_id = userdata.uid WHERE userdata.name = '%{user}'";
57 $this->cando['logout'] = true; // can the user logout again? (eg. not possible with HTTP auth)
64 * Checks if the given user exists and the given plaintext password
65 * is correct. Furtheron it might be checked wether the user is
68 * @param string $user user who would like access
69 * @param string $pass user's clear text password to check
76 public function checkPass($user, $pass) {
80 $sql = str_replace('%{user}', $this->_escape($user), $this->checkPass);
94 * @param string $pass user's clear text password to hash
95 * @param string $hashedpw user's pre-hashed password from the database
111 * Return user info
116 * @param string $user user login to get data for
121 public function getUserData($user, $requireGroups=true) {
122 if($this->_cacheExists($user, $requireGroups)) {
123 return $this->cacheUserInfo[$user];
127 $info = $this->_getUserInfo($user, $requireGroups);
137 * Get a user's information
143 * @param string $user username of the user whose information is being reterieved
147 * @return mixed false|array false if the user doesn't exist
148 * array containing user information if user does exist
150 protected function _getUserInfo($user, $requireGroups=true, $useCache=true) {
152 if ($useCache && isset($this->cacheUserInfo[$user])) {
153 $info = $this->cacheUserInfo[$user];
156 $info = $this->_retrieveUserInfo($user);
159 $info['grps'] = $this->_getGroups($user);
162 $this->cacheUserInfo[$user] = $info;
170 * Gets the data for a specific user. The database connection
177 * @param string $user user's nick to get data for
178 * @return false|array false on error, user info on success
180 protected function _retrieveUserInfo($user) {
181 $sql = str_replace('%{user}', $this->_escape($user), $this->getUserInfo);
192 * Retrieves a list of groups the user is a member off.
201 * @param string $user user whose groups should be listed
204 protected function _getGroups($user) {
207 $sql = str_replace('%{user}', $this->_escape($user), $this->getGroups);
268 * DokuWiki caches user info in the user's session for the timespan defined
272 * This also means that changes to the user database will not be reflected
275 * To accommodate for this, the user manager plugin will touch a reference
280 * the backend's database through other means than the user manager plugin.
286 * @param string $user - The username
289 //public function useSessionCache($user) {
441 * must be locked. For eg. you use a table 'user' and the alias 'u' in
443 * array("user", "user AS u");
489 * Flush cached user information
493 * @param string $user username of the user whose data is to be removed from the cache
496 protected function _flushUserInfoCache($user=null) {
497 if (is_null($user)) {
500 unset($this->cacheUserInfo[$user]);
505 * Quick lookup to see if a user's information has been cached
511 * @param string $user username to be looked up in the cache
514 * @return bool existence of required user information in the cache
516 protected function _cacheExists($user, $requireGroups=true) {
517 if (isset($this->cacheUserInfo[$user])) {
518 if (!is_array($this->cacheUserInfo[$user])) {
519 return true; // user doesn't exist
521 if (!$requireGroups || isset($this->cacheUserInfo[$user]['grps'])) {