From 1584bc2c3223131ecf8bfe249cf3dd2095618137 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 29 Dec 2018 18:36:10 +0100 Subject: [PATCH 1/4] add links --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index 002bfb5..6fc9818 100644 --- a/README.rst +++ b/README.rst @@ -58,3 +58,10 @@ The address books are only found if the ``principaluri`` in the ``oc_addressbook table equals ``principals/users/`` + ``$useremailaddress``. If you do not see all contacts: Only contacts with an e-mail address are shown. + + +Links +===== +- Git repository: https://git.cweiske.de/roundcube-nextcloud_sql_addressbook.git +- Git mirror: https://github.com/cweiske/roundcube-nextcloud_sql_addressbook +- Roundcube plugin page: https://plugins.roundcube.net/packages/cweiske/nextcloud_sql_addressbook -- 2.30.2 From c130567184c70c65b7bb0d8ce4a906517ff8d21c Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 19 Apr 2023 21:05:36 +0200 Subject: [PATCH 2/4] Add $db property .. to prevent PHP 8 from complaining about creation of dynamic properties --- nextcloud_sql_addressbook.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nextcloud_sql_addressbook.php b/nextcloud_sql_addressbook.php index 6b5bb9f..146aebe 100644 --- a/nextcloud_sql_addressbook.php +++ b/nextcloud_sql_addressbook.php @@ -24,7 +24,12 @@ class nextcloud_sql_addressbook extends rcube_plugin * @var string */ protected $prefix = 'oc_'; - + + /** + * Database instance + */ + protected $db; + /** * Initialization method, needs to be implemented by the plugin itself * @@ -37,12 +42,12 @@ class nextcloud_sql_addressbook extends rcube_plugin $this->add_hook('addressbook_get', [$this, 'addressbook_get']); $this->rcube = rcube::get_instance(); - + $this->db = rcube_db::factory( $this->rcube->config->get('nextcloud_sql_addressbook_dsn') ); $this->db->set_debug((bool) $this->rcube->config->get('sql_debug')); - + $this->prefix = $this->rcube->config->get( 'nextcloud_sql_addressbook_dbtableprefix', 'oc_' ); @@ -131,7 +136,7 @@ class nextcloud_sql_addressbook extends rcube_plugin $arguments['instance'] = new nextcloud_sql_addressbook_backend( $id, $this->db, $this->prefix ); - + return $arguments; } } -- 2.30.2 From d6adfd5c298e4b49b9c693ae7f431c70bf7621a3 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 21 Apr 2023 22:25:29 +0200 Subject: [PATCH 3/4] Fix PHP warning: Trying to access array offset on value of type null > PHP Warning: Trying to access array offset on value of type null > in plugins/nextcloud_sql_addressbook/nextcloud_sql_addressbook.php > on line 97 --- nextcloud_sql_addressbook.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nextcloud_sql_addressbook.php b/nextcloud_sql_addressbook.php index 146aebe..5c52fde 100644 --- a/nextcloud_sql_addressbook.php +++ b/nextcloud_sql_addressbook.php @@ -93,6 +93,10 @@ class nextcloud_sql_addressbook extends rcube_plugin */ protected function listAddressbooks() { + if (!isset($this->rcube->user->data)) { + return []; + } + $principalUri = 'principals/users/' . $this->rcube->user->data['username']; -- 2.30.2 From 652da7630efa8a127dac8d1cb6f740e4bd46493c Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 21 Apr 2023 22:26:16 +0200 Subject: [PATCH 4/4] Fix PHP deprecation: Passing null to parameter #2 ($string) of type string > PHP Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated > in plugins/nextcloud_sql_addressbook/nextcloud_sql_addressbook.php > on line 128 --- nextcloud_sql_addressbook.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nextcloud_sql_addressbook.php b/nextcloud_sql_addressbook.php index 5c52fde..19cb8f1 100644 --- a/nextcloud_sql_addressbook.php +++ b/nextcloud_sql_addressbook.php @@ -129,6 +129,9 @@ class nextcloud_sql_addressbook extends rcube_plugin */ public function addressbook_get($arguments) { + if (!isset($arguments['id'])) { + return $arguments; + } $parts = explode('_', $arguments['id'], 2); if (count($parts) != 2 || $parts[0] != 'nextcloud') { return $arguments; -- 2.30.2