summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-02-29 12:09:43 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2012-02-29 12:09:43 (GMT)
commitd1fecda9de20afaa96b3657cb3557b83023aaed4 (patch)
tree3aa4391277a2023d58c8c7ea083b6963dfcfaec6
parent95c6c727fc16b2e2e86a4d978246aec086cebdf5 (diff)
downloadroundcubemail-plugins-kolab-d1fecda9de20afaa96b3657cb3557b83023aaed4.tar.gz
Store user's UID in session for use by other plugins (e.g. owncloud)
Small code style fixes
-rw-r--r--plugins/kolab_auth/kolab_auth.php18
-rw-r--r--plugins/kolab_auth/package.xml6
2 files changed, 19 insertions, 5 deletions
diff --git a/plugins/kolab_auth/kolab_auth.php b/plugins/kolab_auth/kolab_auth.php
index 07800cd..691f542 100644
--- a/plugins/kolab_auth/kolab_auth.php
+++ b/plugins/kolab_auth/kolab_auth.php
@@ -346,6 +346,9 @@ class kolab_auth extends rcube_plugin
// Set credentials
if ($record) {
+ // Store UID in session for use by other plugins
+ $_SESSION['kolab_uid'] = is_array($record['uid']) ? $record['uid'][0] : $record['uid'];
+
if ($login_attr)
$this->data['user_login'] = is_array($record[$login_attr]) ? $record[$login_attr][0] : $record[$login_attr];
if ($alias_attr)
@@ -405,8 +408,9 @@ class kolab_auth extends rcube_plugin
*/
private function init_ldap()
{
- if ($this->ldap)
+ if ($this->ldap) {
return $this->ldap->ready;
+ }
$rcmail = rcmail::get_instance();
@@ -447,8 +451,9 @@ class kolab_auth extends rcube_plugin
$this->ldap->set_filter($filter);
$results = $this->ldap->list_records();
- if (count($results->records) == 1)
+ if (count($results->records) == 1) {
return $results->records[0];
+ }
}
/**
@@ -480,9 +485,16 @@ class kolab_auth extends rcube_plugin
*/
class kolab_auth_ldap_backend extends rcube_ldap
{
+ function __construct($p, $debug=false, $mail_domain=null)
+ {
+ parent::__construct($p, $debug, $mail_domain);
+ $this->fieldmap['uid'] = 'uid';
+ }
+
function set_filter($filter)
{
- if ($filter)
+ if ($filter) {
$this->prop['filter'] = $filter;
+ }
}
}
diff --git a/plugins/kolab_auth/package.xml b/plugins/kolab_auth/package.xml
index 4c9b8ad..937798d 100644
--- a/plugins/kolab_auth/package.xml
+++ b/plugins/kolab_auth/package.xml
@@ -18,9 +18,9 @@
<email>machniak@kolabsys.com</email>
<active>yes</active>
</lead>
- <date>2011-11-01</date>
+ <date>2012-02-29</date>
<version>
- <release>0.1</release>
+ <release>0.2</release>
<api>0.1</api>
</version>
<stability>
@@ -38,6 +38,8 @@
<file name="config.inc.php.dist" role="data"></file>
<file name="LICENSE" role="data"></file>
+ <file name="localization/de_CH.inc" role="data"></file>
+ <file name="localization/de_DE.inc" role="data"></file>
<file name="localization/en_US.inc" role="data"></file>
<file name="localization/pl_PL.inc" role="data"></file>
</dir>