Compare commits
2 commits
a4d2e3369c
...
3d9decdafd
Author | SHA1 | Date | |
---|---|---|---|
3d9decdafd | |||
33fcd6a92c |
3 changed files with 12 additions and 2 deletions
|
@ -235,7 +235,7 @@ class Ldap extends Backend {
|
|||
);
|
||||
}
|
||||
Log::debug('User "%s" found in LDAP directory (%s):\n%s', $username, $dn, vardump($info));
|
||||
return new User($username, '\\EesyPHP\\Auth\\LDAP', $info);
|
||||
return new User($username, '\\EesyPHP\\Auth\\Ldap', $info);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -83,4 +83,14 @@ class User {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic method to allow pretty cast to string
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() {
|
||||
if (isset($this -> name))
|
||||
return sprintf('%s (%s)', $this -> name, $this -> username);
|
||||
return $this -> namename;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ class Log {
|
|||
$_SERVER['REMOTE_ADDR'],
|
||||
);
|
||||
if (Auth::enabled())
|
||||
$msg[] = (Auth::user()?Auth::user()->username:'anonymous');
|
||||
$msg[] = (Auth::user()?Auth::user():'anonymous');
|
||||
$msg[] = $level;
|
||||
$msg[] = $message;
|
||||
$msg = implode(' - ', $msg)."\n";
|
||||
|
|
Loading…
Reference in a new issue