aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/User/Database.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/User/Database.php')
-rw-r--r--lib/private/User/Database.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php
index e2cbebab2e4..eba7beffeae 100644
--- a/lib/private/User/Database.php
+++ b/lib/private/User/Database.php
@@ -53,19 +53,25 @@
namespace OC\User;
use OC\Cache\CappedMemoryCache;
+use OCP\IUserBackend;
+use OCP\Util;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\GenericEvent;
/**
* Class for user management in a SQL Database (e.g. MySQL, SQLite)
*/
-class Database extends \OC\User\Backend implements \OCP\IUserBackend {
+class Database extends Backend implements IUserBackend {
/** @var CappedMemoryCache */
private $cache;
+
/** @var EventDispatcher */
private $eventDispatcher;
+
/**
- * OC_User_Database constructor.
+ * \OC\User\Database constructor.
+ *
+ * @param EventDispatcher $eventDispatcher
*/
public function __construct($eventDispatcher = null) {
$this->cache = new CappedMemoryCache();
@@ -233,7 +239,7 @@ class Database extends \OC\User\Backend implements \OCP\IUserBackend {
$result = $query->execute(array($uid));
if ($result === false) {
- \OCP\Util::writeLog('core', \OC_DB::getErrorMessage(), \OCP\Util::ERROR);
+ Util::writeLog('core', \OC_DB::getErrorMessage(), Util::ERROR);
return false;
}
@@ -310,7 +316,7 @@ class Database extends \OC\User\Backend implements \OCP\IUserBackend {
$query = \OC_DB::prepare('SELECT COUNT(*) FROM `*PREFIX*users`');
$result = $query->execute();
if ($result === false) {
- \OCP\Util::writeLog('core', \OC_DB::getErrorMessage(), \OCP\Util::ERROR);
+ Util::writeLog('core', \OC_DB::getErrorMessage(), Util::ERROR);
return false;
}
return $result->fetchOne();
@@ -345,7 +351,7 @@ class Database extends \OC\User\Backend implements \OCP\IUserBackend {
$backends = \OC::$server->getUserManager()->getBackends();
foreach ($backends as $backend) {
- if ($backend instanceof \OC\User\Database) {
+ if ($backend instanceof Database) {
/** @var \OC\User\Database $backend */
$uid = $backend->loginName2UserName($param['uid']);
if ($uid !== false) {