summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-04-24 09:43:44 +0200
committerJoas Schilling <coding@schilljs.com>2017-04-24 10:10:50 +0200
commit992c48c89bd71971a3821143aeac7dcb8f616461 (patch)
treec3d16b60fab2e1f55523ae3852ff79328c3224aa /apps/provisioning_api/lib
parent1c2cdc9d3aeae0cb1f2f5d4fe3c19f4666affddf (diff)
downloadnextcloud-server-992c48c89bd71971a3821143aeac7dcb8f616461.tar.gz
nextcloud-server-992c48c89bd71971a3821143aeac7dcb8f616461.zip
Fix the storage info and other checks when the user has wrong casing
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index b1a1cf1c6b7..088b0e6bdb0 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -278,10 +278,10 @@ class UsersController extends OCSController {
// Admin? Or SubAdmin?
if($this->groupManager->isAdmin($currentLoggedInUser->getUID())
|| $this->groupManager->getSubAdmin()->isUserAccessible($currentLoggedInUser, $targetUserObject)) {
- $data['enabled'] = $this->config->getUserValue($userId, 'core', 'enabled', 'true');
+ $data['enabled'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'enabled', 'true');
} else {
// Check they are looking up themselves
- if($currentLoggedInUser->getUID() !== $userId) {
+ if($currentLoggedInUser->getUID() !== $targetUserObject->getUID()) {
throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED);
}
}
@@ -295,7 +295,7 @@ class UsersController extends OCSController {
// Find the data
$data['id'] = $targetUserObject->getUID();
- $data['quota'] = $this->fillStorageInfo($userId);
+ $data['quota'] = $this->fillStorageInfo($targetUserObject->getUID());
$data[AccountManager::PROPERTY_EMAIL] = $targetUserObject->getEMailAddress();
$data[AccountManager::PROPERTY_DISPLAYNAME] = $targetUserObject->getDisplayName();
$data[AccountManager::PROPERTY_PHONE] = $userAccount[AccountManager::PROPERTY_PHONE]['value'];
@@ -330,7 +330,7 @@ class UsersController extends OCSController {
}
$permittedFields = [];
- if($userId === $currentLoggedInUser->getUID()) {
+ if($targetUser->getUID() === $currentLoggedInUser->getUID()) {
// Editing self (display, email)
$permittedFields[] = 'display';
$permittedFields[] = AccountManager::PROPERTY_DISPLAYNAME;
@@ -618,7 +618,7 @@ class UsersController extends OCSController {
}
// Check they aren't removing themselves from 'admin' or their 'subadmin; group
- if ($userId === $loggedInUser->getUID()) {
+ if ($targetUser->getUID() === $loggedInUser->getUID()) {
if ($this->groupManager->isAdmin($loggedInUser->getUID())) {
if ($group->getGID() === 'admin') {
throw new OCSException('Cannot remove yourself from the admin group', 105);