Compare commits
33 Commits
pkg/eole/e
...
master
Author | SHA1 | Date | |
---|---|---|---|
3edf7dd774 | |||
293d940fdc | |||
918ceab882 | |||
adea10270d | |||
6c5beb7e9f | |||
583e77d7c7 | |||
eddc9696c3 | |||
4e8caeda89 | |||
f3b120eb62 | |||
cc9a5e20ce | |||
5512f64aab | |||
569e0caab8 | |||
bb18f68a54 | |||
cf5d9485ca | |||
e423388795 | |||
140cc084a3 | |||
df5dabbcf4 | |||
fe8722e776 | |||
200c9c41e9 | |||
63bf3c9f98 | |||
03a00fb7ce | |||
52e5c433eb | |||
d1ad6aeb25 | |||
815fca0e82 | |||
8ec486eafc | |||
4af11f3d28 | |||
8af3ee655f | |||
5d4e572967 | |||
15da7394f3 | |||
536da57382 | |||
|
d08c965ee8 | ||
|
f2e6a3afe0 | ||
|
2700a5d440 |
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Backup and swap files
|
||||||
|
*~
|
||||||
|
*#
|
||||||
|
*.swp
|
6
Makefile
6
Makefile
@ -3,9 +3,9 @@
|
|||||||
################################
|
################################
|
||||||
|
|
||||||
SOURCE=eole-lemonldap
|
SOURCE=eole-lemonldap
|
||||||
VERSION=2.8.0
|
VERSION=0.1
|
||||||
EOLE_VERSION=2.8
|
EOLE_VERSION=2.7
|
||||||
EOLE_RELEASE=2.8.0
|
EOLE_RELEASE=2.7.2
|
||||||
PKGAPPS=non
|
PKGAPPS=non
|
||||||
#FLASK_MODULE=<APPLICATION>
|
#FLASK_MODULE=<APPLICATION>
|
||||||
|
|
||||||
|
21
README.md
21
README.md
@ -4,6 +4,27 @@ LemonLDAP::NG EOLE integration
|
|||||||
|
|
||||||
## Howto
|
## Howto
|
||||||
|
|
||||||
|
### Repository configuration
|
||||||
|
|
||||||
|
* Add the lemonldap-ng deb respository we need the last version of LemonLDAP.
|
||||||
|
|
||||||
|
GenConfig -> Mode Expert -> Dépôts tiers -> Libellé du dépôt
|
||||||
|
|
||||||
|
#### LemonLDAP::NG repository (if you use EOLE 2.8.X this is not needed anymore)
|
||||||
|
|
||||||
|
* deb https://lemonldap-ng.org/deb stable main
|
||||||
|
* deb-src https://lemonldap-ng.org/deb stable main
|
||||||
|
* Key URL : https://lemonldap-ng.org/_media/rpm-gpg-key-ow2
|
||||||
|
|
||||||
|
#### Cadoles Repository
|
||||||
|
* deb [ arch=all ] https://vulcain.cadoles.com 2.7.2-dev main
|
||||||
|
* Key URL : https://vulcain.cadoles.com/cadoles.gpg
|
||||||
|
|
||||||
|
### Install packages
|
||||||
|
|
||||||
|
apt update
|
||||||
|
apt install eole-lemonldap
|
||||||
|
|
||||||
### Configure LemonLDAP in GenConfig
|
### Configure LemonLDAP in GenConfig
|
||||||
|
|
||||||
* Enable lemonldap in "Services" tab
|
* Enable lemonldap in "Services" tab
|
||||||
|
54
debian/control
vendored
54
debian/control
vendored
@ -1,54 +0,0 @@
|
|||||||
Source: eole-lemonldap-ng
|
|
||||||
Section: web
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: Équipe EOLE <eole@ac-dijon.fr>
|
|
||||||
Build-Depends: debhelper-compat (= 12)
|
|
||||||
Standards-Version: 4.5.0
|
|
||||||
Homepage: https://dev-eole.ac-dijon.fr/projects/sso
|
|
||||||
Vcs-Git: https://dev-eole.ac-dijon.fr/git/eole-lemonldap-ng.git
|
|
||||||
Vcs-Browser: https://dev-eole.ac-dijon.fr/projects/sso/repository
|
|
||||||
|
|
||||||
Package: eole-lemonldap-ng
|
|
||||||
Architecture: all
|
|
||||||
Depends: eole-lemonldap-ng-pkg,
|
|
||||||
${misc:Depends}
|
|
||||||
Description: Dictionnaires et templates pour la configuration d'un serveur LemonLDAP::NG
|
|
||||||
Pour toute information complémentaire, veuillez vous rendre sur le
|
|
||||||
site du projet EOLE.
|
|
||||||
|
|
||||||
Package: eole-lemonldap-ng-scribe
|
|
||||||
Architecture: all
|
|
||||||
Depends: eole-scribe,
|
|
||||||
eole-lemonldap-ng,
|
|
||||||
libapache2-mod-perl2,
|
|
||||||
${misc:Depends}
|
|
||||||
Description: Dictionnaire pour calculer les valeurs automatiquement sur Scribe
|
|
||||||
.
|
|
||||||
Pour toute information complémentaire, veuillez vous rendre sur le
|
|
||||||
site du projet EOLE.
|
|
||||||
|
|
||||||
Package: eole-lemonldap-ng-pkg
|
|
||||||
Architecture: all
|
|
||||||
Section: metapackages
|
|
||||||
Depends: lemonldap-ng,
|
|
||||||
lemonldap-ng-doc,
|
|
||||||
lemonldap-ng-fastcgi-server,
|
|
||||||
lemonldap-ng-handler,
|
|
||||||
liblemonldap-ng-handler-perl,
|
|
||||||
liblemonldap-ng-manager-perl,
|
|
||||||
liblemonldap-ng-portal-perl,
|
|
||||||
libauthen-captcha-perl,
|
|
||||||
libauthen-sasl-perl,
|
|
||||||
libemail-sender-perl,
|
|
||||||
libgd-securityimage-perl,
|
|
||||||
libimage-magick-perl,
|
|
||||||
libio-string-perl,
|
|
||||||
liblasso-perl,
|
|
||||||
libnet-ldap-perl,
|
|
||||||
libunicode-string-perl,
|
|
||||||
libmime-tools-perl,
|
|
||||||
libnet-openid-server-perl,
|
|
||||||
${misc:Depends}
|
|
||||||
Description: Paquet de dépendances pour eole-lemonldap.
|
|
||||||
.
|
|
||||||
Pour toute information complémentaire, veuillez vous rendre sur la forge Cadoles.
|
|
37
debian/copyright
vendored
37
debian/copyright
vendored
@ -1,37 +0,0 @@
|
|||||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
|
||||||
Upstream-Name: eole-lemonldap-ng
|
|
||||||
Source: http://dev-eole.ac-dijon.fr/projects/sso
|
|
||||||
|
|
||||||
Files: *
|
|
||||||
Copyright: 2020 Équipe EOLE <eole@ac-dijon.fr>
|
|
||||||
License: CeCILL-C
|
|
||||||
|
|
||||||
License: CeCILL-C
|
|
||||||
This software is governed by the CeCILL-C license under French law and
|
|
||||||
abiding by the rules of distribution of free software. You can use,
|
|
||||||
modify and or redistribute the software under the terms of the CeCILL-C
|
|
||||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
|
||||||
"http://www.cecill.info";.
|
|
||||||
.
|
|
||||||
As a counterpart to the access to the source code and rights to copy,
|
|
||||||
modify and redistribute granted by the license, users are provided only
|
|
||||||
with a limited warranty and the software's author, the holder of the
|
|
||||||
economic rights, and the successive licensors have only limited
|
|
||||||
liability.
|
|
||||||
.
|
|
||||||
In this respect, the user's attention is drawn to the risks associated
|
|
||||||
with loading, using, modifying and/or developing or reproducing the
|
|
||||||
software by the user in light of its specific status of free software,
|
|
||||||
that may mean that it is complicated to manipulate, and that also
|
|
||||||
therefore means that it is reserved for developers and experienced
|
|
||||||
professionals having in-depth computer knowledge. Users are therefore
|
|
||||||
encouraged to load and test the software's suitability as regards their
|
|
||||||
requirements in conditions enabling the security of their systems and/or
|
|
||||||
data to be ensured and, more generally, to use and operate it in the
|
|
||||||
same conditions as regards security.
|
|
||||||
.
|
|
||||||
The fact that you are presently reading this means that you have had
|
|
||||||
knowledge of the CeCILL-C license and that you accept its terms.
|
|
||||||
.
|
|
||||||
On Eole systems, the complete text of the CeCILL-C License can be found
|
|
||||||
in `/usr/share/common-licenses/CeCILL-2'.
|
|
2
debian/eole-lemonldap-ng-scribe.install
vendored
2
debian/eole-lemonldap-ng-scribe.install
vendored
@ -1,2 +0,0 @@
|
|||||||
usr/share/eole/creole/dicos/71_lemonldap_ng_scribe.xml
|
|
||||||
usr/share/eole/postservice/98-lemonldap-ng-scribe-register-hosts
|
|
6
debian/eole-lemonldap-ng.install
vendored
6
debian/eole-lemonldap-ng.install
vendored
@ -1,6 +0,0 @@
|
|||||||
usr/share/creole/
|
|
||||||
usr/share/eole/creole/dicos/70_lemonldap_ng.xml
|
|
||||||
usr/share/eole/creole/distrib/
|
|
||||||
usr/share/eole/diagnose/
|
|
||||||
usr/share/eole/postservice/99-lemonldap-ng
|
|
||||||
usr/share/eole/posttemplate/
|
|
3
debian/gbp.conf
vendored
3
debian/gbp.conf
vendored
@ -1,3 +0,0 @@
|
|||||||
# Set per distribution debian tag
|
|
||||||
[DEFAULT]
|
|
||||||
debian-tag = debian/eole/%(version)s
|
|
9
debian/rules
vendored
9
debian/rules
vendored
@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/make -f
|
|
||||||
# -*- makefile -*-
|
|
||||||
|
|
||||||
# Uncomment this to turn on verbose mode.
|
|
||||||
export DH_VERBOSE=1
|
|
||||||
export DH_OPTIONS=-v
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@
|
|
1
debian/source/format
vendored
1
debian/source/format
vendored
@ -1 +0,0 @@
|
|||||||
3.0 (native)
|
|
@ -24,9 +24,6 @@
|
|||||||
<target type='variable'>activer_sso</target>
|
<target type='variable'>activer_sso</target>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<auto name='calc_val' target='ldapScheme'>
|
|
||||||
<param>ldaps</param>
|
|
||||||
</auto>
|
|
||||||
|
|
||||||
<fill name='calc_val_first_value' target='eolesso_adresse'>
|
<fill name='calc_val_first_value' target='eolesso_adresse'>
|
||||||
<param type='eole' optional='True' hidden='False'>authWebName</param>
|
<param type='eole' optional='True' hidden='False'>authWebName</param>
|
||||||
@ -34,21 +31,24 @@
|
|||||||
<param type='eole'>nom_domaine_machine</param>
|
<param type='eole'>nom_domaine_machine</param>
|
||||||
</fill>
|
</fill>
|
||||||
|
|
||||||
<auto name='calc_val' target='ldap_port'>
|
|
||||||
<param>389</param>
|
|
||||||
</auto>
|
|
||||||
|
|
||||||
<condition name='frozen_if_in' source='activerLemon'>
|
<condition name='frozen_if_in' source='activerLemon'>
|
||||||
<param>oui</param>
|
<param>oui</param>
|
||||||
<target type='variable'>eolesso_adresse</target>
|
<target type='variable'>eolesso_adresse</target>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
|
<auto name='calc_multi_condition' target='ldapScheme'>
|
||||||
|
<param>oui</param>
|
||||||
|
<param type='eole' name='condition_1'>ldap_tls</param>
|
||||||
|
<param name='match'>ldaps</param>
|
||||||
|
<param name='default_mismatch'>ldap</param>
|
||||||
|
</auto>
|
||||||
|
|
||||||
<auto name='calc_val' target='ldapServer'>
|
<auto name='calc_val' target='ldapServer'>
|
||||||
<param type='eole'>ad_address</param>
|
<param type='eole'>adresse_ip_ldap</param>
|
||||||
</auto>
|
</auto>
|
||||||
|
|
||||||
<auto name='calc_val' target='ldapServerPort'>
|
<auto name='calc_val' target='ldapServerPort'>
|
||||||
<param type='number'>389</param>
|
<param type='eole'>ldap_port</param>
|
||||||
</auto>
|
</auto>
|
||||||
|
|
||||||
<auto name='calc_val' target='lemon_user_db'>
|
<auto name='calc_val' target='lemon_user_db'>
|
||||||
@ -62,11 +62,11 @@
|
|||||||
<param type='eole'>ldap_base_dn</param>
|
<param type='eole'>ldap_base_dn</param>
|
||||||
</auto>
|
</auto>
|
||||||
<auto name='calc_val' target='ldapBindUserDN'>
|
<auto name='calc_val' target='ldapBindUserDN'>
|
||||||
<param type='eole'>sasl_ldap_reader</param>
|
<param type='eole'>ldap_reader</param>
|
||||||
</auto>
|
</auto>
|
||||||
|
|
||||||
<auto name='calc_val' target='ldapBindUserPassword'>
|
<auto name='calc_val' target='ldapBindUserPassword'>
|
||||||
<param>/etc/eole/private/sasl-reader.password</param>
|
<param type='eole'>ldap_reader_passfile</param>
|
||||||
</auto>
|
</auto>
|
||||||
|
|
||||||
<auto name='calc_val' target='casFolder'>
|
<auto name='calc_val' target='casFolder'>
|
||||||
|
2
eole-lemonldap-ng.mk
Normal file
2
eole-lemonldap-ng.mk
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
creolefuncs_DATA_DIR := $(DESTDIR)/usr/share/creole/funcs
|
||||||
|
lemonldap-ng_DATA_DIR := $(eole_DIR)/lemonldap-ng
|
@ -1 +0,0 @@
|
|||||||
creolefuncs_DATA_DIR := $(DESTDIR)/usr/share/creole/funcs
|
|
102
lemonldap-ng/LDAP.pm
Normal file
102
lemonldap-ng/LDAP.pm
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
package Lemonldap::NG::Portal::UserDB::LDAP;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use Mouse;
|
||||||
|
use utf8;
|
||||||
|
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK);
|
||||||
|
|
||||||
|
extends 'Lemonldap::NG::Portal::Lib::LDAP';
|
||||||
|
|
||||||
|
our $VERSION = '2.0.6';
|
||||||
|
|
||||||
|
has ldapGroupAttributeNameSearch => (
|
||||||
|
is => 'rw',
|
||||||
|
lazy => 1,
|
||||||
|
builder => sub {
|
||||||
|
my $attributes = [];
|
||||||
|
@$attributes =
|
||||||
|
split( /\s+/, $_[0]->{conf}->{ldapGroupAttributeNameSearch} )
|
||||||
|
if $_[0]->{conf}->{ldapGroupAttributeNameSearch};
|
||||||
|
push( @$attributes, $_[0]->{conf}->{ldapGroupAttributeNameGroup} )
|
||||||
|
if ( $_[0]->{conf}->{ldapGroupRecursive}
|
||||||
|
and $_[0]->{conf}->{ldapGroupAttributeNameGroup} ne "dn" );
|
||||||
|
return $attributes;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
# RUNNING METHODS
|
||||||
|
#
|
||||||
|
# getUser is provided by Portal::Lib::LDAP
|
||||||
|
|
||||||
|
# Load all parameters included in exportedVars parameter.
|
||||||
|
# Multi-value parameters are loaded in a single string with
|
||||||
|
# a separator (param multiValuesSeparator)
|
||||||
|
# @return Lemonldap::NG::Portal constant
|
||||||
|
sub setSessionInfo {
|
||||||
|
my ( $self, $req ) = @_;
|
||||||
|
$req->{sessionInfo}->{_dn} = $req->data->{dn};
|
||||||
|
|
||||||
|
my %vars = ( %{ $self->conf->{exportedVars} },
|
||||||
|
%{ $self->conf->{ldapExportedVars} } );
|
||||||
|
while ( my ( $k, $v ) = each %vars ) {
|
||||||
|
|
||||||
|
# getLdapValue returns an empty string for missing attribute
|
||||||
|
# but we really want to return undef so they don't get stored in session
|
||||||
|
$req->sessionInfo->{$k} =
|
||||||
|
$self->ldap->getLdapValue( $req->data->{ldapentry}, $v ) || undef;
|
||||||
|
}
|
||||||
|
|
||||||
|
PE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Load all groups in $groups.
|
||||||
|
# @return Lemonldap::NG::Portal constant
|
||||||
|
sub setGroups {
|
||||||
|
my ( $self, $req ) = @_;
|
||||||
|
my $groups = $req->{sessionInfo}->{groups};
|
||||||
|
my $hGroups = $req->{sessionInfo}->{hGroups};
|
||||||
|
|
||||||
|
if ( $self->conf->{ldapGroupBase} ) {
|
||||||
|
|
||||||
|
# Get value for group search
|
||||||
|
my $group_value = $self->ldap->getLdapValue( $req->data->{ldapentry},
|
||||||
|
$self->conf->{ldapGroupAttributeNameUser} );
|
||||||
|
|
||||||
|
if ( $self->conf->{ldapGroupDecodeSearchedValue} ) {
|
||||||
|
utf8::decode($group_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->logger->debug( "Searching LDAP groups in "
|
||||||
|
. $self->conf->{ldapGroupBase}
|
||||||
|
. " for $group_value" );
|
||||||
|
|
||||||
|
# Call searchGroups
|
||||||
|
my $ldapGroups = $self->ldap->searchGroups(
|
||||||
|
$self->conf->{ldapGroupBase},
|
||||||
|
$self->conf->{ldapGroupAttributeName},
|
||||||
|
$group_value,
|
||||||
|
$self->ldapGroupAttributeNameSearch,
|
||||||
|
$req->{ldapGroupDuplicateCheck}
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ( keys %$ldapGroups ) {
|
||||||
|
my $groupName = $_;
|
||||||
|
$hGroups->{$groupName} = $ldapGroups->{$groupName};
|
||||||
|
my $groupValues = [];
|
||||||
|
foreach ( @{ $self->ldapGroupAttributeNameSearch } ) {
|
||||||
|
next if $_ =~ /^name$/;
|
||||||
|
my $firstValue = $ldapGroups->{$groupName}->{$_}->[0];
|
||||||
|
push @$groupValues, $firstValue;
|
||||||
|
}
|
||||||
|
$groups .= $self->conf->{multiValuesSeparator} if $groups;
|
||||||
|
$groups .= join( '|', @$groupValues );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$req->{sessionInfo}->{groups} = $groups;
|
||||||
|
$req->{sessionInfo}->{hGroups} = $hGroups;
|
||||||
|
PE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
20
lemonldap-ng/LDAP.pm.patch
Normal file
20
lemonldap-ng/LDAP.pm.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
--- /usr/share/perl5/Lemonldap/NG/Portal/UserDB/LDAP.pm.old 2019-12-11 12:05:54.000000000 +0100
|
||||||
|
+++ /usr/share/perl5/Lemonldap/NG/Portal/UserDB/LDAP.pm 2021-01-05 10:54:19.188732119 +0100
|
||||||
|
@@ -40,10 +40,15 @@
|
||||||
|
%{ $self->conf->{ldapExportedVars} } );
|
||||||
|
while ( my ( $k, $v ) = each %vars ) {
|
||||||
|
|
||||||
|
+ my $value = $self->ldap->getLdapValue( $req->data->{ldapentry}, $v );
|
||||||
|
+
|
||||||
|
# getLdapValue returns an empty string for missing attribute
|
||||||
|
# but we really want to return undef so they don't get stored in session
|
||||||
|
- $req->sessionInfo->{$k} =
|
||||||
|
- $self->ldap->getLdapValue( $req->data->{ldapentry}, $v ) || undef;
|
||||||
|
+ # This has to be a string comparison because "0" is a valid attribute
|
||||||
|
+ # value. See #2403
|
||||||
|
+ $value = undef if ( $value eq "" );
|
||||||
|
+
|
||||||
|
+ $req->sessionInfo->{$k} = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
PE_OK;
|
@ -1,6 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
[ "$(CreoleGet activerLemon non)" = 'oui' ] || exit 0
|
|
||||||
|
[[ $(CreoleGet activerLemon non) == "non" ]] && exit 0
|
||||||
|
|
||||||
|
# Updating Configuration cache
|
||||||
|
|
||||||
|
cmd="/usr/share/lemonldap-ng/bin/lemonldap-ng-cli update-cache"
|
||||||
|
opt="update-cache"
|
||||||
|
|
||||||
# Updating Configuration cache
|
# Updating Configuration cache
|
||||||
/usr/share/lemonldap-ng/bin/lemonldap-ng-cli update-cache 2>&1
|
/usr/share/lemonldap-ng/bin/lemonldap-ng-cli update-cache 2>&1
|
||||||
|
12
posttemplate/70-lemonldap-patch
Executable file
12
posttemplate/70-lemonldap-patch
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# vérifie si le patch est déjà appliqué
|
||||||
|
grep -q 2403 /usr/share/perl5/Lemonldap/NG/Portal/UserDB/LDAP.pm && exit 0
|
||||||
|
|
||||||
|
# copie de sauvegarde
|
||||||
|
cp -a /usr/share/perl5/Lemonldap/NG/Portal/UserDB/LDAP.pm /usr/share/eole/lemonldap-ng/
|
||||||
|
|
||||||
|
# application du patch
|
||||||
|
patch -d / -p 0 < /usr/share/eole/lemonldap-ng/LDAP.pm.patch
|
||||||
|
|
||||||
|
exit 0
|
@ -36,7 +36,7 @@
|
|||||||
;
|
;
|
||||||
; 1 - Defined logging level
|
; 1 - Defined logging level
|
||||||
; Set here one of error, warn, notice, info or debug
|
; Set here one of error, warn, notice, info or debug
|
||||||
logLevel = debug
|
logLevel = %%lm_loglevel
|
||||||
; Note that this has no effect for Apache2 logging: Apache LogLevel is used
|
; Note that this has no effect for Apache2 logging: Apache LogLevel is used
|
||||||
; instead
|
; instead
|
||||||
;
|
;
|
||||||
@ -65,9 +65,9 @@ logLevel = debug
|
|||||||
; 2.1 - Using Syslog
|
; 2.1 - Using Syslog
|
||||||
;
|
;
|
||||||
; For Syslog logging, you can also overwrite facilities. Default values:
|
; For Syslog logging, you can also overwrite facilities. Default values:
|
||||||
;logger = Lemonldap::NG::Common::Logger::Syslog
|
logger = Lemonldap::NG::Common::Logger::Syslog
|
||||||
;syslogFacility = daemon
|
syslogFacility = daemon
|
||||||
;userSyslogFacility = auth
|
userSyslogFacility = auth
|
||||||
;
|
;
|
||||||
; 2.2 - Using Log4perl
|
; 2.2 - Using Log4perl
|
||||||
;
|
;
|
||||||
|
@ -1,17 +1,25 @@
|
|||||||
%set %%boolean = {'oui': 1, 'non': 0}
|
%set %%boolean = {'oui': 1, 'non': 0}
|
||||||
%set %%ssoFilters = %%getSSOFilters
|
%set %%ssoFilters = %%getSSOFilters
|
||||||
|
%set %%ldapAttributes = {"uid": "uid", "mail": "mail", "cn":"cn"}
|
||||||
%set %%exported_vars = ['"UA": "HTTP_USER_AGENT"']
|
%set %%exported_vars = ['"UA": "HTTP_USER_AGENT"']
|
||||||
%set %%cas_attributes = []
|
%set %%cas_attributes = []
|
||||||
|
%set %%ldap_attributes = {}
|
||||||
%for %%attr in %%casAttribute
|
%for %%attr in %%casAttribute
|
||||||
%silent %%exported_vars.append('"' + %%attr + '": "' + %%attr + '.casLDAPAttribute"')
|
%silent %%exported_vars.append('"' + %%attr + '": "' + %%attr.casLDAPAttribute + '"')
|
||||||
%silent %%cas_attributes.append('"' + %%attr + '": "' + %%attr + '.casLDAPAttribute"')
|
%silent %%cas_attributes.append('"' + %%attr + '": "' + %%attr.casLDAPAttribute + '"')
|
||||||
|
%set %%ldap_attributes[%%attr.casLDAPAttribute] = %%attr.casLDAPAttribute
|
||||||
%end for
|
%end for
|
||||||
%for %%key, %%value in %%ssoFilters
|
%for %%key, %%value in %%ssoFilters
|
||||||
%silent %%exported_vars.append('"' + %%key + '": "' + %%value + '"')
|
%silent %%exported_vars.append('"' + %%key + '": "' + %%value + '"')
|
||||||
%silent %%cas_attributes.append('"' + %%key + '": "' + %%value + '"')
|
%silent %%cas_attributes.append('"' + %%key + '": "' + %%value + '"')
|
||||||
|
%set %%ldap_attributes[%%value] = %%value
|
||||||
%end for
|
%end for
|
||||||
%silent %%exported_vars.sort()
|
%silent %%exported_vars.sort()
|
||||||
%silent %%cas_attributes.sort()
|
%silent %%cas_attributes.sort()
|
||||||
|
%set %%ldapAttr = []
|
||||||
|
%for %%k, %%v in %%ldap_attributes.items()
|
||||||
|
%silent %%ldapAttr.append('"' + %%k + '": "' + %%v + '"')
|
||||||
|
%end for
|
||||||
{
|
{
|
||||||
%if %%lemon_user_db == "AD"
|
%if %%lemon_user_db == "AD"
|
||||||
"ADPwdExpireWarning": %%llADPasswordExpireWarn,
|
"ADPwdExpireWarning": %%llADPasswordExpireWarn,
|
||||||
@ -173,9 +181,7 @@
|
|||||||
"ldapSearchDeref": "find",
|
"ldapSearchDeref": "find",
|
||||||
"ldapBase": "%%ldapUserBaseDN",
|
"ldapBase": "%%ldapUserBaseDN",
|
||||||
"ldapExportedVars": {
|
"ldapExportedVars": {
|
||||||
"cn": "cn",
|
%%custom_join(%%ldapAttr, ',\n ')
|
||||||
"mail": "mail",
|
|
||||||
"uid": "uid"
|
|
||||||
},
|
},
|
||||||
"ldapGroupAttributeName": "memberUid",
|
"ldapGroupAttributeName": "memberUid",
|
||||||
"ldapGroupAttributeNameGroup": "dn",
|
"ldapGroupAttributeNameGroup": "dn",
|
||||||
@ -190,9 +196,9 @@
|
|||||||
"ldapServer": "%%ldapScheme://%%ldapServer",
|
"ldapServer": "%%ldapScheme://%%ldapServer",
|
||||||
%if %%ldapScheme == "ldaps"
|
%if %%ldapScheme == "ldaps"
|
||||||
%if %%lmldapverify == "oui"
|
%if %%lmldapverify == "oui"
|
||||||
"ldapVerify": "required",
|
"ldapVerify": "Require",
|
||||||
%else
|
%else
|
||||||
"ldapVerify": "none",
|
"ldapVerify": "None",
|
||||||
%end if
|
%end if
|
||||||
%end if
|
%end if
|
||||||
"ldapSetPassword": 0,
|
"ldapSetPassword": 0,
|
||||||
@ -279,7 +285,7 @@
|
|||||||
"portalDisplayChangePassword": "$_auth =~ /^(AD|LDAP|DBI|Demo)$/",
|
"portalDisplayChangePassword": "$_auth =~ /^(AD|LDAP|DBI|Demo)$/",
|
||||||
"portalDisplayLoginHistory": 1,
|
"portalDisplayLoginHistory": 1,
|
||||||
"portalDisplayLogout": 1,
|
"portalDisplayLogout": 1,
|
||||||
"portalDisplayRegister": 1,
|
"portalDisplayRegister": %%boolean[%%llRegisterAccount],
|
||||||
"portalDisplayResetPassword": %%boolean[%%llResetPassword],
|
"portalDisplayResetPassword": %%boolean[%%llResetPassword],
|
||||||
"portalForceAuthn": 0,
|
"portalForceAuthn": 0,
|
||||||
"portalForceAuthnInterval": 0,
|
"portalForceAuthnInterval": 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user