Store user's UID in session for use by other plugins (e.g. owncloud)
Small code style fixes
This commit is contained in:
parent
95c6c727fc
commit
d1fecda9de
2 changed files with 19 additions and 5 deletions
|
@ -346,6 +346,9 @@ class kolab_auth extends rcube_plugin
|
||||||
|
|
||||||
// Set credentials
|
// Set credentials
|
||||||
if ($record) {
|
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)
|
if ($login_attr)
|
||||||
$this->data['user_login'] = is_array($record[$login_attr]) ? $record[$login_attr][0] : $record[$login_attr];
|
$this->data['user_login'] = is_array($record[$login_attr]) ? $record[$login_attr][0] : $record[$login_attr];
|
||||||
if ($alias_attr)
|
if ($alias_attr)
|
||||||
|
@ -405,8 +408,9 @@ class kolab_auth extends rcube_plugin
|
||||||
*/
|
*/
|
||||||
private function init_ldap()
|
private function init_ldap()
|
||||||
{
|
{
|
||||||
if ($this->ldap)
|
if ($this->ldap) {
|
||||||
return $this->ldap->ready;
|
return $this->ldap->ready;
|
||||||
|
}
|
||||||
|
|
||||||
$rcmail = rcmail::get_instance();
|
$rcmail = rcmail::get_instance();
|
||||||
|
|
||||||
|
@ -447,9 +451,10 @@ class kolab_auth extends rcube_plugin
|
||||||
$this->ldap->set_filter($filter);
|
$this->ldap->set_filter($filter);
|
||||||
$results = $this->ldap->list_records();
|
$results = $this->ldap->list_records();
|
||||||
|
|
||||||
if (count($results->records) == 1)
|
if (count($results->records) == 1) {
|
||||||
return $results->records[0];
|
return $results->records[0];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares filter query for LDAP search
|
* Prepares filter query for LDAP search
|
||||||
|
@ -480,9 +485,16 @@ class kolab_auth extends rcube_plugin
|
||||||
*/
|
*/
|
||||||
class kolab_auth_ldap_backend extends rcube_ldap
|
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)
|
function set_filter($filter)
|
||||||
{
|
{
|
||||||
if ($filter)
|
if ($filter) {
|
||||||
$this->prop['filter'] = $filter;
|
$this->prop['filter'] = $filter;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
<email>machniak@kolabsys.com</email>
|
<email>machniak@kolabsys.com</email>
|
||||||
<active>yes</active>
|
<active>yes</active>
|
||||||
</lead>
|
</lead>
|
||||||
<date>2011-11-01</date>
|
<date>2012-02-29</date>
|
||||||
<version>
|
<version>
|
||||||
<release>0.1</release>
|
<release>0.2</release>
|
||||||
<api>0.1</api>
|
<api>0.1</api>
|
||||||
</version>
|
</version>
|
||||||
<stability>
|
<stability>
|
||||||
|
@ -38,6 +38,8 @@
|
||||||
<file name="config.inc.php.dist" role="data"></file>
|
<file name="config.inc.php.dist" role="data"></file>
|
||||||
<file name="LICENSE" 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/en_US.inc" role="data"></file>
|
||||||
<file name="localization/pl_PL.inc" role="data"></file>
|
<file name="localization/pl_PL.inc" role="data"></file>
|
||||||
</dir>
|
</dir>
|
||||||
|
|
Loading…
Add table
Reference in a new issue