Removes copyright comments.
And uncessary libs.
This commit is contained in:
parent
f420b252ae
commit
5a5511c480
8 changed files with 44 additions and 240 deletions
|
@ -1,30 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
* @author Bjoern Schiessle <bjoern@schiessle.org>
|
||||
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author Morris Jobke <hey@morrisjobke.de>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Tom Needham <tom@owncloud.com>
|
||||
*
|
||||
* @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 <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
return [
|
||||
'resources' => [
|
||||
'user' => ['url' => '/Users'],
|
||||
|
|
|
@ -2,51 +2,16 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2018 John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
|
||||
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
* @author Georg Ehrke <oc.list@georgehrke.com>
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Vincent Petry <vincent@nextcloud.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
namespace OCA\SCIMServiceProvider\Controller;
|
||||
|
||||
use OC\Group\Manager;
|
||||
use OCP\Accounts\IAccountManager;
|
||||
use OCP\Accounts\PropertyDoesNotExistException;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\Files\NotFoundException;
|
||||
use OCP\IConfig;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IRequest;
|
||||
use OCP\IUserManager;
|
||||
use OCP\IUserSession;
|
||||
use OCP\L10N\IFactory;
|
||||
use OCA\SCIMServiceProvider\Responses\SCIMErrorResponse;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\IUser;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
abstract class ASCIMGroup extends ApiController {
|
||||
/** @var IUserManager */
|
||||
|
|
|
@ -2,48 +2,16 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2018 John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
|
||||
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
* @author Georg Ehrke <oc.list@georgehrke.com>
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Vincent Petry <vincent@nextcloud.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
namespace OCA\SCIMServiceProvider\Controller;
|
||||
|
||||
use OC\Group\Manager;
|
||||
use OCP\Accounts\IAccountManager;
|
||||
use OCP\Accounts\PropertyDoesNotExistException;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\Files\NotFoundException;
|
||||
use OCP\IConfig;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IRequest;
|
||||
use OCP\IUserManager;
|
||||
use OCP\IUserSession;
|
||||
use OCP\L10N\IFactory;
|
||||
use OCA\SCIMServiceProvider\Responses\SCIMErrorResponse;
|
||||
|
||||
abstract class ASCIMUser extends ApiController {
|
||||
/** @var IUserManager */
|
||||
|
|
|
@ -2,52 +2,9 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
|
||||
* @author Bjoern Schiessle <bjoern@schiessle.org>
|
||||
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
* @author Daniel Calviño Sánchez <danxuliu@gmail.com>
|
||||
* @author Daniel Kesselberg <mail@danielkesselberg.de>
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
* @author Lukas Reschke <lukas@statuscode.ch>
|
||||
* @author michag86 <micha_g@arcor.de>
|
||||
* @author Mikael Hammarin <mikael@try2.se>
|
||||
* @author Morris Jobke <hey@morrisjobke.de>
|
||||
* @author Robin Appelman <robin@icewind.nl>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Sujith Haridasan <sujith.h@gmail.com>
|
||||
* @author Thomas Citharel <nextcloud@tcit.fr>
|
||||
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
||||
* @author Tom Needham <tom@owncloud.com>
|
||||
* @author Vincent Petry <vincent@nextcloud.com>
|
||||
*
|
||||
* @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 <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
namespace OCA\SCIMServiceProvider\Controller;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use OC\HintException;
|
||||
use OC\KnownUser\KnownUserService;
|
||||
use OCP\Accounts\IAccountManager;
|
||||
use OCP\AppFramework\OCS\OCSException;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use OCP\IConfig;
|
||||
use OCP\IGroupManager;
|
||||
|
@ -62,7 +19,6 @@ use OCA\SCIMServiceProvider\Responses\SCIMListResponse;
|
|||
use OCA\SCIMServiceProvider\Responses\SCIMJSONResponse;
|
||||
use OCA\SCIMServiceProvider\Responses\SCIMErrorResponse;
|
||||
|
||||
|
||||
class GroupController extends ASCIMGroup {
|
||||
|
||||
/** @var IURLGenerator */
|
||||
|
@ -71,8 +27,6 @@ class GroupController extends ASCIMGroup {
|
|||
private $logger;
|
||||
/** @var ISecureRandom */
|
||||
private $secureRandom;
|
||||
/** @var KnownUserService */
|
||||
private $knownUserService;
|
||||
/** @var IEventDispatcher */
|
||||
private $eventDispatcher;
|
||||
|
||||
|
@ -86,7 +40,6 @@ class GroupController extends ASCIMGroup {
|
|||
IURLGenerator $urlGenerator,
|
||||
LoggerInterface $logger,
|
||||
ISecureRandom $secureRandom,
|
||||
KnownUserService $knownUserService,
|
||||
IEventDispatcher $eventDispatcher) {
|
||||
parent::__construct($appName,
|
||||
$request,
|
||||
|
@ -99,7 +52,6 @@ class GroupController extends ASCIMGroup {
|
|||
$this->urlGenerator = $urlGenerator;
|
||||
$this->logger = $logger;
|
||||
$this->secureRandom = $secureRandom;
|
||||
$this->knownUserService = $knownUserService;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
@ -142,9 +94,8 @@ class GroupController extends ASCIMGroup {
|
|||
* @return SCIMJSONResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create( string $displayName = '',
|
||||
public function create(string $displayName = '',
|
||||
array $members = []): SCIMJSONResponse {
|
||||
|
||||
$id = urlencode($displayName);
|
||||
// Validate name
|
||||
if (empty($id)) {
|
||||
|
@ -179,7 +130,7 @@ class GroupController extends ASCIMGroup {
|
|||
* @return DataResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update( string $id,
|
||||
public function update(string $id,
|
||||
string $displayName = '',
|
||||
array $members = []): SCIMJSONResponse {
|
||||
$group = $this->groupManager->get($id);
|
||||
|
@ -214,5 +165,4 @@ class GroupController extends ASCIMGroup {
|
|||
$response->setStatus(204);
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,52 +2,9 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
|
||||
* @author Bjoern Schiessle <bjoern@schiessle.org>
|
||||
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
* @author Daniel Calviño Sánchez <danxuliu@gmail.com>
|
||||
* @author Daniel Kesselberg <mail@danielkesselberg.de>
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
* @author Lukas Reschke <lukas@statuscode.ch>
|
||||
* @author michag86 <micha_g@arcor.de>
|
||||
* @author Mikael Hammarin <mikael@try2.se>
|
||||
* @author Morris Jobke <hey@morrisjobke.de>
|
||||
* @author Robin Appelman <robin@icewind.nl>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
* @author Sujith Haridasan <sujith.h@gmail.com>
|
||||
* @author Thomas Citharel <nextcloud@tcit.fr>
|
||||
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
||||
* @author Tom Needham <tom@owncloud.com>
|
||||
* @author Vincent Petry <vincent@nextcloud.com>
|
||||
*
|
||||
* @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 <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
namespace OCA\SCIMServiceProvider\Controller;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use OC\HintException;
|
||||
use OC\KnownUser\KnownUserService;
|
||||
use OCP\Accounts\IAccountManager;
|
||||
use OCP\AppFramework\OCS\OCSException;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use OCP\IConfig;
|
||||
use OCP\IGroupManager;
|
||||
|
@ -62,7 +19,6 @@ use OCA\SCIMServiceProvider\Responses\SCIMListResponse;
|
|||
use OCA\SCIMServiceProvider\Responses\SCIMJSONResponse;
|
||||
use OCA\SCIMServiceProvider\Responses\SCIMErrorResponse;
|
||||
|
||||
|
||||
class UserController extends ASCIMUser {
|
||||
|
||||
/** @var IURLGenerator */
|
||||
|
@ -71,8 +27,6 @@ class UserController extends ASCIMUser {
|
|||
private $logger;
|
||||
/** @var ISecureRandom */
|
||||
private $secureRandom;
|
||||
/** @var KnownUserService */
|
||||
private $knownUserService;
|
||||
/** @var IEventDispatcher */
|
||||
private $eventDispatcher;
|
||||
|
||||
|
@ -86,7 +40,6 @@ class UserController extends ASCIMUser {
|
|||
IURLGenerator $urlGenerator,
|
||||
LoggerInterface $logger,
|
||||
ISecureRandom $secureRandom,
|
||||
KnownUserService $knownUserService,
|
||||
IEventDispatcher $eventDispatcher) {
|
||||
parent::__construct($appName,
|
||||
$request,
|
||||
|
@ -99,7 +52,6 @@ class UserController extends ASCIMUser {
|
|||
$this->urlGenerator = $urlGenerator;
|
||||
$this->logger = $logger;
|
||||
$this->secureRandom = $secureRandom;
|
||||
$this->knownUserService = $knownUserService;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
@ -154,7 +106,7 @@ class UserController extends ASCIMUser {
|
|||
* @return SCIMJSONResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create( bool $active = true,
|
||||
public function create(bool $active = true,
|
||||
string $displayName = '',
|
||||
array $emails = [],
|
||||
string $userName = ''): SCIMJSONResponse {
|
||||
|
@ -165,7 +117,7 @@ class UserController extends ASCIMUser {
|
|||
|
||||
try {
|
||||
$newUser = $this->userManager->createUser($userName, $this->secureRandom->generate(64));
|
||||
$this->logger->info('Successful createUser call with userid: ' . ['app' => 'SCIMServiceProvider']);
|
||||
$this->logger->info('Successful createUser call with userid: ' . $userName, ['app' => 'SCIMServiceProvider']);
|
||||
foreach ($emails as $email) {
|
||||
$this->logger->error('Log email: ' . $email['value'], ['app' => 'SCIMServiceProvider']);
|
||||
if ($email['primary'] === true) {
|
||||
|
@ -192,7 +144,7 @@ class UserController extends ASCIMUser {
|
|||
* @return DataResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update( string $id,
|
||||
public function update(string $id,
|
||||
bool $active,
|
||||
string $displayName = '',
|
||||
array $emails = []): SCIMJSONResponse {
|
||||
|
@ -209,7 +161,6 @@ class UserController extends ASCIMUser {
|
|||
$targetUser->setEnabled($active);
|
||||
}
|
||||
return new SCIMJSONResponse($this->getSCIMUser($id));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -234,5 +185,4 @@ class UserController extends ASCIMUser {
|
|||
return new SCIMErrorResponse(['message' => 'Couldn\'t delete user'], 503);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
namespace OCA\SCIMServiceProvider\Responses;
|
||||
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use OCA\SCIMServiceProvider\Responses\SCIMJSONResponse;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class SCIMErrorResponse
|
||||
|
|
Loading…
Reference in a new issue