fixes and first successful tests with Ldap backend

This commit is contained in:
Ralf Becker 2016-03-08 08:13:26 +00:00
parent c329377c70
commit 564b2b0fd7
7 changed files with 16 additions and 13 deletions

View File

@ -54,7 +54,7 @@ class Ads
/** /**
* Reference to our frontend * Reference to our frontend
* *
* @var accounts * @var Api\Accounts
*/ */
protected $frontend; protected $frontend;
@ -116,10 +116,10 @@ class Ads
/** /**
* Constructor * Constructor
* *
* @param accounts $frontend reference to the frontend class, to be able to call it's methods if needed * @param Api\Accounts $frontend reference to the frontend class, to be able to call it's methods if needed
* @throws adLDAPException * @throws adLDAPException
*/ */
function __construct(accounts $frontend) function __construct(Api\Accounts $frontend)
{ {
$this->frontend = $frontend; $this->frontend = $frontend;

View File

@ -124,14 +124,14 @@ class Ldap
/** /**
* Reference to our frontend * Reference to our frontend
* *
* @var accounts * @var Api\Accounts
*/ */
private $frontend; private $frontend;
/** /**
* Instance of the ldap class * Instance of the ldap class
* *
* @var ldap * @var Api\Ldap
*/ */
private $ldap; private $ldap;
@ -148,17 +148,18 @@ class Ldap
/** /**
* Constructor * Constructor
* *
* @param accounts $frontend reference to the frontend class, to be able to call it's methods if needed * @param Api\Accounts $frontend reference to the frontend class, to be able to call it's methods if needed
*/ */
function __construct(accounts $frontend) function __construct(Api\Accounts $frontend)
{ {
$this->frontend = $frontend; $this->frontend = $frontend;
// enable the caching in the session, done by the accounts class extending this class. // enable the caching in the session, done by the accounts class extending this class.
$this->use_session_cache = true; $this->use_session_cache = true;
$this->ds = Api\Ldap::factory(true, $this->frontend->config['ldap_host'], $this->ldap = Api\Ldap::factory(false, $this->frontend->config['ldap_host'],
$this->frontend->config['ldap_root_dn'],$this->frontend->config['ldap_root_pw']); $this->frontend->config['ldap_root_dn'],$this->frontend->config['ldap_root_pw']);
$this->ds = $this->ldap->ds;
$this->user_context = $this->frontend->config['ldap_context']; $this->user_context = $this->frontend->config['ldap_context'];
$this->account_filter = $this->frontend->config['ldap_search_filter']; $this->account_filter = $this->frontend->config['ldap_search_filter'];

View File

@ -13,6 +13,8 @@
namespace EGroupware\Api\Accounts; namespace EGroupware\Api\Accounts;
use EGroupware\Api;
// explicitly reference classes still in phpgwapi // explicitly reference classes still in phpgwapi
use emailadmin_account; use emailadmin_account;

View File

@ -20,7 +20,7 @@ use EGroupware\Api;
* LDAP Backend for contacts, compatible with vars and parameters of eTemplate's so_sql. * LDAP Backend for contacts, compatible with vars and parameters of eTemplate's so_sql.
* Maybe one day this becomes a generalized ldap storage object :-) * Maybe one day this becomes a generalized ldap storage object :-)
* *
* All values used to construct filters need to run through ldap::quote(), * All values used to construct filters need to run through Api\Ldap::quote(),
* to be save against LDAP query injection!!! * to be save against LDAP query injection!!!
*/ */
class Ldap class Ldap
@ -375,7 +375,7 @@ class Ldap
*/ */
protected function id_filter($id) protected function id_filter($id)
{ {
return '(|(entryUUID='.ldap::quote($id).')(uid='.ldap::quote($id).'))'; return '(|(entryUUID='.Api\Ldap::quote($id).')(uid='.Api\Ldap::quote($id).'))';
} }
/** /**

View File

@ -294,7 +294,7 @@ class Ldap
{ {
if (isset($GLOBALS['egw']->session)) // no availible in setup if (isset($GLOBALS['egw']->session)) // no availible in setup
{ {
Cache::getSession(__CLASS__, 'ldapServerInfo', $this->ldapserverinfo); Cache::setSession(__CLASS__, 'ldapServerInfo', $this->ldapserverinfo);
} }
} }
} }

View File

@ -755,7 +755,7 @@ class common
* *
* @deprecated use Api\Image::invalidate() * @deprecated use Api\Image::invalidate()
*/ */
public static function delete_map() public static function delete_image_map()
{ {
return Api\Image::invalidate(); return Api\Image::invalidate();
} }

View File

@ -667,8 +667,8 @@ class egw_minimal
'datetime' => 'egw_datetime', 'datetime' => 'egw_datetime',
'framework' => true, // special handling in __get() 'framework' => true, // special handling in __get()
'template' => 'Template', 'template' => 'Template',
'session' => 'egw_session', // otherwise $GLOBALS['egw']->session->appsession() fails
// classes moved to new api dir // classes moved to new api dir
'session' => 'EGroupware\\Api\\Session',
'ldap' => true, 'ldap' => true,
'auth' => 'EGroupware\\Api\\Auth', 'auth' => 'EGroupware\\Api\\Auth',
); );