]> git.mxchange.org Git - friendica-addons.git/blobdiff - ldapauth/ldapauth.php
Merge pull request 'Langfilter: Use two letter code for the language / Bluesky: Remov...
[friendica-addons.git] / ldapauth / ldapauth.php
index 72e140e7acf508e55d2c51c5b2f4d2b15d2fdf33..38e2d6a1ec16c4423e4c75a3575ab3b90d608696 100644 (file)
  * Note when using with Windows Active Directory: you may need to set TLS_CACERT in your site
  * ldap.conf file to the signing cert for your LDAP server.
  *
- * The configuration options for this module may be set in the config/addon.config.php file
- * e.g.:
- *
- * [ldapauth]
- * ; ldap hostname server - required
- * ldap_server = host.example.com
- * ; dn to search users - required
- * ldap_searchdn = ou=users,dc=example,dc=com
- * ; attribute to find username - required
- * ldap_userattr = uid
- *
- * ; admin dn - optional - only if ldap server dont have anonymous access
- * ldap_binddn = cn=admin,dc=example,dc=com
- * ; admin password - optional - only if ldap server dont have anonymous access
- * ldap_bindpw = password
- *
- * ; for create Friendica account if user exist in ldap
- * ;     required an email and a simple (beautiful) nickname on user ldap object
- * ;   active account creation - optional - default none
- * ldap_autocreateaccount = true
- * ;   attribute to get email - optional - default : 'mail'
- * ldap_autocreateaccount_emailattribute = mail
- * ;   attribute to get nickname - optional - default : 'givenName'
- * ldap_autocreateaccount_nameattribute = cn
- *
- * ...etc.
+ * The configuration options for this module are described in the config/ldapauth.config.php file
  */
 
 use Friendica\App;
@@ -60,7 +35,7 @@ use Friendica\Core\Logger;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\User;
-use Friendica\Core\Config\Util\ConfigFileLoader;
+use Friendica\Core\Config\Util\ConfigFileManager;
 
 function ldapauth_install()
 {
@@ -68,12 +43,12 @@ function ldapauth_install()
        Hook::register('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate');
 }
 
-function ldapauth_load_config(App $a, ConfigFileLoader $loader)
+function ldapauth_load_config(ConfigFileManager $loader)
 {
-       $a->getConfigCache()->load($loader->loadAddonConfig('ldapauth'));
+       DI::app()->getConfigCache()->load($loader->loadAddonConfig('ldapauth'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
 }
 
-function ldapauth_hook_authenticate(App $a, array &$b)
+function ldapauth_hook_authenticate(array &$b)
 {
        $user = ldapauth_authenticate($b['username'], $b['password']);
        if (!empty($user['uid'])) {