Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix the storage info and other checks when the user has wrong casing
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Apr 24, 2017
commit 2f312bc01b7cfc109a176bbdc4c27c1385fb77b9
10 changes: 5 additions & 5 deletions apps/provisioning_api/lib/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,16 @@ public function getUser($parameters) {
// 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()) {
return new \OC\OCS\Result(null, \OCP\API::RESPOND_UNAUTHORISED);
}
}

// Find the data
$data['quota'] = $this->fillStorageInfo($userId);
$data['quota'] = $this->fillStorageInfo($targetUserObject->getUID());
$data['email'] = $targetUserObject->getEMailAddress();
$data['displayname'] = $targetUserObject->getDisplayName();

Expand Down Expand Up @@ -232,7 +232,7 @@ public function editUser($parameters) {
}

$permittedFields = [];
if($targetUserId === $currentLoggedInUser->getUID()) {
if($targetUser->getUID() === $currentLoggedInUser->getUID()) {
// Editing self (display, email)
$permittedFields[] = 'display';
$permittedFields[] = 'email';
Expand Down Expand Up @@ -489,7 +489,7 @@ public function removeFromGroup($parameters) {
return new \OC\OCS\Result(null, 104);
}
// Check they aren't removing themselves from 'admin' or their 'subadmin; group
if($parameters['userid'] === $loggedInUser->getUID()) {
if($targetUser->getUID() === $loggedInUser->getUID()) {
if($this->groupManager->isAdmin($loggedInUser->getUID())) {
if($group->getGID() === 'admin') {
return new \OC\OCS\Result(null, 105, 'Cannot remove yourself from the admin group');
Expand Down
Loading