Users using the Tequila login are invited to migrate to gitlab.epfl.ch. This instance will close for Tequila users by May 2020.

Commit 0a15c12d authored by Florian Vessaz's avatar Florian Vessaz

Use LDAP to identify committee members

parent ad247bec
......@@ -24,6 +24,10 @@ on LDAP server.
my @usernames = $group->usernames;
my @members = $group->members;
$group->contains("username");
my $member = GnuGeneration::Member->new(...);
$group->contains($member);
=head1 METHODS
=head2 new($name)
......
......@@ -39,9 +39,18 @@ my $mailing_lists = {
my $shells = [ "/bin/bash", "/bin/fish", "/bin/zsh" ];
sub is_admin() {
my $username = session 'username';
return 0 unless defined $username;
return 1 if grep $username, qw(fvessaz aangel);
my $is_admin = session 'admin';
return $is_admin if (defined $is_admin);
my $g = GnuGeneration::Group->new('comite');
if ($g) {
if ($g->contains(session 'username')) {
session 'admin' => 1;
} else {
# Only cache definitive negative lookup: group was found and
# user is not in it
session 'admin' => 0;
}
}
}
sub logged_as($) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment