summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ldap_wizard/Ldap.pm24
1 files changed, 19 insertions, 5 deletions
diff --git a/ldap_wizard/Ldap.pm b/ldap_wizard/Ldap.pm
index c1f2fb3f..a641c965 100644
--- a/ldap_wizard/Ldap.pm
+++ b/ldap_wizard/Ldap.pm
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# version 1.34
+# version 1.35
# GPL like
# vguardiola@mandrakesoft.com
@@ -24,6 +24,10 @@ use Net::LDAP::Util qw(ldap_error_text);
# die "You are not root Exiting\n";
#}
+my $wiz = new MDK::Wizard::Wizcommon;
+my $wiz_domain_name = $wiz->{net}->network_get("DOMAINNAME");
+my $wiz_host_name = $wiz->{net}->network_get("HOSTNAME");
+
my $o = {
name => N("Ldap wizard"),
var => {
@@ -51,7 +55,16 @@ my $o = {
prenom => '',
},
needed_rpm => [ 'openldap-servers','openldap-clients','nss_ldap' ],
- defaultimage => "$ENV{__WIZ_HOME__}ldap_wizard/images/ldap.png",
+ defaultimage => "$ENV{__WIZ_HOME__}ldap_wizard/images/ldap.png",
+ init => sub {
+ if ($wiz_host_name =~ /localhost/) {
+ return 0, N("You need to readjust your hostname.")
+ }
+ if (member($wiz_domain_name, qw(localdomain (none)))) {
+ return 0, N("You need to readjust your domainname. For a LDAP server you need a correct domainname, not equal to localdomain or none. Hostname must be a FQDN: Fully Qualified Domain Name. Launch drakconnect to adjust it.")
+ }
+ 1
+ },
};
@@ -374,9 +387,9 @@ description: OU Hosts
objectClass: top
objectClass: organizationalUnit
-dn: ou=Users,$o->{var}{suffix}
-ou: Users
-description: OU Users
+dn: ou=People,$o->{var}{suffix}
+ou: People
+description: OU People
objectClass: top
objectClass: organizationalUnit
@@ -424,6 +437,7 @@ sub do_it_user_add {
}
sub sav_conf {
+ services::stop('ldap');
my $cmd = "slapcat -l /root/ldap-sav.ldiff";
system($cmd) == 0 or !$::testing and err_dialog(N("Error!"), N("%s Failed", $cmd));
system("cp /etc/openldap/slapd.conf /root/slapd.save");