Fix email address for OwnCloud

This commit is contained in:
Patrick Valsecchi
2017-12-19 14:24:06 +01:00
parent 066fe4ff91
commit f6d6ebbb70
2 changed files with 95 additions and 1 deletions

View File

@@ -31,7 +31,13 @@ namespace OCA\user_sql;
use \OCA\user_sql\lib\Helper;
class OC_USER_SQL extends \OC_User_Backend implements \OCP\IUserBackend, \OCP\UserInterface
if(!interface_exists('OCP\\User\\IProvidesEMailBackend'))
{
// hack for nextcloud
eval("namespace OCP\User; interface IProvidesEMailBackend {}");
}
class OC_USER_SQL extends \OC_User_Backend implements \OCP\IUserBackend, \OCP\UserInterface, \OCP\User\IProvidesEMailBackend
{
protected $cache;
protected $settings;
@@ -116,6 +122,15 @@ class OC_USER_SQL extends \OC_User_Backend implements \OCP\IUserBackend, \OCP\Us
return true;
}
/**
* Only used by OwnCloud to get the email address
*/
public function getEMailAddress($uid) {
$this->doEmailSync($uid);
$email = $this->ocConfig->getUserValue($uid, 'settings', 'email', '');
return $email;
}
/**
* This maps the username to the specified domain name.
* It can only append a default domain name.