1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ttrss_ynh.git synced 2024-10-01 13:34:46 +02:00

Update init.php

This commit is contained in:
ericgaspar 2022-02-23 16:04:01 +01:00
parent 2a53b0f574
commit 9297b6327a
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -12,14 +12,14 @@
* Configuration * Configuration
* Put the following options in config.php and customize them for your environment * Put the following options in config.php and customize them for your environment
* *
* define('LDAP_AUTH_SERVER_URI', 'ldaps://LDAPServerHostname:port/'); * define('LDAP_AUTH_SERVER_URI', 'ldaps://LDAPServerHostname:port/');
* define('LDAP_AUTH_USETLS', FALSE); // Enable TLS Support for ldaps:// * define('LDAP_AUTH_USETLS', FALSE); // Enable TLS Support for ldaps://
* define('LDAP_AUTH_ALLOW_UNTRUSTED_CERT', TRUE); // Allows untrusted certificate * define('LDAP_AUTH_ALLOW_UNTRUSTED_CERT', TRUE); // Allows untrusted certificate
* define('LDAP_AUTH_BASEDN', 'dc=example,dc=com'); * define('LDAP_AUTH_BASEDN', 'dc=example,dc=com');
* define('LDAP_AUTH_ANONYMOUSBEFOREBIND', FALSE); * define('LDAP_AUTH_ANONYMOUSBEFOREBIND', FALSE);
* // ??? will be replaced with the entered username(escaped) at login * // ??? will be replaced with the entered username(escaped) at login
* define('LDAP_AUTH_SEARCHFILTER', '(&(objectClass=person)(uid=???))'); * define('LDAP_AUTH_SEARCHFILTER', '(&(objectClass=person)(uid=???))');
* // Optional configuration * // Optional configuration
* define('LDAP_AUTH_BINDDN', 'cn=serviceaccount,dc=example,dc=com'); * define('LDAP_AUTH_BINDDN', 'cn=serviceaccount,dc=example,dc=com');
* define('LDAP_AUTH_BINDPW', 'ServiceAccountsPassword'); * define('LDAP_AUTH_BINDPW', 'ServiceAccountsPassword');
* define('LDAP_AUTH_LOGIN_ATTRIB', 'uid'); * define('LDAP_AUTH_LOGIN_ATTRIB', 'uid');
@ -32,18 +32,18 @@
*/ */
/** /**
* Notes - * Notes -
* LDAP search does not support follow ldap referals. Referals are disabled to * LDAP search does not support follow ldap referals. Referals are disabled to
* allow proper login. This is particular to Active Directory. * allow proper login. This is particular to Active Directory.
* *
* Also group membership can be supported if the user object contains the * Also group membership can be supported if the user object contains the
* the group membership via attributes. The following LDAP servers can * the group membership via attributes. The following LDAP servers can
* support this. * support this.
* * Active Directory * * Active Directory
* * OpenLDAP support with MemberOf Overlay * * OpenLDAP support with MemberOf Overlay
* *
*/ */
class Auth_Ldap extends Plugin implements IAuthModule { class Auth_Ldap extends Auth_Base {
private $link; private $link;
private $host; private $host;
@ -73,7 +73,7 @@ class Auth_Ldap extends Plugin implements IAuthModule {
function init($host) { function init($host) {
$this->link = $host->get_link(); $this->link = $host->get_link();
$this->host = $host; $this->host = $host;
$this->base = new Auth_Base($this->link); //$this->base = new Auth_Base($this->link);
$host->add_hook($host::HOOK_AUTH_USER, $this); $host->add_hook($host::HOOK_AUTH_USER, $this);
} }
@ -375,10 +375,10 @@ class Auth_Ldap extends Plugin implements IAuthModule {
$this->_log('Could not find user name attribute ' . $this->_ldapLoginAttrib . ' in LDAP entry', E_USER_WARNING); $this->_log('Could not find user name attribute ' . $this->_ldapLoginAttrib . ' in LDAP entry', E_USER_WARNING);
return FALSE; return FALSE;
} }
return $this->base->auto_create_user($ttrssUsername); return $this->auto_create_user($ttrssUsername);
} else { } else {
@ldap_close($ldapConn); @ldap_close($ldapConn);
return $this->base->auto_create_user($login); return $this->auto_create_user($login);
} }
} else { } else {
@ldap_close($ldapConn); @ldap_close($ldapConn);