AuthIdcheck.php (mrbs-1.9.4) | : | AuthIdcheck.php (mrbs-1.10.0) | ||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
global $auth; | global $auth; | |||
if ($auth['session'] != 'remote_user') | if ($auth['session'] != 'remote_user') | |||
{ | { | |||
$message = 'MRBS configuration error. If $auth["type"] is set to "idcheck "' . | $message = 'MRBS configuration error. If $auth["type"] is set to "idcheck "' . | |||
' then $auth["session"] must be set to "remote_user"'; | ' then $auth["session"] must be set to "remote_user"'; | |||
die($message); | die($message); | |||
} | } | |||
} | } | |||
public function getUser($username) | /* validateUser($user, $pass) | |||
* | ||||
* Checks if the specified username/password pair are valid | ||||
* | ||||
* $user - The user name | ||||
* $pass - The password | ||||
* | ||||
* Returns: | ||||
* false - The pair are invalid or do not exist | ||||
* string - The validated username | ||||
*/ | ||||
public function validateUser(?string $user, ?string $pass) | ||||
{ | ||||
// Method provided for completeness as it's an abstract method. | ||||
// However it's not used by the 'remote_user' session scheme. | ||||
return $user; | ||||
} | ||||
public function getUser(string $username) : ?User | ||||
{ | { | |||
global $server; | global $server; | |||
$user = new User($username); | $user = new User($username); | |||
$user->level = $this->getDefaultLevel($username); | $user->level = $this->getDefaultLevel($username); | |||
// We only know the details of the currently logged in user | // We only know the details of the currently logged in user | |||
if (isset($username) && isset($server['REMOTE_USER']) && ($username == $serv er['REMOTE_USER'])) | if (isset($username) && isset($server['REMOTE_USER']) && ($username == $serv er['REMOTE_USER'])) | |||
{ | { | |||
$user->display_name = $server['IDCHECK_NAME']; | $user->display_name = $server['IDCHECK_NAME']; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 19 lines changed or added |