use system email address getter if available

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2021-09-01 15:15:29 +02:00
parent 10b3e3a30e
commit 59bf8dc6fb
No known key found for this signature in database
GPG key ID: 7424F1874854DF23

View file

@ -637,7 +637,7 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
}
if ($user !== null) {
$currentEmail = (string)$user->getEMailAddress();
$currentEmail = (string)(method_exists($user, 'getSystemEMailAddress') ? $user->getSystemEMailAddress() : $user->getEMailAddress());
if ($newEmail !== null
&& $currentEmail !== $newEmail) {
$user->setEMailAddress($newEmail);