Author: rhafer
Date: Fri Nov 6 16:12:09 2009
New Revision: 59382
URL: http://svn.opensuse.org/viewcvs/yast?rev=59382&view=rev
Log:
Split up Replication Wizard in two separate steps
Modified:
branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapServer.pm
branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp
branches/SuSE-Code-11-SP1-Branch/ldap-server/src/wizards.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapServer.pm
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapServer.pm?rev=59382&r1=59381&r2=59382&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapServer.pm (original)
+++ branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapServer.pm Fri Nov 6 16:12:09 2009
@@ -190,6 +190,10 @@
# hashes of the password policy DNs and and objects
my $ppolicy_objects = {};
+# A hash containing the necessary step to setup cn=config
+# replication
+my $remoteReplicationSetupTodo = {};
+
##
# Read all ldap-server settings
# @return true on success
@@ -2438,8 +2442,8 @@
return $ppolicy_objects->{$suffix}
}
-BEGIN { $TYPEINFO {SetupRemoteForReplication} = ["function", "boolean", ["map", "string", "any"] ]; }
-sub SetupRemoteForReplication
+BEGIN { $TYPEINFO {CheckRemoteForReplication} = ["function", "boolean", ["map", "string", "any"] ]; }
+sub CheckRemoteForReplication
{
my ( $self, $param) = @_;
$param->{'target'}->{'port'} = YaST::YCP::Integer($param->{'target'}->{'port'});
@@ -2556,7 +2560,18 @@
push @db_changes, $changes;
}
}
- foreach my $db_change (@db_changes)
+ $remoteReplicationSetupTodo = { "dbchanges" => \@db_changes, "param" => $param };
+ return 1;
+}
+
+
+BEGIN { $TYPEINFO {SetupRemoteForReplication} = ["function", "boolean" ]; }
+sub SetupRemoteForReplication
+{
+ my $db_changes = $remoteReplicationSetupTodo->{'dbchanges'};
+ my $param = $remoteReplicationSetupTodo->{'param'};
+
+ foreach my $db_change (@{$db_changes})
{
my $i = $db_change->{'index'};
if ($db_change->{'needsyncacl'} )
@@ -2639,5 +2654,49 @@
return 1;
}
+
+BEGIN { $TYPEINFO{ReplicationSetupSummary} = ["function", "string" ]; }
+sub ReplicationSetupSummary {
+ # Configuration summary text for autoyast
+ my $self = shift;
+ my $db_changes = $remoteReplicationSetupTodo->{'dbchanges'};
+ my $param = $remoteReplicationSetupTodo->{'param'};
+
+ my $string = "";
+ my $nochanges = 0;
+ $string .= "<h1>"._("Applying the following changes to: \""). $param->{'target'}->{'target'}."\"</h1>" ;
+ foreach my $db_change (@{$db_changes} )
+ {
+ $string .= "<h2>"._("Database: \""). $db_change->{'suffix'}."\"</h2>" ;
+ $string .= "<il>";
+ if (! ( $db_change->{'needsyncacl'} || $db_change->{'needsyncprov'} || $db_change->{'needsyncrepl'} ))
+ {
+ $string .= "<li>"._("No modifications required.")."</li>";
+ }
+ else
+ {
+ $nochanges = 0;
+ }
+ if ( $db_change->{'needsyncacl'} )
+ {
+ $string .= "<li>"._("Adding ACL to grant \"").$param->{'binddn'}. _("\" read access for replication.")."</li>";
+ }
+ if ( $db_change->{'needsyncprov'} )
+ {
+ $string .= "<li>"._("Adding LDAPSync provider configuration to be able to act as Replication Provider.")."</li>";
+ }
+ if ( $db_change->{'needsyncrepl'} )
+ {
+ $string .= "<li>"._("Adding LDAPSync consumer configuration.")."</li>";
+ }
+ $string .= "</il>";
+ }
+ if ( $nochanges )
+ {
+ $string = "";
+ }
+ return $string;
+}
+
1;
# EOF
Modified: branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp?rev=59382&r1=59381&r2=59382&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp Fri Nov 6 16:12:09 2009
@@ -611,7 +611,7 @@
+ "\"\n\n" +
_("Do you want to still want to continue?"));
}
- if (!(boolean) LdapServer::SetupRemoteForReplication( testparm ) )
+ if (!(boolean) LdapServer::CheckRemoteForReplication( testparm ) )
{
map