Reformat code
This commit is contained in:
@@ -5,20 +5,20 @@
|
|||||||
* @author Julius Härtl <jus@bitgrid.net>
|
* @author Julius Härtl <jus@bitgrid.net>
|
||||||
*
|
*
|
||||||
* @license GNU AGPL version 3 or any later version
|
* @license GNU AGPL version 3 or any later version
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU Affero General Public License for more details.
|
* GNU Affero General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Deck\Controller;
|
namespace OCA\Deck\Controller;
|
||||||
@@ -33,25 +33,25 @@ use OCP\IUserManager;
|
|||||||
|
|
||||||
class ShareController extends Controller {
|
class ShareController extends Controller {
|
||||||
|
|
||||||
private $userManager;
|
private $userManager;
|
||||||
private $groupManager;
|
private $groupManager;
|
||||||
private $boardService;
|
private $boardService;
|
||||||
private $userId;
|
private $userId;
|
||||||
|
|
||||||
public function __construct($appName,
|
public function __construct($appName,
|
||||||
IRequest $request,
|
IRequest $request,
|
||||||
IUserManager $userManager,
|
IUserManager $userManager,
|
||||||
IGroupManager $groupManager,
|
IGroupManager $groupManager,
|
||||||
BoardService $boardService,
|
BoardService $boardService,
|
||||||
$userId
|
$userId
|
||||||
){
|
) {
|
||||||
parent::__construct($appName, $request);
|
parent::__construct($appName, $request);
|
||||||
$this->userManager = $userManager;
|
$this->userManager = $userManager;
|
||||||
$this->groupManager = $groupManager;
|
$this->groupManager = $groupManager;
|
||||||
$this->userId = $userId;
|
$this->userId = $userId;
|
||||||
$this->boardService = $boardService;
|
$this->boardService = $boardService;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
@@ -59,35 +59,33 @@ class ShareController extends Controller {
|
|||||||
* @param $search
|
* @param $search
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function searchUser($search) {
|
public function searchUser($search) {
|
||||||
$limit = 3;
|
$limit = 3;
|
||||||
$offset = null;
|
$offset = null;
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($this->groupManager->search($search, $limit, $offset) as $idx => $group) {
|
foreach ($this->groupManager->search($search, $limit, $offset) as $idx => $group) {
|
||||||
$acl = new Acl();
|
$acl = new Acl();
|
||||||
$acl->setType('group');
|
$acl->setType('group');
|
||||||
$acl->setParticipant($group->getGID());
|
$acl->setParticipant($group->getGID());
|
||||||
$acl->setPermissionWrite(true);
|
$acl->setPermissionWrite(true);
|
||||||
$acl->setPermissionInvite(true);
|
$acl->setPermissionInvite(true);
|
||||||
$acl->setPermissionManage(true);
|
$acl->setPermissionManage(true);
|
||||||
$result[] = $acl;
|
$result[] = $acl;
|
||||||
}
|
}
|
||||||
$limit = 10;
|
$limit = 10;
|
||||||
foreach ($this->userManager->searchDisplayName($search, $limit, $offset) as $idx => $user) {
|
foreach ($this->userManager->searchDisplayName($search, $limit, $offset) as $idx => $user) {
|
||||||
if($user->getUID() === $this->userId)
|
if ($user->getUID() === $this->userId)
|
||||||
continue;
|
continue;
|
||||||
$acl = new Acl();
|
$acl = new Acl();
|
||||||
$acl->setType('user');
|
$acl->setType('user');
|
||||||
$acl->setParticipant($user->getUID());
|
$acl->setParticipant($user->getUID());
|
||||||
$acl->setPermissionWrite(true);
|
$acl->setPermissionWrite(true);
|
||||||
$acl->setPermissionInvite(true);
|
$acl->setPermissionInvite(true);
|
||||||
$acl->setPermissionManage(true);
|
$acl->setPermissionManage(true);
|
||||||
$result[] = $acl;
|
$result[] = $acl;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user