From fcd5056376c441611bcb925ff4b7e3fa892fcf3e Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 30 Jan 2015 18:31:04 +0100 Subject: [PATCH] Consistent variable naming --- settings/controller/userscontroller.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/settings/controller/userscontroller.php b/settings/controller/userscontroller.php index b1caaa1799..80fb81600d 100644 --- a/settings/controller/userscontroller.php +++ b/settings/controller/userscontroller.php @@ -273,16 +273,16 @@ class UsersController extends Controller { } if (!$this->isAdmin) { - $uid = $this->userSession->getUser()->getUID(); + $userId = $this->userSession->getUser()->getUID(); if (!empty($groups)) { foreach ($groups as $key => $group) { - if (!$this->subAdminFactory->isGroupAccessible($uid, $group)) { + if (!$this->subAdminFactory->isGroupAccessible($userId, $group)) { unset($groups[$key]); } } } if (empty($groups)) { - $groups = $this->subAdminFactory->getSubAdminsOfGroups($uid); + $groups = $this->subAdminFactory->getSubAdminsOfGroups($userId); } } @@ -367,8 +367,8 @@ class UsersController extends Controller { * @return DataResponse */ public function destroy($id) { - $UserId = $this->userSession->getUser()->getUID(); - if($UserId === $id) { + $userId = $this->userSession->getUser()->getUID(); + if($userId === $id) { return new DataResponse( array( 'status' => 'error', @@ -380,7 +380,7 @@ class UsersController extends Controller { ); } - if(!$this->isAdmin && !$this->subAdminFactory->isUserAccessible($UserId, $id)) { + if(!$this->isAdmin && !$this->subAdminFactory->isUserAccessible($userId, $id)) { return new DataResponse( array( 'status' => 'error', @@ -429,11 +429,10 @@ class UsersController extends Controller { * @return DataResponse */ public function setMailAddress($id, $mailAddress) { - $UserId = $this->userSession->getUser()->getUID(); - // FIXME: Remove this static function call at some point… - if($this->userSession->getUser()->getUID() !== $id + $userId = $this->userSession->getUser()->getUID(); + if($userId !== $id && !$this->isAdmin - && !$this->subAdminFactory->isUserAccessible($UserId, $id)) { + && !$this->subAdminFactory->isUserAccessible($userId, $id)) { return new DataResponse( array( 'status' => 'error',