Bläddra i källkod

Resolves: bug 237356
Description: Move DS Admin Code into Admin Server - navigation
Fix Description: Some minor cleanup:
1) Fixed navigation. Now you can go back through several dialogs.
2) Need to create a new Inf even if no file given
Platforms tested: RHEL4
Flag Day: No.
Doc impact: No.

Rich Megginson 18 år sedan
förälder
incheckning
58beff0b8a

+ 7 - 0
ldap/admin/src/scripts/Dialog.pm

@@ -136,6 +136,7 @@ sub disable {
 # you can set the 0 to a 1 if the user has chosen to use security
 # you can set the 0 to a 1 if the user has chosen to use security
 sub run {
 sub run {
     my $self = shift;
     my $self = shift;
+    my $direction = shift;
     my $resp = $DialogManager::SAME;
     my $resp = $DialogManager::SAME;
 
 
     # display the dialog text
     # display the dialog text
@@ -181,6 +182,12 @@ sub run {
             }
             }
         } elsif ($resp == $DialogManager::ERR) {
         } elsif ($resp == $DialogManager::ERR) {
             last;
             last;
+        } elsif (!$self->isDisplayed() && ($direction < 0) &&
+                 ($resp == $DialogManager::NEXT)) {
+            # we did not display this dialog, and the current navigation
+            # direction is BACK, so we should return BACK, to allow
+            # the user to go back through several dialogs
+            $resp = $DialogManager::BACK;
         }
         }
     }
     }
 
 

+ 1 - 1
ldap/admin/src/scripts/DialogManager.pm

@@ -206,7 +206,7 @@ sub run {
         my $dialog = $self->{dialogs}->[$index];
         my $dialog = $self->{dialogs}->[$index];
         if ($dialog->isEnabled()) {
         if ($dialog->isEnabled()) {
             my $resp = $NEXT;
             my $resp = $NEXT;
-            $resp = $dialog->run();
+            $resp = $dialog->run($incr);
             if ($resp == $BACK) {
             if ($resp == $BACK) {
                 $incr = -1;
                 $incr = -1;
             } elsif ($resp == $NEXT) {
             } elsif ($resp == $NEXT) {

+ 2 - 0
ldap/admin/src/scripts/Setup.pm.in

@@ -135,6 +135,8 @@ sub new {
     # if user supplied inf file, use that to initialize
     # if user supplied inf file, use that to initialize
     if (defined($self->{inffile})) {
     if (defined($self->{inffile})) {
         $self->{inf} = new Inf($self->{inffile});
         $self->{inf} = new Inf($self->{inffile});
+    } else {
+        $self->{inf} = new Inf;
     }
     }
     my $fh;
     my $fh;
     # create a temp inf file for writing for other processes
     # create a temp inf file for writing for other processes