Code

Updated setup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Feb 2007 05:17:15 +0000 (05:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Feb 2007 05:17:15 +0000 (05:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5709 594d385d-05f5-0310-b6e9-bd551577e9d8

html/themes/default/style.css
setup/class_setupStep4.inc
setup/setup_step4.tpl

index d85d8054cda83df921a652c896d5774f88764f7e..0724fa04fc3f5888894b86f962437f9ed2d6d3e1 100644 (file)
@@ -1029,7 +1029,7 @@ div.step2_warning_text{
        Setup step 4 styles 
 */
 
-div.step4_name {
+li.step4_name, div.step4_name {
     vertical-align: middle;
        float:left;
        overflow: hidden;
@@ -1037,7 +1037,7 @@ div.step4_name {
        height:2.0em;
 }
 
-div.step4_value {
+li.step4_value, div.step4_value {
        float:left;
        width:200px;
        overflow: hidden;
@@ -1045,16 +1045,18 @@ div.step4_value {
        height:2.0em;
 }
 
-div.step4_status {
+li.step4_status, div.step4_status {
        text-align:right;
     vertical-align: middle;
        overflow: hidden;
        height:2.0em;
+       text-decoration: none;
 }
 
 
-div.step4_container {
+ul.step4_container, div.step4_container {
        border: solid 1px #CCC;
        width:500px;
        height:2.0em;
+       float:left;
 }
index 720686fe8a6476d779030caea69e321219555dbf..c923d7b120fd4209f938a5ebaaf6191caaf729d0 100644 (file)
@@ -30,7 +30,7 @@ class setup_step_4 extends setup_step
   var $peopleou   = "ou=people,";
   var $peopledn   = "cn";
   var $groupou    = "ou=groups,";
-  var $uidbase    =  1000;
+  var $uidbase    = 1000;
   var $encryption = "crypt";
   var $mail       = "kolab";
   var $errors     = TRUE;
@@ -38,6 +38,8 @@ class setup_step_4 extends setup_step
   var $crypt_methods  = array();
   var $mail_methods   = array();
 
+  var $connect_id =FALSE;
+
   var $attributes = array("connection","location","admin","password","base","peopleou","peopledn","groupou",
                           "uidbase","encryption","mail","errors");
 
@@ -46,9 +48,8 @@ class setup_step_4 extends setup_step
     $this->s_title      = _("Ldap settings");
     $this->s_title_long = _("Ldap connection setup");
     $this->s_info       = _("This dialog allows the basic configuration of GOsa's behaviour and properties in your main configuration.");
-    $tmp   = @passwordMethod::get_available_methods_if_not_loaded();
+    $tmp = @passwordMethod::get_available_methods_if_not_loaded();
     $this->crypt_methods   = $tmp['name'];
-
     $tmp = $this->get_available_mail_classes();
     $this->mail_methods = $tmp['name'];
   }
@@ -56,11 +57,13 @@ class setup_step_4 extends setup_step
   function execute()
   {
     $smarty = get_smarty();
-  
     foreach($this->attributes as $attr){
       $smarty->assign($attr,$this->$attr);
     }
 
+    $smarty->assign("connection_established",$this->is_connection_established());
+
+
     $smarty->assign("peopledns",array("uid","cn"));
     $smarty->assign("crypt_methods",$this->crypt_methods);
     $smarty->assign("mail_methods",$this->mail_methods);
@@ -92,6 +95,27 @@ class setup_step_4 extends setup_step
     }
     return($methods); 
   }
+
+  /* Check if specified server is reachable */
+  function is_connection_established()
+  {
+   if(!$this->connect_id= @ldap_connect(validate($this->connection))){
+      echo "false";
+      return FALSE;
+    }else{
+      echo "true";
+      return TRUE;
+    }
+  }
+
+  function save_object()
+  {
+    foreach($this->attributes as $attr){
+      if(isset($_POST[$attr])){
+        $this->$attr = $_POST[$attr];
+      }
+    }
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 1d4cfb88ab3f123083cf2b6a42bf933acd2235d7..3faa404c67270371c0b2bd8241ba43c17753b58e 100644 (file)
@@ -7,10 +7,17 @@
                        <input type='text' name='connection' maxlength='80' size='25' value='{$connection}'>
                </div>
                <div class='step4_status'>
-                       sad
+                       {if !$connection_established}
+                               {t}Connection failed{/t}        
+                       {/if}
+                       <input type='submit' name='next' value='{t}Next{/t}'>
+               </div>
+               <div>
                </div>
        </div>
 
+{if $connection_established}
+
        <div class='step4_container'>
                <div class='step4_name'>
                        {t}Location description{/t}
@@ -19,7 +26,6 @@
                        <input type='text' name='location' maxlength='80' size='25' value='{$location}'>
                </div>
                <div class='step4_status'>
-                       asd
                </div>
        </div>
 
                        asd
                </div>
        </div>
+{/if}
 <!--
                 {t}GOsa supports several encryption types for your passwords. Normally this is adjustable via user templates, but you can specify a default method to be used here, too.{/t}
                 {t}GOsa always acts as admin and manages access rights internally. This is a workaround till OpenLDAP's in directory ACI's are fully implemented. For this to work, we need the admin DN and the corresponding password.{/t}