diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 7ca32a0848b2..7c539c8e4dd8 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -393,6 +393,12 @@ private function newAccount($uid, $backend) { $account->setEmail($email); } } + if ($backend instanceof IProvidesQuotaBackend) { + $quota = $backend->getQuota($uid); + if ($quota !== null) { + $account->setQuota($quota); + } + } $home = false; if ($backend->implementsActions(Backend::GET_HOME)) { $home = $backend->getHome($uid); diff --git a/lib/public/User/IProvidesQuotaBackend.php b/lib/public/User/IProvidesQuotaBackend.php new file mode 100644 index 000000000000..bfb27d2e9ba4 --- /dev/null +++ b/lib/public/User/IProvidesQuotaBackend.php @@ -0,0 +1,44 @@ + + * + * @copyright Copyright (c) 2017, ownCloud GmbH + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + + +// use OCP namespace for all classes that are considered public. +// This means that they should be used by apps instead of the internal ownCloud classes +namespace OCP\User; + +/** + * Interface IProvidesQuotaBackend + * + * @package OCP\User + * @since 10.0 + */ +interface IProvidesQuotaBackend { + + /** + * Get a users quota + * + * @param string $uid The username + * @return string + * @since 10.0 + */ + public function getQuota($uid); +} +