Code

Fixed w3c warnings in user select dialog (Ldap settings)
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Apr 2007 06:07:23 +0000 (06:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Apr 2007 06:07:23 +0000 (06:07 +0000)
Added option to hide forward/backward buttons and activated it for the user select dialog.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6103 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setup.inc
setup/class_setupStep.inc
setup/class_setupStep_Ldap.inc

index c530b482e2ab256167a3acaffca9afd129d27f75..0b45f4231d2bdec54eb6e91dc5423146f15bea9b 100644 (file)
@@ -229,20 +229,27 @@ class setup
 
   function get_bottom_html()
   {
-    $str ="";
-    $str.="   <div style='text-align:right;float:top;'>";
-    if(isset($this->o_steps[$this->i_current -1]) && $this->o_steps[$this->i_current -1]->is_enabled()){
-      $str .= "<input type='submit' name='last' value='"._("Back")."'>";
+    /* Skip adding forward/backward button,   
+     *  if the currently opened step is a sub dialog 
+     */
+    if($this->o_steps[$this->i_current]->dialog){
+      $str ="";
     }else{
-      $str .= "<input type='button' name='last' value='"._("Back")."' disabled>";
-    }
-    $str.= "&nbsp;";
-    if(isset($this->o_steps[$this->i_current + 1])){
-      $str .= "<input type='submit' name='next' value='"._("Continue")."'>";
-    }else{
-      $str .= "<input type='button' value='"._("Continue")."' disabled>";
+      $str ="";
+      $str.="   <div style='text-align:right;float:top;'>";
+      if(isset($this->o_steps[$this->i_current -1]) && $this->o_steps[$this->i_current -1]->is_enabled()){
+        $str .= "<input type='submit' name='last' value='"._("Back")."'>";
+      }else{
+        $str .= "<input type='button' name='last' value='"._("Back")."' disabled>";
+      }
+      $str.= "&nbsp;";
+      if(isset($this->o_steps[$this->i_current + 1])){
+        $str .= "<input type='submit' name='next' value='"._("Continue")."'>";
+      }else{
+        $str .= "<input type='button' value='"._("Continue")."' disabled>";
+      }
+      $str .="</div>";
     }
-    $str .="</div>";
     return($str);
   }
 
index a5d86103e20d0c16b6245f43beb6c560ec3f0fd9..b7438ea703858494503ad9ad818ad6f4b6436171 100644 (file)
@@ -33,7 +33,7 @@ class setup_step extends plugin
 
   var $attributes   = array();
   var $parent       = NULL;
-
+  var $dialog       = FALSE;
   
   function setup_step()
   {
index 416d8cd334a1ccf8bcedbea417a93da5a2dc6784..dc0b9898ce2deb71271a5938b6c6165340bff9a9 100644 (file)
@@ -118,7 +118,7 @@ class Step_Ldap extends setup_step
     $ldap->search("(&(objectClass=person)(|(uid=".$filter.")(cn=".$filter.")))");
     $tmp = array();
     while($attrs = $ldap->fetch()){
-      $tmp[$attrs['dn']]= @LDAP::fix($attrs['dn']);
+      $tmp[base64_encode($attrs['dn'])]= @LDAP::fix($attrs['dn']);
       natcasesort($tmp);
     }
     return($tmp);
@@ -139,7 +139,10 @@ class Step_Ldap extends setup_step
     if(isset($_POST['resolve_user'])){
       $this->resolve_user = !$this->resolve_user;
     }
-    
+  
+    /* Hide backward forward button*/
+    $this->dialog = $this->resolve_user;
     if(isset($_POST['resolve_filter'])){
       $this->resolve_filter = $_POST['resolve_filter'];
     }
@@ -147,7 +150,7 @@ class Step_Ldap extends setup_step
     if(isset($_POST['use_selected_user'])){
 
       if(isset($_POST['admin_to_use'])){
-        $this->admin = $_POST['admin_to_use'];
+        $this->admin = base64_decode($_POST['admin_to_use']);
         $this->resolve_user = false;
       }
     }