mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
parent
5d31633eb5
commit
263f09a94c
@ -96,6 +96,13 @@ class DbUserBackend implements UserBackend
|
|||||||
*/
|
*/
|
||||||
private $userColumnName = 'username';
|
private $userColumnName = 'username';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Column name of email
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $emailColumnName = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the backend
|
* Name of the backend
|
||||||
*
|
*
|
||||||
@ -182,6 +189,18 @@ class DbUserBackend implements UserBackend
|
|||||||
$this->activeColumnName = $activeColumnName;
|
$this->activeColumnName = $activeColumnName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter for email column
|
||||||
|
*
|
||||||
|
* Set to null if not needed
|
||||||
|
*
|
||||||
|
* @param string $emailColumnName
|
||||||
|
*/
|
||||||
|
public function setEmailColumnName($emailColumnName)
|
||||||
|
{
|
||||||
|
$this->emailColumnName = $emailColumnName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the backend
|
* Name of the backend
|
||||||
*
|
*
|
||||||
@ -312,10 +331,13 @@ class DbUserBackend implements UserBackend
|
|||||||
*
|
*
|
||||||
* @return User The created instance of User.
|
* @return User The created instance of User.
|
||||||
*/
|
*/
|
||||||
private function createUserFromResult(stdClass $resultRow)
|
protected function createUserFromResult(stdClass $resultRow)
|
||||||
{
|
{
|
||||||
$usr = new User(
|
$usr = new User(
|
||||||
$resultRow->{$this->userColumnName}
|
$resultRow->{$this->userColumnName},
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
(isset($resultRow->{$this->emailColumnName})) ? $resultRow->{$this->emailColumnName} : null
|
||||||
);
|
);
|
||||||
return $usr;
|
return $usr;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user