Page MenuHomePhorge

D5361.1775444172.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D5361.1775444172.diff

diff --git a/plugins/kolab/Kolab/Client.php b/plugins/kolab/Kolab/Client.php
--- a/plugins/kolab/Kolab/Client.php
+++ b/plugins/kolab/Kolab/Client.php
@@ -130,8 +130,8 @@
private static function refreshAccessToken()
{
$rcube = \rcube::get_instance();
- $username = $_SESSION['username'];
- $password = $rcube->decrypt($_SESSION['password']);
+ $username = $rcube->get_user_name();
+ $password = $rcube->get_user_password();
$response = self::request('POST', 'api/auth/login', [], ['email' => $username, 'password' => $password]);
@@ -207,7 +207,9 @@
*/
public static function getMyConfig(): array
{
- if (!empty($_SESSION['username'])) {
+ $rcube = \rcube::get_instance();
+
+ if ($rcube->get_user_name() && $rcube->get_user_password()) {
$response = self::request('GET', 'api/v4/config/webmail');
if ($response) {
diff --git a/plugins/kolab/Kolab/Configuration.php b/plugins/kolab/Kolab/Configuration.php
--- a/plugins/kolab/Kolab/Configuration.php
+++ b/plugins/kolab/Kolab/Configuration.php
@@ -13,6 +13,7 @@
public function init()
{
$this->plugin->add_hook('startup', [$this, 'startupHook']);
+ $this->plugin->add_hook('ready', [$this, 'readyHook']);
}
/**
@@ -90,9 +91,24 @@
*/
public function startupHook($args): array
{
- $config = Client::getMyConfig();
+ // For Kolab Syncroton we have to use the 'ready' hook.
+ if ($args['task'] != 'syncroton') {
+ $this->applyConfiguration(Client::getMyConfig());
+ }
+
+ return $args;
+ }
- $this->applyConfiguration($config);
+ /**
+ * Ready hook handler
+ */
+ public function readyHook($args): array
+ {
+ // For Kolab Syncroton we have to use the 'ready' hook. In 'startup' hook
+ // user is not yet authenticated.
+ if ($args['task'] == 'syncroton') {
+ $this->applyConfiguration(Client::getMyConfig());
+ }
return $args;
}
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
@@ -215,7 +215,7 @@
// Initialize handling of delegators' identities in event/task form
if (
- $this->rc->output->type == 'html'
+ $this->rc->output?->type == 'html'
&& ($this->rc->task == 'calendar' || $this->rc->task == 'tasks')
&& empty($_REQUEST['_framed'])
) {
diff --git a/plugins/kolab/Kolab/Feature.php b/plugins/kolab/Kolab/Feature.php
--- a/plugins/kolab/Kolab/Feature.php
+++ b/plugins/kolab/Kolab/Feature.php
@@ -18,7 +18,7 @@
public function __construct(\rcube_plugin $plugin)
{
$this->plugin = $plugin;
- $this->rc = \rcmail::get_instance();
+ $this->rc = \rcube::get_instance();
}
/**

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 6, 2:56 AM (4 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18832326
Default Alt Text
D5361.1775444172.diff (2 KB)

Event Timeline