smeserver-dokuwiki/root/etc/e-smith/templates/etc/dokuwiki/local.protected.php/10auth

49 lines
906 B
Plaintext

{
use esmith::util;
my $base = esmith::util::ldapBase($DomainName);
my $auth = $dokuwiki{'Authentication'} || 'ldap';
my $ldapPort = $ldap{'TCPPort'} || '389';
if ($auth eq 'internal'){
$OUT .=<<"EOF";
\$conf['authtype'] = 'plain';
EOF
}
elsif ($auth eq 'ldap'){
$OUT .=<<"EOF";
\$conf['authtype'] = 'ldap';
EOF
}
elsif ($auth eq 'LemonLDAP'){
$OUT .=<<"EOF";
\$conf['authtype'] = 'httpldap';
EOF
}
if ($auth eq 'LemonLDAP' or $auth eq 'ldap'){
$OUT .=<<"EOF";
\$conf['auth']['ldap']['server'] = "ldap://localhost:$ldapPort";
\$conf['auth']['ldap']['version'] = '3';
\$conf['auth']['ldap']['usertree'] = 'ou=Users,$base';
\$conf['auth']['ldap']['grouptree'] = 'ou=Groups,$base';
\$conf['auth']['ldap']['userfilter'] = '(&(uid=%{user})(objectClass=inetOrgPerson))';
\$conf['auth']['ldap']['groupfilter'] = '(&(objectClass=mailboxRelatedObject)(memberUid=%{user}))';
EOF
}
}