1
1
Fork
You've already forked AuthRemoteUser
1

Enhance getUserData function #6

Closed
opened 2022年04月22日 14:59:08 +02:00 by JeffersonElias · 1 comment

Hi, here is a proposal for getting back additional information from SSO:

There should be parameters to set value for HTTP_ variables like it's done for REMOTE_USER.

public function getUserData($user, $requireGroups=true) {
 if($this->users === null) $this->_loadUserData();
 
 $p_name = '';
 $p_mail = '';
 if ($_SERVER['HTTP_X_REMOTE_USER'] === $user) {
 
 $p_name = $_SERVER["HTTP_X_REMOTE_GIVENNAME"].' '.$_SERVER["HTTP_X_REMOTE_SN"];
 $p_mail = strtolower($_SERVER["HTTP_X_REMOTE_MAIL"]);
 }
 
 if (isset($this->users[$user])) {
 
 //$p_name = $this->users[$user]['name'];
 //$p_mail = strtolower($this->users[$user]['mail']);
 
 if ( strcmp($p_name,$this->users[$user]['name']) !== 0 || strcmp($p_mail,$this->users[$user]['mail']) !== 0) {
 
 $this->users[$user]['name'] = $p_name;
 $this->users[$user]['mail'] = $p_mail;
 
 $p_changes = array(
 'pass' => strtolower($user),
 'name' => $p_name,
 'mail' => $p_mail,
 'grps' => $this->users[$user]['grps']
 );
 $this->modifyUser($user,$p_changes);
 }
 
 return $this->users[$user];
 }
 
 
 return false;
 }
Hi, here is a proposal for getting back additional information from SSO: There should be parameters to set value for HTTP_ variables like it's done for REMOTE_USER. ``` public function getUserData($user, $requireGroups=true) { if($this->users === null) $this->_loadUserData(); $p_name = ''; $p_mail = ''; if ($_SERVER['HTTP_X_REMOTE_USER'] === $user) { $p_name = $_SERVER["HTTP_X_REMOTE_GIVENNAME"].' '.$_SERVER["HTTP_X_REMOTE_SN"]; $p_mail = strtolower($_SERVER["HTTP_X_REMOTE_MAIL"]); } if (isset($this->users[$user])) { //$p_name = $this->users[$user]['name']; //$p_mail = strtolower($this->users[$user]['mail']); if ( strcmp($p_name,$this->users[$user]['name']) !== 0 || strcmp($p_mail,$this->users[$user]['mail']) !== 0) { $this->users[$user]['name'] = $p_name; $this->users[$user]['mail'] = $p_mail; $p_changes = array( 'pass' => strtolower($user), 'name' => $p_name, 'mail' => $p_mail, 'grps' => $this->users[$user]['grps'] ); $this->modifyUser($user,$p_changes); } return $this->users[$user]; } return false; } ```

This is not the intention of this plugin: Users and all of their information are only administered via DokuWiki's configuration (conf/users.auth.php). If REMOTE_USER matches any user in this file, access is granted.

This is not the intention of this plugin: Users and all of their information are **only** administered via _DokuWiki_'s configuration (`conf/users.auth.php`). If `REMOTE_USER` matches any user in this file, access is granted.
Sign in to join this conversation.
No Branch/Tag specified
master
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Charly/AuthRemoteUser#6
Reference in a new issue
Charly/AuthRemoteUser
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?