Mailinglist Archive: yast-commit (1212 mails)
| < Previous | Next > |
[yast-commit] r51533 - /trunk/ldap-server/src/LdapServer.pm
- From: rhafer@xxxxxxxxxxxxxxxx
- Date: Thu, 25 Sep 2008 14:45:04 -0000
- Message-id: <20080925144504.DF9FB300A9@xxxxxxxxxxxxxxxx>
Author: rhafer
Date: Thu Sep 25 16:45:04 2008
New Revision: 51533
URL: http://svn.opensuse.org/viewcvs/yast?rev=51533&view=rev
Log:
Support empty configuration in Import()/Export()
Modified:
trunk/ldap-server/src/LdapServer.pm
Modified: trunk/ldap-server/src/LdapServer.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapServer.pm?rev=51533&r1=51532&r2=51533&view=diff
==============================================================================
--- trunk/ldap-server/src/LdapServer.pm (original)
+++ trunk/ldap-server/src/LdapServer.pm Thu Sep 25 16:45:04 2008
@@ -228,10 +228,9 @@
{
# assume a changed config as we don't ship a default for
back-config
$slapdConfChanged = 1;
- # How do we get the LDAP password?
- y2milestone("LDAP server is running. How should I connect?");
SCR->Execute('.ldapserver.init' );
my $rc = SCR->Read('.ldapserver.databases');
+ $usingDefaults = 0;
}
else
{
@@ -749,6 +748,13 @@
my $hash = shift;
y2milestone("LdapServer::Import() : ". Data::Dumper->Dump([$hash]));
+ if ( ! keys( %$hash ) )
+ {
+ $usingDefaults = 1;
+ $overwriteConfig = 0;
+ $self->WriteServiceEnabled( 0 );
+ return 1;
+ }
$usingDefaults = 0;
$overwriteConfig = 1;
$self->WriteServiceEnabled( $hash->{'daemon'}->{'serviceEnabled'} );
@@ -843,6 +849,11 @@
my $self = shift;
my $hash = {};
+ if ( ! $self->ReadServiceEnabled() )
+ {
+ return $hash;
+ }
+
$hash->{'daemon'}->{'slp'} = $self->ReadSLPEnabled();
$hash->{'daemon'}->{'serviceEnabled'} = $self->ReadServiceEnabled();
@@ -924,10 +935,14 @@
{
$string .= '<h2>'._("Startup Configuration").'</h2>'
.'<p>'._("Start LDAP Server:
").'<code>'.($dbDefaults{'serviceEnabled'}->value?_("Yes"):_("No")).'</code></p>'
- .'<p>'._("Register at SLP Service:
").'<code>'.($dbDefaults{'slpRegister'}->value?_("Yes"):_("No")).'</code></p>'
- .'<h2>'._("Create initial Database with the following
Parameters").'</h2>'
+ .'<p>'._("Register at SLP Service:
").'<code>'.($dbDefaults{'slpRegister'}->value?_("Yes"):_("No")).'</code></p>';
+
+ if ( $dbDefaults{'serviceEnabled'}->value )
+ {
+ $string .= '<h2>'._("Create initial Database with the following
Parameters").'</h2>'
.'<p>'._("Database Suffix:
").'<code>'.$dbDefaults{'suffix'}.'</code></p>'
.'<p>'._("Administrator DN:
").'<code>'.$dbDefaults{'rootdn'}.'</code></p>';
+ }
}
elsif ( ! $usingDefaults )
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Thu Sep 25 16:45:04 2008
New Revision: 51533
URL: http://svn.opensuse.org/viewcvs/yast?rev=51533&view=rev
Log:
Support empty configuration in Import()/Export()
Modified:
trunk/ldap-server/src/LdapServer.pm
Modified: trunk/ldap-server/src/LdapServer.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapServer.pm?rev=51533&r1=51532&r2=51533&view=diff
==============================================================================
--- trunk/ldap-server/src/LdapServer.pm (original)
+++ trunk/ldap-server/src/LdapServer.pm Thu Sep 25 16:45:04 2008
@@ -228,10 +228,9 @@
{
# assume a changed config as we don't ship a default for
back-config
$slapdConfChanged = 1;
- # How do we get the LDAP password?
- y2milestone("LDAP server is running. How should I connect?");
SCR->Execute('.ldapserver.init' );
my $rc = SCR->Read('.ldapserver.databases');
+ $usingDefaults = 0;
}
else
{
@@ -749,6 +748,13 @@
my $hash = shift;
y2milestone("LdapServer::Import() : ". Data::Dumper->Dump([$hash]));
+ if ( ! keys( %$hash ) )
+ {
+ $usingDefaults = 1;
+ $overwriteConfig = 0;
+ $self->WriteServiceEnabled( 0 );
+ return 1;
+ }
$usingDefaults = 0;
$overwriteConfig = 1;
$self->WriteServiceEnabled( $hash->{'daemon'}->{'serviceEnabled'} );
@@ -843,6 +849,11 @@
my $self = shift;
my $hash = {};
+ if ( ! $self->ReadServiceEnabled() )
+ {
+ return $hash;
+ }
+
$hash->{'daemon'}->{'slp'} = $self->ReadSLPEnabled();
$hash->{'daemon'}->{'serviceEnabled'} = $self->ReadServiceEnabled();
@@ -924,10 +935,14 @@
{
$string .= '<h2>'._("Startup Configuration").'</h2>'
.'<p>'._("Start LDAP Server:
").'<code>'.($dbDefaults{'serviceEnabled'}->value?_("Yes"):_("No")).'</code></p>'
- .'<p>'._("Register at SLP Service:
").'<code>'.($dbDefaults{'slpRegister'}->value?_("Yes"):_("No")).'</code></p>'
- .'<h2>'._("Create initial Database with the following
Parameters").'</h2>'
+ .'<p>'._("Register at SLP Service:
").'<code>'.($dbDefaults{'slpRegister'}->value?_("Yes"):_("No")).'</code></p>';
+
+ if ( $dbDefaults{'serviceEnabled'}->value )
+ {
+ $string .= '<h2>'._("Create initial Database with the following
Parameters").'</h2>'
.'<p>'._("Database Suffix:
").'<code>'.$dbDefaults{'suffix'}.'</code></p>'
.'<p>'._("Administrator DN:
").'<code>'.$dbDefaults{'rootdn'}.'</code></p>';
+ }
}
elsif ( ! $usingDefaults )
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |