Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117752285
D5853.1775188720.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D5853.1775188720.diff
View Options
diff --git a/plugins/kolab/Kolab/Delegation.php b/plugins/kolab/Kolab/Delegation.php
--- a/plugins/kolab/Kolab/Delegation.php
+++ b/plugins/kolab/Kolab/Delegation.php
@@ -384,6 +384,11 @@
{
if ($this->delegators === null) {
$this->delegators = [];
+
+ if (in_array('delegation', (array) $this->rc->config->get('kolab-disabled-apis'))) {
+ return [];
+ }
+
foreach (Client::getDelegators() as $delegator) {
$this->delegators[$delegator->email] = [
'emails' => array_merge([$delegator->email], $delegator->aliases),
diff --git a/plugins/kolab/Kolab/Users.php b/plugins/kolab/Kolab/Users.php
--- a/plugins/kolab/Kolab/Users.php
+++ b/plugins/kolab/Kolab/Users.php
@@ -24,6 +24,10 @@
*/
public function readyHook($args): array
{
+ if (in_array('user-search', (array) $this->rc->config->get('kolab-disabled-apis'))) {
+ return $args;
+ }
+
$action = $args['task'] . '/' . $args['action'];
// Intercept the user autocompletion request
@@ -46,6 +50,7 @@
if (
$args['write'] === false // rendering of sub-pages
|| !in_array($this->rc->task, ['settings', 'calendar', 'tasks', 'addressbook'])
+ || in_array('user-search', (array) $this->rc->config->get('kolab-disabled-apis'))
) {
return $args;
}
diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php
--- a/plugins/kolab_files/lib/kolab_files_engine.php
+++ b/plugins/kolab_files/lib/kolab_files_engine.php
@@ -1075,8 +1075,8 @@
$response = $request->send();
$status = $response->getStatus();
- if ($status == 200 && ($body = json_decode($response->getBody(), true))) {
- $token = $body['result']['token'];
+ if ($status == 200 && ($body = json_decode($response->getBody(), true)) && !empty($body['result'])) {
+ $token = $body['result']['token'] ?? null;
if ($token) {
$_SESSION['kolab_files_token'] = $token;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 3:58 AM (16 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18822506
Default Alt Text
D5853.1775188720.diff (2 KB)
Attached To
Mode
D5853: Kolab: Don't use disabled APIs
Attached
Detach File
Event Timeline