@@ -29,39 +29,39 @@ |
||
29 | 29 | |
30 | 30 | class WatcherConnector { |
31 | 31 | |
32 | - /** @var IRootFolder */ |
|
33 | - private $root; |
|
32 | + /** @var IRootFolder */ |
|
33 | + private $root; |
|
34 | 34 | |
35 | - /** @var SystemConfig */ |
|
36 | - private $config; |
|
35 | + /** @var SystemConfig */ |
|
36 | + private $config; |
|
37 | 37 | |
38 | - /** |
|
39 | - * WatcherConnector constructor. |
|
40 | - * |
|
41 | - * @param IRootFolder $root |
|
42 | - * @param SystemConfig $config |
|
43 | - */ |
|
44 | - public function __construct(IRootFolder $root, |
|
45 | - SystemConfig $config) { |
|
46 | - $this->root = $root; |
|
47 | - $this->config = $config; |
|
48 | - } |
|
38 | + /** |
|
39 | + * WatcherConnector constructor. |
|
40 | + * |
|
41 | + * @param IRootFolder $root |
|
42 | + * @param SystemConfig $config |
|
43 | + */ |
|
44 | + public function __construct(IRootFolder $root, |
|
45 | + SystemConfig $config) { |
|
46 | + $this->root = $root; |
|
47 | + $this->config = $config; |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * @return Watcher |
|
52 | - */ |
|
53 | - private function getWatcher(): Watcher { |
|
54 | - return \OC::$server->query(Watcher::class); |
|
55 | - } |
|
50 | + /** |
|
51 | + * @return Watcher |
|
52 | + */ |
|
53 | + private function getWatcher(): Watcher { |
|
54 | + return \OC::$server->query(Watcher::class); |
|
55 | + } |
|
56 | 56 | |
57 | - public function connectWatcher() { |
|
58 | - // Do not connect if we are not setup yet! |
|
59 | - if ($this->config->getValue('instanceid', null) !== null) { |
|
60 | - $this->root->listen('\OC\Files', 'postWrite', function (Node $node) { |
|
61 | - $this->getWatcher()->postWrite($node); |
|
62 | - }); |
|
57 | + public function connectWatcher() { |
|
58 | + // Do not connect if we are not setup yet! |
|
59 | + if ($this->config->getValue('instanceid', null) !== null) { |
|
60 | + $this->root->listen('\OC\Files', 'postWrite', function (Node $node) { |
|
61 | + $this->getWatcher()->postWrite($node); |
|
62 | + }); |
|
63 | 63 | |
64 | - \OC_Hook::connect('\OCP\Versions', 'rollback', $this->getWatcher(), 'versionRollback'); |
|
65 | - } |
|
66 | - } |
|
64 | + \OC_Hook::connect('\OCP\Versions', 'rollback', $this->getWatcher(), 'versionRollback'); |
|
65 | + } |
|
66 | + } |
|
67 | 67 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | public function connectWatcher() { |
58 | 58 | // Do not connect if we are not setup yet! |
59 | 59 | if ($this->config->getValue('instanceid', null) !== null) { |
60 | - $this->root->listen('\OC\Files', 'postWrite', function (Node $node) { |
|
60 | + $this->root->listen('\OC\Files', 'postWrite', function(Node $node) { |
|
61 | 61 | $this->getWatcher()->postWrite($node); |
62 | 62 | }); |
63 | 63 |
@@ -162,7 +162,7 @@ |
||
162 | 162 | if (\is_array($scope)) { |
163 | 163 | parent::setScope(json_encode($scope)); |
164 | 164 | } else { |
165 | - parent::setScope((string)$scope); |
|
165 | + parent::setScope((string) $scope); |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 |
@@ -43,168 +43,168 @@ |
||
43 | 43 | * @method void setVersion(int $version) |
44 | 44 | */ |
45 | 45 | class DefaultToken extends Entity implements INamedToken { |
46 | - public const VERSION = 1; |
|
47 | - |
|
48 | - /** @var string user UID */ |
|
49 | - protected $uid; |
|
50 | - |
|
51 | - /** @var string login name used for generating the token */ |
|
52 | - protected $loginName; |
|
53 | - |
|
54 | - /** @var string encrypted user password */ |
|
55 | - protected $password; |
|
56 | - |
|
57 | - /** @var string token name (e.g. browser/OS) */ |
|
58 | - protected $name; |
|
59 | - |
|
60 | - /** @var string */ |
|
61 | - protected $token; |
|
62 | - |
|
63 | - /** @var int */ |
|
64 | - protected $type; |
|
65 | - |
|
66 | - /** @var int */ |
|
67 | - protected $remember; |
|
68 | - |
|
69 | - /** @var int */ |
|
70 | - protected $lastActivity; |
|
71 | - |
|
72 | - /** @var int */ |
|
73 | - protected $lastCheck; |
|
74 | - |
|
75 | - /** @var string */ |
|
76 | - protected $scope; |
|
77 | - |
|
78 | - /** @var int */ |
|
79 | - protected $expires; |
|
80 | - |
|
81 | - /** @var int */ |
|
82 | - protected $version; |
|
83 | - |
|
84 | - public function __construct() { |
|
85 | - $this->addType('uid', 'string'); |
|
86 | - $this->addType('loginName', 'string'); |
|
87 | - $this->addType('password', 'string'); |
|
88 | - $this->addType('name', 'string'); |
|
89 | - $this->addType('token', 'string'); |
|
90 | - $this->addType('type', 'int'); |
|
91 | - $this->addType('remember', 'int'); |
|
92 | - $this->addType('lastActivity', 'int'); |
|
93 | - $this->addType('lastCheck', 'int'); |
|
94 | - $this->addType('scope', 'string'); |
|
95 | - $this->addType('expires', 'int'); |
|
96 | - $this->addType('version', 'int'); |
|
97 | - } |
|
98 | - |
|
99 | - public function getId(): int { |
|
100 | - return $this->id; |
|
101 | - } |
|
102 | - |
|
103 | - public function getUID(): string { |
|
104 | - return $this->uid; |
|
105 | - } |
|
106 | - |
|
107 | - /** |
|
108 | - * Get the login name used when generating the token |
|
109 | - * |
|
110 | - * @return string |
|
111 | - */ |
|
112 | - public function getLoginName(): string { |
|
113 | - return parent::getLoginName(); |
|
114 | - } |
|
115 | - |
|
116 | - /** |
|
117 | - * Get the (encrypted) login password |
|
118 | - * |
|
119 | - * @return string|null |
|
120 | - */ |
|
121 | - public function getPassword() { |
|
122 | - return parent::getPassword(); |
|
123 | - } |
|
124 | - |
|
125 | - public function jsonSerialize() { |
|
126 | - return [ |
|
127 | - 'id' => $this->id, |
|
128 | - 'name' => $this->name, |
|
129 | - 'lastActivity' => $this->lastActivity, |
|
130 | - 'type' => $this->type, |
|
131 | - 'scope' => $this->getScopeAsArray() |
|
132 | - ]; |
|
133 | - } |
|
134 | - |
|
135 | - /** |
|
136 | - * Get the timestamp of the last password check |
|
137 | - * |
|
138 | - * @return int |
|
139 | - */ |
|
140 | - public function getLastCheck(): int { |
|
141 | - return parent::getLastCheck(); |
|
142 | - } |
|
143 | - |
|
144 | - /** |
|
145 | - * Get the timestamp of the last password check |
|
146 | - * |
|
147 | - * @param int $time |
|
148 | - */ |
|
149 | - public function setLastCheck(int $time) { |
|
150 | - parent::setLastCheck($time); |
|
151 | - } |
|
152 | - |
|
153 | - public function getScope(): string { |
|
154 | - $scope = parent::getScope(); |
|
155 | - if ($scope === null) { |
|
156 | - return ''; |
|
157 | - } |
|
158 | - |
|
159 | - return $scope; |
|
160 | - } |
|
161 | - |
|
162 | - public function getScopeAsArray(): array { |
|
163 | - $scope = json_decode($this->getScope(), true); |
|
164 | - if (!$scope) { |
|
165 | - return [ |
|
166 | - 'filesystem' => true |
|
167 | - ]; |
|
168 | - } |
|
169 | - return $scope; |
|
170 | - } |
|
171 | - |
|
172 | - public function setScope($scope) { |
|
173 | - if (\is_array($scope)) { |
|
174 | - parent::setScope(json_encode($scope)); |
|
175 | - } else { |
|
176 | - parent::setScope((string)$scope); |
|
177 | - } |
|
178 | - } |
|
179 | - |
|
180 | - public function getName(): string { |
|
181 | - return parent::getName(); |
|
182 | - } |
|
183 | - |
|
184 | - public function setName(string $name): void { |
|
185 | - parent::setName($name); |
|
186 | - } |
|
187 | - |
|
188 | - public function getRemember(): int { |
|
189 | - return parent::getRemember(); |
|
190 | - } |
|
191 | - |
|
192 | - public function setToken(string $token) { |
|
193 | - parent::setToken($token); |
|
194 | - } |
|
195 | - |
|
196 | - public function setPassword(string $password = null) { |
|
197 | - parent::setPassword($password); |
|
198 | - } |
|
199 | - |
|
200 | - public function setExpires($expires) { |
|
201 | - parent::setExpires($expires); |
|
202 | - } |
|
203 | - |
|
204 | - /** |
|
205 | - * @return int|null |
|
206 | - */ |
|
207 | - public function getExpires() { |
|
208 | - return parent::getExpires(); |
|
209 | - } |
|
46 | + public const VERSION = 1; |
|
47 | + |
|
48 | + /** @var string user UID */ |
|
49 | + protected $uid; |
|
50 | + |
|
51 | + /** @var string login name used for generating the token */ |
|
52 | + protected $loginName; |
|
53 | + |
|
54 | + /** @var string encrypted user password */ |
|
55 | + protected $password; |
|
56 | + |
|
57 | + /** @var string token name (e.g. browser/OS) */ |
|
58 | + protected $name; |
|
59 | + |
|
60 | + /** @var string */ |
|
61 | + protected $token; |
|
62 | + |
|
63 | + /** @var int */ |
|
64 | + protected $type; |
|
65 | + |
|
66 | + /** @var int */ |
|
67 | + protected $remember; |
|
68 | + |
|
69 | + /** @var int */ |
|
70 | + protected $lastActivity; |
|
71 | + |
|
72 | + /** @var int */ |
|
73 | + protected $lastCheck; |
|
74 | + |
|
75 | + /** @var string */ |
|
76 | + protected $scope; |
|
77 | + |
|
78 | + /** @var int */ |
|
79 | + protected $expires; |
|
80 | + |
|
81 | + /** @var int */ |
|
82 | + protected $version; |
|
83 | + |
|
84 | + public function __construct() { |
|
85 | + $this->addType('uid', 'string'); |
|
86 | + $this->addType('loginName', 'string'); |
|
87 | + $this->addType('password', 'string'); |
|
88 | + $this->addType('name', 'string'); |
|
89 | + $this->addType('token', 'string'); |
|
90 | + $this->addType('type', 'int'); |
|
91 | + $this->addType('remember', 'int'); |
|
92 | + $this->addType('lastActivity', 'int'); |
|
93 | + $this->addType('lastCheck', 'int'); |
|
94 | + $this->addType('scope', 'string'); |
|
95 | + $this->addType('expires', 'int'); |
|
96 | + $this->addType('version', 'int'); |
|
97 | + } |
|
98 | + |
|
99 | + public function getId(): int { |
|
100 | + return $this->id; |
|
101 | + } |
|
102 | + |
|
103 | + public function getUID(): string { |
|
104 | + return $this->uid; |
|
105 | + } |
|
106 | + |
|
107 | + /** |
|
108 | + * Get the login name used when generating the token |
|
109 | + * |
|
110 | + * @return string |
|
111 | + */ |
|
112 | + public function getLoginName(): string { |
|
113 | + return parent::getLoginName(); |
|
114 | + } |
|
115 | + |
|
116 | + /** |
|
117 | + * Get the (encrypted) login password |
|
118 | + * |
|
119 | + * @return string|null |
|
120 | + */ |
|
121 | + public function getPassword() { |
|
122 | + return parent::getPassword(); |
|
123 | + } |
|
124 | + |
|
125 | + public function jsonSerialize() { |
|
126 | + return [ |
|
127 | + 'id' => $this->id, |
|
128 | + 'name' => $this->name, |
|
129 | + 'lastActivity' => $this->lastActivity, |
|
130 | + 'type' => $this->type, |
|
131 | + 'scope' => $this->getScopeAsArray() |
|
132 | + ]; |
|
133 | + } |
|
134 | + |
|
135 | + /** |
|
136 | + * Get the timestamp of the last password check |
|
137 | + * |
|
138 | + * @return int |
|
139 | + */ |
|
140 | + public function getLastCheck(): int { |
|
141 | + return parent::getLastCheck(); |
|
142 | + } |
|
143 | + |
|
144 | + /** |
|
145 | + * Get the timestamp of the last password check |
|
146 | + * |
|
147 | + * @param int $time |
|
148 | + */ |
|
149 | + public function setLastCheck(int $time) { |
|
150 | + parent::setLastCheck($time); |
|
151 | + } |
|
152 | + |
|
153 | + public function getScope(): string { |
|
154 | + $scope = parent::getScope(); |
|
155 | + if ($scope === null) { |
|
156 | + return ''; |
|
157 | + } |
|
158 | + |
|
159 | + return $scope; |
|
160 | + } |
|
161 | + |
|
162 | + public function getScopeAsArray(): array { |
|
163 | + $scope = json_decode($this->getScope(), true); |
|
164 | + if (!$scope) { |
|
165 | + return [ |
|
166 | + 'filesystem' => true |
|
167 | + ]; |
|
168 | + } |
|
169 | + return $scope; |
|
170 | + } |
|
171 | + |
|
172 | + public function setScope($scope) { |
|
173 | + if (\is_array($scope)) { |
|
174 | + parent::setScope(json_encode($scope)); |
|
175 | + } else { |
|
176 | + parent::setScope((string)$scope); |
|
177 | + } |
|
178 | + } |
|
179 | + |
|
180 | + public function getName(): string { |
|
181 | + return parent::getName(); |
|
182 | + } |
|
183 | + |
|
184 | + public function setName(string $name): void { |
|
185 | + parent::setName($name); |
|
186 | + } |
|
187 | + |
|
188 | + public function getRemember(): int { |
|
189 | + return parent::getRemember(); |
|
190 | + } |
|
191 | + |
|
192 | + public function setToken(string $token) { |
|
193 | + parent::setToken($token); |
|
194 | + } |
|
195 | + |
|
196 | + public function setPassword(string $password = null) { |
|
197 | + parent::setPassword($password); |
|
198 | + } |
|
199 | + |
|
200 | + public function setExpires($expires) { |
|
201 | + parent::setExpires($expires); |
|
202 | + } |
|
203 | + |
|
204 | + /** |
|
205 | + * @return int|null |
|
206 | + */ |
|
207 | + public function getExpires() { |
|
208 | + return parent::getExpires(); |
|
209 | + } |
|
210 | 210 | } |
@@ -29,8 +29,8 @@ |
||
29 | 29 | */ |
30 | 30 | interface ICountDisabledInGroup { |
31 | 31 | |
32 | - /** |
|
33 | - * @since 14.0.0 |
|
34 | - */ |
|
35 | - public function countDisabledInGroup(string $gid): int; |
|
32 | + /** |
|
33 | + * @since 14.0.0 |
|
34 | + */ |
|
35 | + public function countDisabledInGroup(string $gid): int; |
|
36 | 36 | } |
@@ -29,28 +29,28 @@ |
||
29 | 29 | |
30 | 30 | class Version14000Date20180516101403 extends SimpleMigrationStep { |
31 | 31 | |
32 | - /** |
|
33 | - * @param IOutput $output |
|
34 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
35 | - * @param array $options |
|
36 | - * @return null|ISchemaWrapper |
|
37 | - */ |
|
38 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
39 | - /** @var ISchemaWrapper $schema */ |
|
40 | - $schema = $schemaClosure(); |
|
32 | + /** |
|
33 | + * @param IOutput $output |
|
34 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
35 | + * @param array $options |
|
36 | + * @return null|ISchemaWrapper |
|
37 | + */ |
|
38 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
39 | + /** @var ISchemaWrapper $schema */ |
|
40 | + $schema = $schemaClosure(); |
|
41 | 41 | |
42 | - $table = $schema->getTable('authtoken'); |
|
42 | + $table = $schema->getTable('authtoken'); |
|
43 | 43 | |
44 | - if (!$table->hasColumn('expires')) { |
|
45 | - $table->addColumn('expires', 'integer', [ |
|
46 | - 'notnull' => false, |
|
47 | - 'length' => 4, |
|
48 | - 'default' => null, |
|
49 | - 'unsigned' => true, |
|
50 | - ]); |
|
44 | + if (!$table->hasColumn('expires')) { |
|
45 | + $table->addColumn('expires', 'integer', [ |
|
46 | + 'notnull' => false, |
|
47 | + 'length' => 4, |
|
48 | + 'default' => null, |
|
49 | + 'unsigned' => true, |
|
50 | + ]); |
|
51 | 51 | |
52 | - return $schema; |
|
53 | - } |
|
54 | - return null; |
|
55 | - } |
|
52 | + return $schema; |
|
53 | + } |
|
54 | + return null; |
|
55 | + } |
|
56 | 56 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | |
72 | 72 | if ($response_type !== 'code') { |
73 | 73 | //Fail |
74 | - $url = $client->getRedirectUri() . '?error=unsupported_response_type&state=' . $state; |
|
74 | + $url = $client->getRedirectUri().'?error=unsupported_response_type&state='.$state; |
|
75 | 75 | return new RedirectResponse($url); |
76 | 76 | } |
77 | 77 |
@@ -39,72 +39,72 @@ |
||
39 | 39 | use OCP\IURLGenerator; |
40 | 40 | |
41 | 41 | class LoginRedirectorController extends Controller { |
42 | - /** @var IURLGenerator */ |
|
43 | - private $urlGenerator; |
|
44 | - /** @var ClientMapper */ |
|
45 | - private $clientMapper; |
|
46 | - /** @var ISession */ |
|
47 | - private $session; |
|
48 | - /** @var IL10N */ |
|
49 | - private $l; |
|
42 | + /** @var IURLGenerator */ |
|
43 | + private $urlGenerator; |
|
44 | + /** @var ClientMapper */ |
|
45 | + private $clientMapper; |
|
46 | + /** @var ISession */ |
|
47 | + private $session; |
|
48 | + /** @var IL10N */ |
|
49 | + private $l; |
|
50 | 50 | |
51 | - /** |
|
52 | - * @param string $appName |
|
53 | - * @param IRequest $request |
|
54 | - * @param IURLGenerator $urlGenerator |
|
55 | - * @param ClientMapper $clientMapper |
|
56 | - * @param ISession $session |
|
57 | - * @param IL10N $l |
|
58 | - */ |
|
59 | - public function __construct(string $appName, |
|
60 | - IRequest $request, |
|
61 | - IURLGenerator $urlGenerator, |
|
62 | - ClientMapper $clientMapper, |
|
63 | - ISession $session, |
|
64 | - IL10N $l) { |
|
65 | - parent::__construct($appName, $request); |
|
66 | - $this->urlGenerator = $urlGenerator; |
|
67 | - $this->clientMapper = $clientMapper; |
|
68 | - $this->session = $session; |
|
69 | - $this->l = $l; |
|
70 | - } |
|
51 | + /** |
|
52 | + * @param string $appName |
|
53 | + * @param IRequest $request |
|
54 | + * @param IURLGenerator $urlGenerator |
|
55 | + * @param ClientMapper $clientMapper |
|
56 | + * @param ISession $session |
|
57 | + * @param IL10N $l |
|
58 | + */ |
|
59 | + public function __construct(string $appName, |
|
60 | + IRequest $request, |
|
61 | + IURLGenerator $urlGenerator, |
|
62 | + ClientMapper $clientMapper, |
|
63 | + ISession $session, |
|
64 | + IL10N $l) { |
|
65 | + parent::__construct($appName, $request); |
|
66 | + $this->urlGenerator = $urlGenerator; |
|
67 | + $this->clientMapper = $clientMapper; |
|
68 | + $this->session = $session; |
|
69 | + $this->l = $l; |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * @PublicPage |
|
74 | - * @NoCSRFRequired |
|
75 | - * @UseSession |
|
76 | - * |
|
77 | - * @param string $client_id |
|
78 | - * @param string $state |
|
79 | - * @param string $response_type |
|
80 | - * @return Response |
|
81 | - */ |
|
82 | - public function authorize($client_id, |
|
83 | - $state, |
|
84 | - $response_type): Response { |
|
85 | - try { |
|
86 | - $client = $this->clientMapper->getByIdentifier($client_id); |
|
87 | - } catch (ClientNotFoundException $e) { |
|
88 | - $params = [ |
|
89 | - 'content' => $this->l->t('Your client is not authorized to connect. Please inform the administrator of your client.'), |
|
90 | - ]; |
|
91 | - return new TemplateResponse('core', '404', $params, 'guest'); |
|
92 | - } |
|
72 | + /** |
|
73 | + * @PublicPage |
|
74 | + * @NoCSRFRequired |
|
75 | + * @UseSession |
|
76 | + * |
|
77 | + * @param string $client_id |
|
78 | + * @param string $state |
|
79 | + * @param string $response_type |
|
80 | + * @return Response |
|
81 | + */ |
|
82 | + public function authorize($client_id, |
|
83 | + $state, |
|
84 | + $response_type): Response { |
|
85 | + try { |
|
86 | + $client = $this->clientMapper->getByIdentifier($client_id); |
|
87 | + } catch (ClientNotFoundException $e) { |
|
88 | + $params = [ |
|
89 | + 'content' => $this->l->t('Your client is not authorized to connect. Please inform the administrator of your client.'), |
|
90 | + ]; |
|
91 | + return new TemplateResponse('core', '404', $params, 'guest'); |
|
92 | + } |
|
93 | 93 | |
94 | - if ($response_type !== 'code') { |
|
95 | - //Fail |
|
96 | - $url = $client->getRedirectUri() . '?error=unsupported_response_type&state=' . $state; |
|
97 | - return new RedirectResponse($url); |
|
98 | - } |
|
94 | + if ($response_type !== 'code') { |
|
95 | + //Fail |
|
96 | + $url = $client->getRedirectUri() . '?error=unsupported_response_type&state=' . $state; |
|
97 | + return new RedirectResponse($url); |
|
98 | + } |
|
99 | 99 | |
100 | - $this->session->set('oauth.state', $state); |
|
100 | + $this->session->set('oauth.state', $state); |
|
101 | 101 | |
102 | - $targetUrl = $this->urlGenerator->linkToRouteAbsolute( |
|
103 | - 'core.ClientFlowLogin.showAuthPickerPage', |
|
104 | - [ |
|
105 | - 'clientIdentifier' => $client->getClientIdentifier(), |
|
106 | - ] |
|
107 | - ); |
|
108 | - return new RedirectResponse($targetUrl); |
|
109 | - } |
|
102 | + $targetUrl = $this->urlGenerator->linkToRouteAbsolute( |
|
103 | + 'core.ClientFlowLogin.showAuthPickerPage', |
|
104 | + [ |
|
105 | + 'clientIdentifier' => $client->getClientIdentifier(), |
|
106 | + ] |
|
107 | + ); |
|
108 | + return new RedirectResponse($targetUrl); |
|
109 | + } |
|
110 | 110 | } |
@@ -25,10 +25,10 @@ |
||
25 | 25 | use OCP\IL10N; |
26 | 26 | |
27 | 27 | class KerberosAuth extends AuthMechanism { |
28 | - public function __construct(IL10N $l) { |
|
29 | - $this |
|
30 | - ->setIdentifier('smb::kerberos') |
|
31 | - ->setScheme(self::SCHEME_SMB) |
|
32 | - ->setText($l->t('Kerberos ticket')); |
|
33 | - } |
|
28 | + public function __construct(IL10N $l) { |
|
29 | + $this |
|
30 | + ->setIdentifier('smb::kerberos') |
|
31 | + ->setScheme(self::SCHEME_SMB) |
|
32 | + ->setText($l->t('Kerberos ticket')); |
|
33 | + } |
|
34 | 34 | } |
@@ -27,37 +27,37 @@ |
||
27 | 27 | |
28 | 28 | class CloudFederationFactory implements ICloudFederationFactory { |
29 | 29 | |
30 | - /** |
|
31 | - * get a CloudFederationShare Object to prepare a share you want to send |
|
32 | - * |
|
33 | - * @param string $shareWith |
|
34 | - * @param string $name resource name (e.g. document.odt) |
|
35 | - * @param string $description share description (optional) |
|
36 | - * @param string $providerId resource UID on the provider side |
|
37 | - * @param string $owner provider specific UID of the user who owns the resource |
|
38 | - * @param string $ownerDisplayName display name of the user who shared the item |
|
39 | - * @param string $sharedBy provider specific UID of the user who shared the resource |
|
40 | - * @param string $sharedByDisplayName display name of the user who shared the resource |
|
41 | - * @param string $sharedSecret used to authenticate requests across servers |
|
42 | - * @param string $shareType ('group' or 'user' share) |
|
43 | - * @param $resourceType ('file', 'calendar',...) |
|
44 | - * @return ICloudFederationShare |
|
45 | - * |
|
46 | - * @since 14.0.0 |
|
47 | - */ |
|
48 | - public function getCloudFederationShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $sharedSecret, $shareType, $resourceType) { |
|
49 | - return new CloudFederationShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $shareType, $resourceType, $sharedSecret); |
|
50 | - } |
|
30 | + /** |
|
31 | + * get a CloudFederationShare Object to prepare a share you want to send |
|
32 | + * |
|
33 | + * @param string $shareWith |
|
34 | + * @param string $name resource name (e.g. document.odt) |
|
35 | + * @param string $description share description (optional) |
|
36 | + * @param string $providerId resource UID on the provider side |
|
37 | + * @param string $owner provider specific UID of the user who owns the resource |
|
38 | + * @param string $ownerDisplayName display name of the user who shared the item |
|
39 | + * @param string $sharedBy provider specific UID of the user who shared the resource |
|
40 | + * @param string $sharedByDisplayName display name of the user who shared the resource |
|
41 | + * @param string $sharedSecret used to authenticate requests across servers |
|
42 | + * @param string $shareType ('group' or 'user' share) |
|
43 | + * @param $resourceType ('file', 'calendar',...) |
|
44 | + * @return ICloudFederationShare |
|
45 | + * |
|
46 | + * @since 14.0.0 |
|
47 | + */ |
|
48 | + public function getCloudFederationShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $sharedSecret, $shareType, $resourceType) { |
|
49 | + return new CloudFederationShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $shareType, $resourceType, $sharedSecret); |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * get a Cloud FederationNotification object to prepare a notification you |
|
54 | - * want to send |
|
55 | - * |
|
56 | - * @return ICloudFederationNotification |
|
57 | - * |
|
58 | - * @since 14.0.0 |
|
59 | - */ |
|
60 | - public function getCloudFederationNotification() { |
|
61 | - return new CloudFederationNotification(); |
|
62 | - } |
|
52 | + /** |
|
53 | + * get a Cloud FederationNotification object to prepare a notification you |
|
54 | + * want to send |
|
55 | + * |
|
56 | + * @return ICloudFederationNotification |
|
57 | + * |
|
58 | + * @since 14.0.0 |
|
59 | + */ |
|
60 | + public function getCloudFederationNotification() { |
|
61 | + return new CloudFederationNotification(); |
|
62 | + } |
|
63 | 63 | } |
@@ -129,7 +129,7 @@ |
||
129 | 129 | $data = $result->fetchAll(); |
130 | 130 | $result->closeCursor(); |
131 | 131 | |
132 | - $entities = array_map(function ($row) { |
|
132 | + $entities = array_map(function($row) { |
|
133 | 133 | return PublicKeyToken::fromRow($row); |
134 | 134 | }, $data); |
135 | 135 |
@@ -36,158 +36,158 @@ |
||
36 | 36 | * @template-extends QBMapper<PublicKeyToken> |
37 | 37 | */ |
38 | 38 | class PublicKeyTokenMapper extends QBMapper { |
39 | - public function __construct(IDBConnection $db) { |
|
40 | - parent::__construct($db, 'authtoken'); |
|
41 | - } |
|
42 | - |
|
43 | - /** |
|
44 | - * Invalidate (delete) a given token |
|
45 | - * |
|
46 | - * @param string $token |
|
47 | - */ |
|
48 | - public function invalidate(string $token) { |
|
49 | - /* @var $qb IQueryBuilder */ |
|
50 | - $qb = $this->db->getQueryBuilder(); |
|
51 | - $qb->delete('authtoken') |
|
52 | - ->where($qb->expr()->eq('token', $qb->createNamedParameter($token))) |
|
53 | - ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
54 | - ->execute(); |
|
55 | - } |
|
56 | - |
|
57 | - /** |
|
58 | - * @param int $olderThan |
|
59 | - * @param int $remember |
|
60 | - */ |
|
61 | - public function invalidateOld(int $olderThan, int $remember = IToken::DO_NOT_REMEMBER) { |
|
62 | - /* @var $qb IQueryBuilder */ |
|
63 | - $qb = $this->db->getQueryBuilder(); |
|
64 | - $qb->delete('authtoken') |
|
65 | - ->where($qb->expr()->lt('last_activity', $qb->createNamedParameter($olderThan, IQueryBuilder::PARAM_INT))) |
|
66 | - ->andWhere($qb->expr()->eq('type', $qb->createNamedParameter(IToken::TEMPORARY_TOKEN, IQueryBuilder::PARAM_INT))) |
|
67 | - ->andWhere($qb->expr()->eq('remember', $qb->createNamedParameter($remember, IQueryBuilder::PARAM_INT))) |
|
68 | - ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
69 | - ->execute(); |
|
70 | - } |
|
71 | - |
|
72 | - /** |
|
73 | - * Get the user UID for the given token |
|
74 | - * |
|
75 | - * @throws DoesNotExistException |
|
76 | - */ |
|
77 | - public function getToken(string $token): PublicKeyToken { |
|
78 | - /* @var $qb IQueryBuilder */ |
|
79 | - $qb = $this->db->getQueryBuilder(); |
|
80 | - $result = $qb->select('*') |
|
81 | - ->from('authtoken') |
|
82 | - ->where($qb->expr()->eq('token', $qb->createNamedParameter($token))) |
|
83 | - ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
84 | - ->execute(); |
|
85 | - |
|
86 | - $data = $result->fetch(); |
|
87 | - $result->closeCursor(); |
|
88 | - if ($data === false) { |
|
89 | - throw new DoesNotExistException('token does not exist'); |
|
90 | - } |
|
91 | - return PublicKeyToken::fromRow($data); |
|
92 | - } |
|
93 | - |
|
94 | - /** |
|
95 | - * Get the token for $id |
|
96 | - * |
|
97 | - * @throws DoesNotExistException |
|
98 | - */ |
|
99 | - public function getTokenById(int $id): PublicKeyToken { |
|
100 | - /* @var $qb IQueryBuilder */ |
|
101 | - $qb = $this->db->getQueryBuilder(); |
|
102 | - $result = $qb->select('*') |
|
103 | - ->from('authtoken') |
|
104 | - ->where($qb->expr()->eq('id', $qb->createNamedParameter($id))) |
|
105 | - ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
106 | - ->execute(); |
|
107 | - |
|
108 | - $data = $result->fetch(); |
|
109 | - $result->closeCursor(); |
|
110 | - if ($data === false) { |
|
111 | - throw new DoesNotExistException('token does not exist'); |
|
112 | - } |
|
113 | - return PublicKeyToken::fromRow($data); |
|
114 | - } |
|
115 | - |
|
116 | - /** |
|
117 | - * Get all tokens of a user |
|
118 | - * |
|
119 | - * The provider may limit the number of result rows in case of an abuse |
|
120 | - * where a high number of (session) tokens is generated |
|
121 | - * |
|
122 | - * @param string $uid |
|
123 | - * @return PublicKeyToken[] |
|
124 | - */ |
|
125 | - public function getTokenByUser(string $uid): array { |
|
126 | - /* @var $qb IQueryBuilder */ |
|
127 | - $qb = $this->db->getQueryBuilder(); |
|
128 | - $qb->select('*') |
|
129 | - ->from('authtoken') |
|
130 | - ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) |
|
131 | - ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
132 | - ->setMaxResults(1000); |
|
133 | - $result = $qb->execute(); |
|
134 | - $data = $result->fetchAll(); |
|
135 | - $result->closeCursor(); |
|
136 | - |
|
137 | - $entities = array_map(function ($row) { |
|
138 | - return PublicKeyToken::fromRow($row); |
|
139 | - }, $data); |
|
140 | - |
|
141 | - return $entities; |
|
142 | - } |
|
143 | - |
|
144 | - public function deleteById(string $uid, int $id) { |
|
145 | - /* @var $qb IQueryBuilder */ |
|
146 | - $qb = $this->db->getQueryBuilder(); |
|
147 | - $qb->delete('authtoken') |
|
148 | - ->where($qb->expr()->eq('id', $qb->createNamedParameter($id))) |
|
149 | - ->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) |
|
150 | - ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))); |
|
151 | - $qb->execute(); |
|
152 | - } |
|
153 | - |
|
154 | - /** |
|
155 | - * delete all auth token which belong to a specific client if the client was deleted |
|
156 | - * |
|
157 | - * @param string $name |
|
158 | - */ |
|
159 | - public function deleteByName(string $name) { |
|
160 | - $qb = $this->db->getQueryBuilder(); |
|
161 | - $qb->delete('authtoken') |
|
162 | - ->where($qb->expr()->eq('name', $qb->createNamedParameter($name), IQueryBuilder::PARAM_STR)) |
|
163 | - ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))); |
|
164 | - $qb->execute(); |
|
165 | - } |
|
166 | - |
|
167 | - public function deleteTempToken(PublicKeyToken $except) { |
|
168 | - $qb = $this->db->getQueryBuilder(); |
|
169 | - |
|
170 | - $qb->delete('authtoken') |
|
171 | - ->where($qb->expr()->eq('uid', $qb->createNamedParameter($except->getUID()))) |
|
172 | - ->andWhere($qb->expr()->eq('type', $qb->createNamedParameter(IToken::TEMPORARY_TOKEN))) |
|
173 | - ->andWhere($qb->expr()->neq('id', $qb->createNamedParameter($except->getId()))) |
|
174 | - ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))); |
|
175 | - |
|
176 | - $qb->execute(); |
|
177 | - } |
|
178 | - |
|
179 | - public function hasExpiredTokens(string $uid): bool { |
|
180 | - $qb = $this->db->getQueryBuilder(); |
|
181 | - $qb->select('*') |
|
182 | - ->from('authtoken') |
|
183 | - ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) |
|
184 | - ->andWhere($qb->expr()->eq('password_invalid', $qb->createNamedParameter(true), IQueryBuilder::PARAM_BOOL)) |
|
185 | - ->setMaxResults(1); |
|
186 | - |
|
187 | - $cursor = $qb->execute(); |
|
188 | - $data = $cursor->fetchAll(); |
|
189 | - $cursor->closeCursor(); |
|
190 | - |
|
191 | - return count($data) === 1; |
|
192 | - } |
|
39 | + public function __construct(IDBConnection $db) { |
|
40 | + parent::__construct($db, 'authtoken'); |
|
41 | + } |
|
42 | + |
|
43 | + /** |
|
44 | + * Invalidate (delete) a given token |
|
45 | + * |
|
46 | + * @param string $token |
|
47 | + */ |
|
48 | + public function invalidate(string $token) { |
|
49 | + /* @var $qb IQueryBuilder */ |
|
50 | + $qb = $this->db->getQueryBuilder(); |
|
51 | + $qb->delete('authtoken') |
|
52 | + ->where($qb->expr()->eq('token', $qb->createNamedParameter($token))) |
|
53 | + ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
54 | + ->execute(); |
|
55 | + } |
|
56 | + |
|
57 | + /** |
|
58 | + * @param int $olderThan |
|
59 | + * @param int $remember |
|
60 | + */ |
|
61 | + public function invalidateOld(int $olderThan, int $remember = IToken::DO_NOT_REMEMBER) { |
|
62 | + /* @var $qb IQueryBuilder */ |
|
63 | + $qb = $this->db->getQueryBuilder(); |
|
64 | + $qb->delete('authtoken') |
|
65 | + ->where($qb->expr()->lt('last_activity', $qb->createNamedParameter($olderThan, IQueryBuilder::PARAM_INT))) |
|
66 | + ->andWhere($qb->expr()->eq('type', $qb->createNamedParameter(IToken::TEMPORARY_TOKEN, IQueryBuilder::PARAM_INT))) |
|
67 | + ->andWhere($qb->expr()->eq('remember', $qb->createNamedParameter($remember, IQueryBuilder::PARAM_INT))) |
|
68 | + ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
69 | + ->execute(); |
|
70 | + } |
|
71 | + |
|
72 | + /** |
|
73 | + * Get the user UID for the given token |
|
74 | + * |
|
75 | + * @throws DoesNotExistException |
|
76 | + */ |
|
77 | + public function getToken(string $token): PublicKeyToken { |
|
78 | + /* @var $qb IQueryBuilder */ |
|
79 | + $qb = $this->db->getQueryBuilder(); |
|
80 | + $result = $qb->select('*') |
|
81 | + ->from('authtoken') |
|
82 | + ->where($qb->expr()->eq('token', $qb->createNamedParameter($token))) |
|
83 | + ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
84 | + ->execute(); |
|
85 | + |
|
86 | + $data = $result->fetch(); |
|
87 | + $result->closeCursor(); |
|
88 | + if ($data === false) { |
|
89 | + throw new DoesNotExistException('token does not exist'); |
|
90 | + } |
|
91 | + return PublicKeyToken::fromRow($data); |
|
92 | + } |
|
93 | + |
|
94 | + /** |
|
95 | + * Get the token for $id |
|
96 | + * |
|
97 | + * @throws DoesNotExistException |
|
98 | + */ |
|
99 | + public function getTokenById(int $id): PublicKeyToken { |
|
100 | + /* @var $qb IQueryBuilder */ |
|
101 | + $qb = $this->db->getQueryBuilder(); |
|
102 | + $result = $qb->select('*') |
|
103 | + ->from('authtoken') |
|
104 | + ->where($qb->expr()->eq('id', $qb->createNamedParameter($id))) |
|
105 | + ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
106 | + ->execute(); |
|
107 | + |
|
108 | + $data = $result->fetch(); |
|
109 | + $result->closeCursor(); |
|
110 | + if ($data === false) { |
|
111 | + throw new DoesNotExistException('token does not exist'); |
|
112 | + } |
|
113 | + return PublicKeyToken::fromRow($data); |
|
114 | + } |
|
115 | + |
|
116 | + /** |
|
117 | + * Get all tokens of a user |
|
118 | + * |
|
119 | + * The provider may limit the number of result rows in case of an abuse |
|
120 | + * where a high number of (session) tokens is generated |
|
121 | + * |
|
122 | + * @param string $uid |
|
123 | + * @return PublicKeyToken[] |
|
124 | + */ |
|
125 | + public function getTokenByUser(string $uid): array { |
|
126 | + /* @var $qb IQueryBuilder */ |
|
127 | + $qb = $this->db->getQueryBuilder(); |
|
128 | + $qb->select('*') |
|
129 | + ->from('authtoken') |
|
130 | + ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) |
|
131 | + ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))) |
|
132 | + ->setMaxResults(1000); |
|
133 | + $result = $qb->execute(); |
|
134 | + $data = $result->fetchAll(); |
|
135 | + $result->closeCursor(); |
|
136 | + |
|
137 | + $entities = array_map(function ($row) { |
|
138 | + return PublicKeyToken::fromRow($row); |
|
139 | + }, $data); |
|
140 | + |
|
141 | + return $entities; |
|
142 | + } |
|
143 | + |
|
144 | + public function deleteById(string $uid, int $id) { |
|
145 | + /* @var $qb IQueryBuilder */ |
|
146 | + $qb = $this->db->getQueryBuilder(); |
|
147 | + $qb->delete('authtoken') |
|
148 | + ->where($qb->expr()->eq('id', $qb->createNamedParameter($id))) |
|
149 | + ->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) |
|
150 | + ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))); |
|
151 | + $qb->execute(); |
|
152 | + } |
|
153 | + |
|
154 | + /** |
|
155 | + * delete all auth token which belong to a specific client if the client was deleted |
|
156 | + * |
|
157 | + * @param string $name |
|
158 | + */ |
|
159 | + public function deleteByName(string $name) { |
|
160 | + $qb = $this->db->getQueryBuilder(); |
|
161 | + $qb->delete('authtoken') |
|
162 | + ->where($qb->expr()->eq('name', $qb->createNamedParameter($name), IQueryBuilder::PARAM_STR)) |
|
163 | + ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))); |
|
164 | + $qb->execute(); |
|
165 | + } |
|
166 | + |
|
167 | + public function deleteTempToken(PublicKeyToken $except) { |
|
168 | + $qb = $this->db->getQueryBuilder(); |
|
169 | + |
|
170 | + $qb->delete('authtoken') |
|
171 | + ->where($qb->expr()->eq('uid', $qb->createNamedParameter($except->getUID()))) |
|
172 | + ->andWhere($qb->expr()->eq('type', $qb->createNamedParameter(IToken::TEMPORARY_TOKEN))) |
|
173 | + ->andWhere($qb->expr()->neq('id', $qb->createNamedParameter($except->getId()))) |
|
174 | + ->andWhere($qb->expr()->eq('version', $qb->createNamedParameter(PublicKeyToken::VERSION, IQueryBuilder::PARAM_INT))); |
|
175 | + |
|
176 | + $qb->execute(); |
|
177 | + } |
|
178 | + |
|
179 | + public function hasExpiredTokens(string $uid): bool { |
|
180 | + $qb = $this->db->getQueryBuilder(); |
|
181 | + $qb->select('*') |
|
182 | + ->from('authtoken') |
|
183 | + ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) |
|
184 | + ->andWhere($qb->expr()->eq('password_invalid', $qb->createNamedParameter(true), IQueryBuilder::PARAM_BOOL)) |
|
185 | + ->setMaxResults(1); |
|
186 | + |
|
187 | + $cursor = $qb->execute(); |
|
188 | + $data = $cursor->fetchAll(); |
|
189 | + $cursor->closeCursor(); |
|
190 | + |
|
191 | + return count($data) === 1; |
|
192 | + } |
|
193 | 193 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $l = \OC::$server->getL10N('federation'); |
37 | 37 | $this->parameterList = $missingParameters; |
38 | 38 | $parameterList = implode(',', $missingParameters); |
39 | - $message = 'Parameters missing in order to complete the request. Missing Parameters: ' . $parameterList; |
|
39 | + $message = 'Parameters missing in order to complete the request. Missing Parameters: '.$parameterList; |
|
40 | 40 | $hint = $l->t('Parameters missing in order to complete the request. Missing Parameters: "%s"', [$parameterList]); |
41 | 41 | parent::__construct($message, $hint); |
42 | 42 | } |
@@ -32,45 +32,45 @@ |
||
32 | 32 | * @since 14.0.0 |
33 | 33 | */ |
34 | 34 | class BadRequestException extends HintException { |
35 | - private $parameterList; |
|
35 | + private $parameterList; |
|
36 | 36 | |
37 | - /** |
|
38 | - * BadRequestException constructor. |
|
39 | - * |
|
40 | - * @since 14.0.0 |
|
41 | - * |
|
42 | - * @param array $missingParameters |
|
43 | - */ |
|
44 | - public function __construct(array $missingParameters) { |
|
45 | - $l = \OC::$server->getL10N('federation'); |
|
46 | - $this->parameterList = $missingParameters; |
|
47 | - $parameterList = implode(',', $missingParameters); |
|
48 | - $message = 'Parameters missing in order to complete the request. Missing Parameters: ' . $parameterList; |
|
49 | - $hint = $l->t('Parameters missing in order to complete the request. Missing Parameters: "%s"', [$parameterList]); |
|
50 | - parent::__construct($message, $hint); |
|
51 | - } |
|
37 | + /** |
|
38 | + * BadRequestException constructor. |
|
39 | + * |
|
40 | + * @since 14.0.0 |
|
41 | + * |
|
42 | + * @param array $missingParameters |
|
43 | + */ |
|
44 | + public function __construct(array $missingParameters) { |
|
45 | + $l = \OC::$server->getL10N('federation'); |
|
46 | + $this->parameterList = $missingParameters; |
|
47 | + $parameterList = implode(',', $missingParameters); |
|
48 | + $message = 'Parameters missing in order to complete the request. Missing Parameters: ' . $parameterList; |
|
49 | + $hint = $l->t('Parameters missing in order to complete the request. Missing Parameters: "%s"', [$parameterList]); |
|
50 | + parent::__construct($message, $hint); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * get array with the return message as defined in the OCM API |
|
55 | - * |
|
56 | - * @since 14.0.0 |
|
57 | - * |
|
58 | - * @return array |
|
59 | - */ |
|
60 | - public function getReturnMessage() { |
|
61 | - $result = [ |
|
62 | - 'message' => 'RESOURCE_NOT_FOUND', |
|
63 | - 'validationErrors' => [ |
|
64 | - ] |
|
65 | - ]; |
|
53 | + /** |
|
54 | + * get array with the return message as defined in the OCM API |
|
55 | + * |
|
56 | + * @since 14.0.0 |
|
57 | + * |
|
58 | + * @return array |
|
59 | + */ |
|
60 | + public function getReturnMessage() { |
|
61 | + $result = [ |
|
62 | + 'message' => 'RESOURCE_NOT_FOUND', |
|
63 | + 'validationErrors' => [ |
|
64 | + ] |
|
65 | + ]; |
|
66 | 66 | |
67 | - foreach ($this->parameterList as $missingParameter) { |
|
68 | - $result['validationErrors'] = [ |
|
69 | - 'name' => $missingParameter, |
|
70 | - 'message' => 'NOT_FOUND' |
|
71 | - ]; |
|
72 | - } |
|
67 | + foreach ($this->parameterList as $missingParameter) { |
|
68 | + $result['validationErrors'] = [ |
|
69 | + 'name' => $missingParameter, |
|
70 | + 'message' => 'NOT_FOUND' |
|
71 | + ]; |
|
72 | + } |
|
73 | 73 | |
74 | - return $result; |
|
75 | - } |
|
74 | + return $result; |
|
75 | + } |
|
76 | 76 | } |