59 lines
1.3 KiB
PHP
59 lines
1.3 KiB
PHP
<?php
|
||
declare(strict_types=1);
|
||
|
||
namespace OCA\Agency\Controller;
|
||
|
||
use OCP\IRequest;
|
||
use OCP\AppFramework\Http\TemplateResponse;
|
||
use OCP\AppFramework\Controller;
|
||
use OCP\Util;
|
||
use OCP\AppFramework\Http\JSONResponse;
|
||
use OCP\AppFramework\Http\DataResponse;
|
||
|
||
|
||
use OCA\Agency\Agency\AgencyManager;
|
||
use OCP\IDBConnection;
|
||
|
||
use OCP\IGroupManager;
|
||
use OCP\IUserManager;
|
||
|
||
class TestController extends Controller {
|
||
|
||
protected $appName;
|
||
protected $agencyManager;
|
||
|
||
private $groupManager;
|
||
private $userManager;
|
||
|
||
public function __construct($appName, IRequest $request, IDBConnection $db, IGroupManager $gm, IUserManager $userManager, AgencyManager $agencyManager) {
|
||
parent::__construct($appName, $request);
|
||
$this->appName = $appName;
|
||
$this->agencyManager = $agencyManager;
|
||
$this->groupManager = $gm;
|
||
$this->userManager = $userManager;
|
||
}
|
||
|
||
/**
|
||
* @NoAdminRequired
|
||
*/
|
||
public function filetest() {
|
||
/*
|
||
$user = $this->userManager->get('holger');
|
||
$groups = $this->groupManager->getUserGroups($user);
|
||
|
||
$agency_group_id = "";
|
||
foreach($groups as $group){
|
||
if(str_contains($group->getGId(), 'agency')){
|
||
$agency_group_id = explode("_", strval($group->getGId()))[1];
|
||
}
|
||
}
|
||
*/
|
||
|
||
//return $agency_group_id;
|
||
//if($groupname == "agencymaingroupid" || preg_match('/[0-9]^.{6}$')){
|
||
// return false;
|
||
//}
|
||
return 0;
|
||
}
|
||
|
||
} |