aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mars-attacks.org>2013-06-24 13:14:21 +0200
committerNicolas Vigier <boklm@mars-attacks.org>2013-06-24 13:14:21 +0200
commitac4a3dfca20b2847adc70b8c4068c2f6f7764e03 (patch)
tree54144e8169be05775e93b4ddf97300b8b6fec46a
parent5f03340117231b301ce96f0d420d6ac890e6df6e (diff)
downloadmgagit-ac4a3dfca20b2847adc70b8c4068c2f6f7764e03.tar
mgagit-ac4a3dfca20b2847adc70b8c4068c2f6f7764e03.tar.gz
mgagit-ac4a3dfca20b2847adc70b8c4068c2f6f7764e03.tar.bz2
mgagit-ac4a3dfca20b2847adc70b8c4068c2f6f7764e03.tar.xz
mgagit-ac4a3dfca20b2847adc70b8c4068c2f6f7764e03.zip
Add use_ldap option
To be able to disable use of ldap
-rw-r--r--config_default1
-rw-r--r--lib/MGA/Git.pm2
-rw-r--r--mgagit.conf1
3 files changed, 4 insertions, 0 deletions
diff --git a/config_default b/config_default
index 946ec81..1f9dc53 100644
--- a/config_default
+++ b/config_default
@@ -1,4 +1,5 @@
---
+use_ldap: no
ldapserver: ldap.mageia.org
binddn: uid=mgagit,ou=People,dc=mageia,dc=org
bindpwfile: /etc/mgagit.secret
diff --git a/lib/MGA/Git.pm b/lib/MGA/Git.pm
index 6f49833..b964c2b 100644
--- a/lib/MGA/Git.pm
+++ b/lib/MGA/Git.pm
@@ -67,6 +67,7 @@ sub re {
sub load_groups {
my ($r) = @_;
+ return unless $config->{use_ldap} eq 'yes';
my $ldap = get_ldap;
my $m = $ldap->search(
base => $config->{groupbase},
@@ -80,6 +81,7 @@ sub load_groups {
sub load_users {
my ($r) = @_;
+ return unless $config->{use_ldap} eq 'yes';
my $ldap = get_ldap;
my $m = $ldap->search(
base => $config->{userbase},
diff --git a/mgagit.conf b/mgagit.conf
index 08f10d1..0db3174 100644
--- a/mgagit.conf
+++ b/mgagit.conf
@@ -1,4 +1,5 @@
---
+use_ldap: no
gitolite_config: /var/lib/git/.gitolite/conf/gitolite.conf
pubkey_dir: /home/boklm/.gitolite/keydir
repos_config: