diff options
author | Vicent Guardiola <vguardiola@mandriva.com> | 2004-09-21 08:39:00 +0000 |
---|---|---|
committer | Vicent Guardiola <vguardiola@mandriva.com> | 2004-09-21 08:39:00 +0000 |
commit | a687104bd0eb22ffebd93eba661d535c623a1751 (patch) | |
tree | a4695267ce2609427ec90e2831ffdc5ba999dc6f /ldap_wizard/Ldap.pm | |
parent | 50b9b9c56e11f7b0f7ce2e61e719036073f5b7ab (diff) | |
download | drakwizard-a687104bd0eb22ffebd93eba661d535c623a1751.tar drakwizard-a687104bd0eb22ffebd93eba661d535c623a1751.tar.gz drakwizard-a687104bd0eb22ffebd93eba661d535c623a1751.tar.bz2 drakwizard-a687104bd0eb22ffebd93eba661d535c623a1751.tar.xz drakwizard-a687104bd0eb22ffebd93eba661d535c623a1751.zip |
Check hostname and domainname
Add service ldap stop when delete conf
Diffstat (limited to 'ldap_wizard/Ldap.pm')
-rw-r--r-- | ldap_wizard/Ldap.pm | 24 |
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"); |