|
@@ 575-577 (lines=3) @@
|
| 572 |
|
|
| 573 |
|
// If not permitted |
| 574 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 575 |
|
if(!$this->groupManager->isAdmin($currentLoggedInUser->getUID()) && !$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) { |
| 576 |
|
throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); |
| 577 |
|
} |
| 578 |
|
|
| 579 |
|
// Go ahead with the delete |
| 580 |
|
if($targetUser->delete()) { |
|
@@ 629-631 (lines=3) @@
|
| 626 |
|
|
| 627 |
|
// If not permitted |
| 628 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 629 |
|
if(!$this->groupManager->isAdmin($currentLoggedInUser->getUID()) && !$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser)) { |
| 630 |
|
throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); |
| 631 |
|
} |
| 632 |
|
|
| 633 |
|
// enable/disable the user now |
| 634 |
|
$targetUser->setEnabled($value); |
|
@@ 937-941 (lines=5) @@
|
| 934 |
|
|
| 935 |
|
// Check if admin / subadmin |
| 936 |
|
$subAdminManager = $this->groupManager->getSubAdmin(); |
| 937 |
|
if(!$subAdminManager->isUserAccessible($currentLoggedInUser, $targetUser) |
| 938 |
|
&& !$this->groupManager->isAdmin($currentLoggedInUser->getUID())) { |
| 939 |
|
// No rights |
| 940 |
|
throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); |
| 941 |
|
} |
| 942 |
|
|
| 943 |
|
$email = $targetUser->getEMailAddress(); |
| 944 |
|
if ($email === '' || $email === null) { |