diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/l10n/cs_CZ.js | 10 | ||||
-rw-r--r-- | lib/l10n/cs_CZ.json | 10 | ||||
-rw-r--r-- | lib/l10n/de.js | 4 | ||||
-rw-r--r-- | lib/l10n/de.json | 4 | ||||
-rw-r--r-- | lib/l10n/de_DE.js | 3 | ||||
-rw-r--r-- | lib/l10n/de_DE.json | 3 | ||||
-rw-r--r-- | lib/private/User/Backend.php | 4 | ||||
-rw-r--r-- | lib/private/User/Database.php | 16 | ||||
-rw-r--r-- | lib/private/User/Manager.php | 6 | ||||
-rw-r--r-- | lib/private/User/Session.php | 8 | ||||
-rw-r--r-- | lib/private/User/User.php | 26 |
11 files changed, 62 insertions, 32 deletions
diff --git a/lib/l10n/cs_CZ.js b/lib/l10n/cs_CZ.js index 2a5faddedaf..39de37b4e94 100644 --- a/lib/l10n/cs_CZ.js +++ b/lib/l10n/cs_CZ.js @@ -168,6 +168,14 @@ OC.L10N.register( "Storage incomplete configuration. %s" : "Nekompletní konfigurace úložiště. %s", "Storage connection error. %s" : "Chyba připojení úložiště. %s", "Storage not available" : "Úložiště není dostupné", - "Storage connection timeout. %s" : "Vypršení připojení k úložišti. %s" + "Storage connection timeout. %s" : "Vypršení připojení k úložišti. %s", + "ownCloud %s or higher is required." : "Vyžadován ownCloud %s nebo vyšší.", + "ownCloud %s or lower is required." : "Vyžadován ownCloud %s nebo nižší.", + "App \"%s\" cannot be installed because it is not compatible with this version of Nextcloud." : "Aplikaci \"%s\" nelze nainstalovat, protože není kompatibilní s touto verzí Nextcloud.", + "App can't be installed because it is not compatible with this version of Nextcloud" : "Aplikaci nelze nainstalovat, protože není kompatibilní s touto verzí Nextcloud", + "App can't be installed because the version in info.xml/version is not the same as the version reported from the app store" : "Aplikace nemůže být nainstalována, protože verze uvedená v info.xml/version nesouhlasí s verzí hlášenou z úložiště aplikací.", + "Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" : "Tip: Aktualizaci můžete urychlit manuálním spuštěním následujícího SQL příkazu: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;", + "Running Nextcloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Provozování Nextcloud Serveru na platformě Microsoft Windows není podporováno. Doporučujeme, abyste použili linuxový server ve virtuálním stroji, pokud nemáte možnost migrovat server jako takový. Linuxové balíčky i jednoduše použitelné obrazy virtuálních strojů lze nalézt na <a href=\"%s\">%s</a>. Pro migraci stávajících instalací na Linux můžete nalézt tipy a migrační skript v <a href=\"%s\">naší dokumentaci</a>.", + "This can usually be fixed by <a href=\"%s\" target=\"_blank\">giving the webserver write access to the root directory</a>." : "Toto může být obvykle opraveno <a href=\"%s\" target=\"_blank\">nastavením přístupových práv webového serveru pro zápis do kořenového adresáře</a>." }, "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"); diff --git a/lib/l10n/cs_CZ.json b/lib/l10n/cs_CZ.json index 9b964100551..70f5a613257 100644 --- a/lib/l10n/cs_CZ.json +++ b/lib/l10n/cs_CZ.json @@ -166,6 +166,14 @@ "Storage incomplete configuration. %s" : "Nekompletní konfigurace úložiště. %s", "Storage connection error. %s" : "Chyba připojení úložiště. %s", "Storage not available" : "Úložiště není dostupné", - "Storage connection timeout. %s" : "Vypršení připojení k úložišti. %s" + "Storage connection timeout. %s" : "Vypršení připojení k úložišti. %s", + "ownCloud %s or higher is required." : "Vyžadován ownCloud %s nebo vyšší.", + "ownCloud %s or lower is required." : "Vyžadován ownCloud %s nebo nižší.", + "App \"%s\" cannot be installed because it is not compatible with this version of Nextcloud." : "Aplikaci \"%s\" nelze nainstalovat, protože není kompatibilní s touto verzí Nextcloud.", + "App can't be installed because it is not compatible with this version of Nextcloud" : "Aplikaci nelze nainstalovat, protože není kompatibilní s touto verzí Nextcloud", + "App can't be installed because the version in info.xml/version is not the same as the version reported from the app store" : "Aplikace nemůže být nainstalována, protože verze uvedená v info.xml/version nesouhlasí s verzí hlášenou z úložiště aplikací.", + "Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" : "Tip: Aktualizaci můžete urychlit manuálním spuštěním následujícího SQL příkazu: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;", + "Running Nextcloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Provozování Nextcloud Serveru na platformě Microsoft Windows není podporováno. Doporučujeme, abyste použili linuxový server ve virtuálním stroji, pokud nemáte možnost migrovat server jako takový. Linuxové balíčky i jednoduše použitelné obrazy virtuálních strojů lze nalézt na <a href=\"%s\">%s</a>. Pro migraci stávajících instalací na Linux můžete nalézt tipy a migrační skript v <a href=\"%s\">naší dokumentaci</a>.", + "This can usually be fixed by <a href=\"%s\" target=\"_blank\">giving the webserver write access to the root directory</a>." : "Toto může být obvykle opraveno <a href=\"%s\" target=\"_blank\">nastavením přístupových práv webového serveru pro zápis do kořenového adresáře</a>." },"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;" }
\ No newline at end of file diff --git a/lib/l10n/de.js b/lib/l10n/de.js index 5e5107264e9..c7fad695d39 100644 --- a/lib/l10n/de.js +++ b/lib/l10n/de.js @@ -174,6 +174,8 @@ OC.L10N.register( "App \"%s\" cannot be installed because it is not compatible with this version of Nextcloud." : "Die App \"%s\" kann nicht installiert werden, da sie mit dieser Version von Nextcloud nicht kompatibel ist.", "App can't be installed because it is not compatible with this version of Nextcloud" : "Die App kann nicht installiert werden, da sie mit dieser Version von Nextcloud nicht kompatibel ist", "App can't be installed because the version in info.xml/version is not the same as the version reported from the app store" : "App kann nicht installiert werden, da die in info.xml/version angegebene Version von der vom App-Store berichteten abweicht", - "Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" : "Tipp: Du kannst die Aktualisierung beschleunigen indem Du folgenden SQL-Befehl manuell ausführst: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" + "Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" : "Tipp: Du kannst die Aktualisierung beschleunigen indem Du folgenden SQL-Befehl manuell ausführst: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;", + "Running Nextcloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Der Betrieb eines Nextcloud-Servers unter Microsoft Windows ist nicht unterstützt. Bitte ziehe Betracht einen Linux-Server im Rahmen einer virtuellen Maschine aufzusetzen, wenn du keine Möglichkeit hast, den Server selbst zu migrieren. Finde Linux-Pakete sowie einfach bereitzustellende Images für virtuelle Maschinen unter <a href=\"%s\">%s</a>. Zur Migration existierender Installationen auf Linux findest du in unserer <a href=\"%s\">our Dokumentation</a> einige Tipps und Migrationsscripts.", + "This can usually be fixed by <a href=\"%s\" target=\"_blank\">giving the webserver write access to the root directory</a>." : "Dies kann normalerweise repariert werden, indem dem Webserver <a href=\"%s\" target=\"_blank\">Schreibzugriff auf das Wurzelverzeichnis gegeben wird</a>." }, "nplurals=2; plural=(n != 1);"); diff --git a/lib/l10n/de.json b/lib/l10n/de.json index 9349f1cad2b..8fa1d85fe1e 100644 --- a/lib/l10n/de.json +++ b/lib/l10n/de.json @@ -172,6 +172,8 @@ "App \"%s\" cannot be installed because it is not compatible with this version of Nextcloud." : "Die App \"%s\" kann nicht installiert werden, da sie mit dieser Version von Nextcloud nicht kompatibel ist.", "App can't be installed because it is not compatible with this version of Nextcloud" : "Die App kann nicht installiert werden, da sie mit dieser Version von Nextcloud nicht kompatibel ist", "App can't be installed because the version in info.xml/version is not the same as the version reported from the app store" : "App kann nicht installiert werden, da die in info.xml/version angegebene Version von der vom App-Store berichteten abweicht", - "Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" : "Tipp: Du kannst die Aktualisierung beschleunigen indem Du folgenden SQL-Befehl manuell ausführst: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" + "Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" : "Tipp: Du kannst die Aktualisierung beschleunigen indem Du folgenden SQL-Befehl manuell ausführst: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;", + "Running Nextcloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Der Betrieb eines Nextcloud-Servers unter Microsoft Windows ist nicht unterstützt. Bitte ziehe Betracht einen Linux-Server im Rahmen einer virtuellen Maschine aufzusetzen, wenn du keine Möglichkeit hast, den Server selbst zu migrieren. Finde Linux-Pakete sowie einfach bereitzustellende Images für virtuelle Maschinen unter <a href=\"%s\">%s</a>. Zur Migration existierender Installationen auf Linux findest du in unserer <a href=\"%s\">our Dokumentation</a> einige Tipps und Migrationsscripts.", + "This can usually be fixed by <a href=\"%s\" target=\"_blank\">giving the webserver write access to the root directory</a>." : "Dies kann normalerweise repariert werden, indem dem Webserver <a href=\"%s\" target=\"_blank\">Schreibzugriff auf das Wurzelverzeichnis gegeben wird</a>." },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/lib/l10n/de_DE.js b/lib/l10n/de_DE.js index b5243478545..f2e60b052cd 100644 --- a/lib/l10n/de_DE.js +++ b/lib/l10n/de_DE.js @@ -139,7 +139,7 @@ OC.L10N.register( "Cannot write into \"apps\" directory" : "Das Schreiben in das „apps“-Verzeichnis ist nicht möglich", "This can usually be fixed by %sgiving the webserver write access to the apps directory%s or disabling the appstore in the config file." : "Dies kann normalerweise behoben werden, %sindem dem Webserver Schreibzugriff auf das App-Verzeichnis gegeben wird%s oder der App Store in der Konfigurationsdatei deaktiviert wird.", "Cannot create \"data\" directory (%s)" : "Das Erstellen des „data“-Verzeichnisses ist nicht möglich (%s)", - "This can usually be fixed by <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">giving the webserver write access to the root directory</a>." : "Dies kann normalerweise repariert werden, indem dem Webserver <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\"> Schreibzugriff auf das Wurzelverzeichnis gegeben wird</a>.", + "This can usually be fixed by <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">giving the webserver write access to the root directory</a>." : "Dies kann normalerweise repariert werden, indem dem Webserver <a href=\"%s\" target=\"_blank\">Schreibzugriff auf das Wurzelverzeichnis gegeben wird</a>.", "Permissions can usually be fixed by %sgiving the webserver write access to the root directory%s." : "Berechtigungen können normalerweise repariert werden, indem dem Webserver %s Schreibzugriff auf das Wurzelverzeichnis %s gegeben wird.", "Setting locale to %s failed" : "Das Setzen der Umgebungslokale auf %s fehlgeschlagen", "Please install one of these locales on your system and restart your webserver." : "Bitte installieren Sie eine dieser Sprachen auf Ihrem System und starten Sie den Webserver neu.", @@ -175,6 +175,7 @@ OC.L10N.register( "App can't be installed because it is not compatible with this version of Nextcloud" : "Die App kann nicht installiert werden, da sie mit dieser Version von Nextcloud nicht kompatibel ist", "App can't be installed because the version in info.xml/version is not the same as the version reported from the app store" : "App kann nicht installiert werden, da die in info.xml/version angegebene Version von der vom App-Store berichteten abweicht", "Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" : "Tipp: Sie können die Aktualisierung beschleunigen indem Sie folgenden SQL-Befehl manuell ausführen: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;", + "Running Nextcloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Der Betrieb eines Nextcloud-Servers unter Microsoft Windows ist nicht unterstützt. Bitte ziehen Sie Betracht einen Linux-Server im Rahmen einer virtuellen Maschine aufzusetzen, wenn Sie keine Möglichkeit haben, den Server selbst zu migrieren. Finden Sie Linux-Pakete sowie einfach bereitzustellende Images für virtuelle Maschinen unter <a href=\"%s\">%s</a>. Zur Migration existierender Installationen auf Linux finden Sie in unserer <a href=\"%s\">unserer Dokumentation</a> einige Tipps und Migrationsscripts.", "This can usually be fixed by <a href=\"%s\" target=\"_blank\">giving the webserver write access to the root directory</a>." : "Dies kann normalerweise repariert werden, indem dem Webserver <a href=\"%s\" target=\"_blank\" > Schreibzugriff auf das Wurzelverzeichnis gegeben wird</a>." }, "nplurals=2; plural=(n != 1);"); diff --git a/lib/l10n/de_DE.json b/lib/l10n/de_DE.json index ba00d6fc6bf..0577f0d9a0b 100644 --- a/lib/l10n/de_DE.json +++ b/lib/l10n/de_DE.json @@ -137,7 +137,7 @@ "Cannot write into \"apps\" directory" : "Das Schreiben in das „apps“-Verzeichnis ist nicht möglich", "This can usually be fixed by %sgiving the webserver write access to the apps directory%s or disabling the appstore in the config file." : "Dies kann normalerweise behoben werden, %sindem dem Webserver Schreibzugriff auf das App-Verzeichnis gegeben wird%s oder der App Store in der Konfigurationsdatei deaktiviert wird.", "Cannot create \"data\" directory (%s)" : "Das Erstellen des „data“-Verzeichnisses ist nicht möglich (%s)", - "This can usually be fixed by <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">giving the webserver write access to the root directory</a>." : "Dies kann normalerweise repariert werden, indem dem Webserver <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\"> Schreibzugriff auf das Wurzelverzeichnis gegeben wird</a>.", + "This can usually be fixed by <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">giving the webserver write access to the root directory</a>." : "Dies kann normalerweise repariert werden, indem dem Webserver <a href=\"%s\" target=\"_blank\">Schreibzugriff auf das Wurzelverzeichnis gegeben wird</a>.", "Permissions can usually be fixed by %sgiving the webserver write access to the root directory%s." : "Berechtigungen können normalerweise repariert werden, indem dem Webserver %s Schreibzugriff auf das Wurzelverzeichnis %s gegeben wird.", "Setting locale to %s failed" : "Das Setzen der Umgebungslokale auf %s fehlgeschlagen", "Please install one of these locales on your system and restart your webserver." : "Bitte installieren Sie eine dieser Sprachen auf Ihrem System und starten Sie den Webserver neu.", @@ -173,6 +173,7 @@ "App can't be installed because it is not compatible with this version of Nextcloud" : "Die App kann nicht installiert werden, da sie mit dieser Version von Nextcloud nicht kompatibel ist", "App can't be installed because the version in info.xml/version is not the same as the version reported from the app store" : "App kann nicht installiert werden, da die in info.xml/version angegebene Version von der vom App-Store berichteten abweicht", "Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;" : "Tipp: Sie können die Aktualisierung beschleunigen indem Sie folgenden SQL-Befehl manuell ausführen: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;", + "Running Nextcloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Der Betrieb eines Nextcloud-Servers unter Microsoft Windows ist nicht unterstützt. Bitte ziehen Sie Betracht einen Linux-Server im Rahmen einer virtuellen Maschine aufzusetzen, wenn Sie keine Möglichkeit haben, den Server selbst zu migrieren. Finden Sie Linux-Pakete sowie einfach bereitzustellende Images für virtuelle Maschinen unter <a href=\"%s\">%s</a>. Zur Migration existierender Installationen auf Linux finden Sie in unserer <a href=\"%s\">unserer Dokumentation</a> einige Tipps und Migrationsscripts.", "This can usually be fixed by <a href=\"%s\" target=\"_blank\">giving the webserver write access to the root directory</a>." : "Dies kann normalerweise repariert werden, indem dem Webserver <a href=\"%s\" target=\"_blank\" > Schreibzugriff auf das Wurzelverzeichnis gegeben wird</a>." },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/lib/private/User/Backend.php b/lib/private/User/Backend.php index da86a4b0534..374ec5876e1 100644 --- a/lib/private/User/Backend.php +++ b/lib/private/User/Backend.php @@ -22,11 +22,13 @@ namespace OC\User; +use \OCP\UserInterface; + /** * Abstract base class for user management. Provides methods for querying backend * capabilities. */ -abstract class Backend implements \OCP\UserInterface { +abstract class Backend implements UserInterface { /** * error code for functions not provided by the user backend */ 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) { diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index eb2f1ce1da3..f41468d4926 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -187,7 +187,7 @@ class Manager extends PublicEmitter implements IUserManager { $password = str_replace("\0", '', $password); foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC\User\Backend::CHECK_PASSWORD)) { + if ($backend->implementsActions(Backend::CHECK_PASSWORD)) { $uid = $backend->checkPassword($loginName, $password); if ($uid !== false) { return $this->getUserObject($uid, $backend); @@ -291,7 +291,7 @@ class Manager extends PublicEmitter implements IUserManager { $this->emit('\OC\User', 'preCreateUser', array($uid, $password)); foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC\User\Backend::CREATE_USER)) { + if ($backend->implementsActions(Backend::CREATE_USER)) { $backend->createUser($uid, $password); $user = $this->getUserObject($uid, $backend); $this->emit('\OC\User', 'postCreateUser', array($user, $password)); @@ -309,7 +309,7 @@ class Manager extends PublicEmitter implements IUserManager { public function countUsers() { $userCountStatistics = array(); foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC\User\Backend::COUNT_USERS)) { + if ($backend->implementsActions(Backend::COUNT_USERS)) { $backendUsers = $backend->countUsers(); if($backendUsers !== false) { if($backend instanceof IUserBackend) { diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 3db6cd1a11a..3b357b69bcf 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -167,7 +167,7 @@ class Session implements IUserSession, Emitter { /** * set the currently active user * - * @param User|null $user + * @param IUser|null $user */ public function setUser($user) { if (is_null($user)) { @@ -287,10 +287,8 @@ class Session implements IUserSession, Emitter { $this->session->regenerateId(); if ($this->validateToken($password, $uid)) { return $this->loginWithToken($password); - } else { - return $this->loginWithPassword($uid, $password); } - return false; + return $this->loginWithPassword($uid, $password); } /** @@ -464,7 +462,6 @@ class Session implements IUserSession, Emitter { $message = \OC::$server->getL10N('lib')->t('User disabled'); throw new LoginException($message); } - return false; } /** @@ -652,6 +649,7 @@ class Session implements IUserSession, Emitter { /** * Tries to login the user with auth token header * + * @param IRequest $request * @todo check remember me cookie * @return boolean */ diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 4d403535bf3..94ac8c13621 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -30,6 +30,7 @@ namespace OC\User; +use OC\Files\Cache\Storage; use OC\Hooks\Emitter; use OC_Helper; use OCP\IAvatarManager; @@ -38,6 +39,7 @@ use OCP\IURLGenerator; use OCP\IUser; use OCP\IConfig; use OCP\UserInterface; +use \OCP\IUserBackend; class User implements IUser { /** @var string $uid */ @@ -111,7 +113,7 @@ class User implements IUser { public function getDisplayName() { if (!isset($this->displayName)) { $displayName = ''; - if ($this->backend and $this->backend->implementsActions(\OC\User\Backend::GET_DISPLAYNAME)) { + if ($this->backend and $this->backend->implementsActions(Backend::GET_DISPLAYNAME)) { // get display name and strip whitespace from the beginning and end of it $backendDisplayName = $this->backend->getDisplayName($this->uid); if (is_string($backendDisplayName)) { @@ -136,7 +138,7 @@ class User implements IUser { */ public function setDisplayName($displayName) { $displayName = trim($displayName); - if ($this->backend->implementsActions(\OC\User\Backend::SET_DISPLAYNAME) && !empty($displayName)) { + if ($this->backend->implementsActions(Backend::SET_DISPLAYNAME) && !empty($displayName)) { $result = $this->backend->setDisplayName($this->uid, $displayName); if ($result) { $this->displayName = $displayName; @@ -198,17 +200,17 @@ class User implements IUser { // FIXME: Feels like an hack - suggestions? // We have to delete the user from all groups - foreach (\OC_Group::getUserGroups($this->uid) as $i) { - \OC_Group::removeFromGroup($this->uid, $i); + foreach (\OC::$server->getGroupManager()->getUserGroupIds($this) as $groupId) { + \OC_Group::removeFromGroup($this->uid, $groupId); } // Delete the user's keys in preferences \OC::$server->getConfig()->deleteAllUserValues($this->uid); // Delete user files in /data/ - \OC_Helper::rmdirr(\OC_User::getHome($this->uid)); + \OC_Helper::rmdirr($this->getHome()); // Delete the users entry in the storage table - \OC\Files\Cache\Storage::remove('home::' . $this->uid); + Storage::remove('home::' . $this->uid); \OC::$server->getCommentsManager()->deleteReferencesOfActor('users', $this->uid); \OC::$server->getCommentsManager()->deleteReadMarksFromUser($this); @@ -231,7 +233,7 @@ class User implements IUser { if ($this->emitter) { $this->emitter->emit('\OC\User', 'preSetPassword', array($this, $password, $recoveryPassword)); } - if ($this->backend->implementsActions(\OC\User\Backend::SET_PASSWORD)) { + if ($this->backend->implementsActions(Backend::SET_PASSWORD)) { $result = $this->backend->setPassword($this->uid, $password); if ($this->emitter) { $this->emitter->emit('\OC\User', 'postSetPassword', array($this, $password, $recoveryPassword)); @@ -249,7 +251,7 @@ class User implements IUser { */ public function getHome() { if (!$this->home) { - if ($this->backend->implementsActions(\OC\User\Backend::GET_HOME) and $home = $this->backend->getHome($this->uid)) { + if ($this->backend->implementsActions(Backend::GET_HOME) and $home = $this->backend->getHome($this->uid)) { $this->home = $home; } elseif ($this->config) { $this->home = $this->config->getSystemValue('datadirectory') . '/' . $this->uid; @@ -266,7 +268,7 @@ class User implements IUser { * @return string */ public function getBackendClassName() { - if($this->backend instanceof \OCP\IUserBackend) { + if($this->backend instanceof IUserBackend) { return $this->backend->getBackendName(); } return get_class($this->backend); @@ -278,7 +280,7 @@ class User implements IUser { * @return bool */ public function canChangeAvatar() { - if ($this->backend->implementsActions(\OC\User\Backend::PROVIDE_AVATAR)) { + if ($this->backend->implementsActions(Backend::PROVIDE_AVATAR)) { return $this->backend->canChangeAvatar($this->uid); } return true; @@ -290,7 +292,7 @@ class User implements IUser { * @return bool */ public function canChangePassword() { - return $this->backend->implementsActions(\OC\User\Backend::SET_PASSWORD); + return $this->backend->implementsActions(Backend::SET_PASSWORD); } /** @@ -302,7 +304,7 @@ class User implements IUser { if ($this->config->getSystemValue('allow_user_to_change_display_name') === false) { return false; } - return $this->backend->implementsActions(\OC\User\Backend::SET_DISPLAYNAME); + return $this->backend->implementsActions(Backend::SET_DISPLAYNAME); } /** |