Merge branch 'master' of github.com:UncleAlbie/user_sql

This commit is contained in:
Patrik Novotný
2017-12-21 12:41:07 +01:00
8 changed files with 182 additions and 12 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.
@@ -406,7 +421,7 @@ class OC_USER_SQL extends \OC_User_Backend implements \OCP\IUserBackend, \OCP\Us
}
else
{
$search = "%".$this -> doUserDomainMapping("")."%";
$search = "%".$this -> doUserDomainMapping("")."%";
}
$rows = $this -> helper -> runQuery('getUsers', array('search' => $search), false, true, array('limit' => $limit, 'offset' => $offset));