Code

Removed checkboxes.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Dec 2007 14:45:52 +0000 (14:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Dec 2007 14:45:52 +0000 (14:45 +0000)
- Date selectboxes are still missing

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

ihtml/themes/default/pwd_heimdal.tpl
include/class_password-methods-heimdal.inc

index 5a3553f2c5e91cd09d3877741765997d3fc15979..0d1ae4adbcc226e04823aef1268242cff6140d39 100644 (file)
@@ -3,60 +3,46 @@
        <tr>
                <td style="width:50%;vertical-align:top;">
                        <h2>{t}Heimdal options{/t}</h2>
+                       <i>{t}Use empty values for infinite{/t}</i>
                        <table>
                                <tr>
                                        <td>
-                                               <label for="unlimited_krb5MaxLife">{t}Ticket max life{/t}</label>
+                                               <label for="krb5MaxLife">{t}Ticket max life{/t}</label>
                                        </td>
                                        <td>
-                                               <input id="unlimited_krb5MaxLife" name="unlimited_krb5MaxLife" value="1"  type="checkbox" 
-                                                       {if $unlimited_krb5MaxLife} checked {/if} onClick="changeState('krb5MaxLife');">
-                                               <input id="krb5MaxLife" type="text" name="krb5MaxLife" value="{$krb5MaxLife}" 
-                                                       {if $unlimited_krb5MaxLife} disabled {/if}>
+                                               <input id="krb5MaxLife" type="text" name="krb5MaxLife" value="{$krb5MaxLife}"> 
                                        </td>
                                </tr>
                                <tr>
                                        <td>
-                                               <label for="unlimited_krb5MaxRenew">{t}Ticket max renew{/t}</label>
+                                               <label for="krb5MaxRenew">{t}Ticket max renew{/t}</label>
                                        </td>
                                        <td>
-                                               <input id="unlimited_krb5MaxRenew" name="unlimited_krb5MaxRenew" value="1"  type="checkbox" 
-                                                       {if $unlimited_krb5MaxRenew} checked {/if} onClick="changeState('krb5MaxRenew');">
-                                               <input id="krb5MaxRenew" type="text" name="krb5MaxRenew" value="{$krb5MaxRenew}" 
-                                                       {if $unlimited_krb5MaxRenew} disabled {/if}>
+                                               <input id="krb5MaxRenew" type="text" name="krb5MaxRenew" value="{$krb5MaxRenew}">
                                        </td>
                                </tr>
                                <tr>
                                        <td>
-                                               <label for="unlimited_krb5ValidStart">{t}Valid ticket start time{/t}</label>
+                                               <label for="krb5ValidStart">{t}Valid ticket start time{/t}</label>
                                        </td>
                                        <td>
-                                               <input id="unlimited_krb5ValidStart" name="unlimited_krb5ValidStart" value="1"  type="checkbox" 
-                                                       {if $unlimited_krb5ValidStart} checked {/if} onClick="changeState('krb5ValidStart');">
-                                               <input id="krb5ValidStart" type="text" name="krb5ValidStart" value="{$krb5ValidStart}" 
-                                                       {if $unlimited_krb5ValidStart} disabled {/if}>
+                                               <input id="krb5ValidStart" type="text" name="krb5ValidStart" value="{$krb5ValidStart}">
                                        </td>
                                </tr>
                                <tr>
                                        <td>
-                                               <label for="unlimited_krb5ValidEnd">{t}Valid ticket end time{/t}</label>
+                                               <label for="krb5ValidEnd">{t}Valid ticket end time{/t}</label>
                                        </td>
                                        <td>
-                                               <input id="unlimited_krb5ValidEnd" name="unlimited_krb5ValidEnd" value="1"  type="checkbox"
-                                                       {if $unlimited_krb5ValidEnd} checked {/if} onClick="changeState('krb5ValidEnd');">
-                                               <input id="krb5ValidEnd" type="text" name="krb5ValidEnd" value="{$krb5ValidEnd}" 
-                                                       {if $unlimited_krb5ValidEnd} disabled {/if}>
+                                               <input id="krb5ValidEnd" type="text" name="krb5ValidEnd" value="{$krb5ValidEnd}">
                                        </td>
                                </tr>
                                <tr>
                                        <td>
-                                               <label for="unlimited_krb5PasswordEnd">{t}Password end{/t}</label>
+                                               <label for="krb5PasswordEnd">{t}Password end{/t}</label>
                                        </td>
                                        <td>
-                                               <input id="unlimited_krb5PasswordEnd" name="unlimited_krb5PasswordEnd" value="1"  type="checkbox"
-                                                       {if $unlimited_krb5PasswordEnd} checked {/if} onClick="changeState('krb5PasswordEnd');">
-                                               <input id="krb5PasswordEnd" type="text" name="krb5PasswordEnd" value="{$krb5PasswordEnd}" 
-                                                       {if $unlimited_krb5PasswordEnd} disabled {/if}>
+                                               <input id="krb5PasswordEnd" type="text" name="krb5PasswordEnd" value="{$krb5PasswordEnd}">
                                        </td>
                                </tr>
                        </table>
index cd4a317c78fc4f1d8a70a6ba4bb992a4e08ef637..d6c6f50552908c5dfdd9e727d7e4dde4dfa5d19e 100644 (file)
 class passwordMethodheimdal extends passwordMethod
 {
 
-  var $krb5MaxLife      = 86400;
-  var $krb5MaxRenew     = 604800;
-  var $krb5ValidStart   = "200712310000Z";
-  var $krb5ValidEnd     = "201012310000Z";
-  var $krb5PasswordEnd  = "201012310000Z";
-
-  var $unlimited_krb5MaxLife    = FALSE;
-  var $unlimited_krb5MaxRenew   = FALSE;
-  var $unlimited_krb5ValidStart = FALSE;
-  var $unlimited_krb5ValidEnd   = FALSE;
-  var $unlimited_krb5PasswordEnd= FALSE;
+  var $krb5MaxLife      = "";
+  var $krb5MaxRenew     = "";
+  var $krb5ValidStart   = "";
+  var $krb5ValidEnd     = "";
+  var $krb5PasswordEnd  = "";
 
   var $display = TRUE;
 
@@ -53,8 +47,6 @@ class passwordMethodheimdal extends passwordMethod
       "13"=>"immutable");
   var $krb5KDCFlags     = 123;
 
-  /* Dummy */
-  var $unlimited_krb5KDCFlags = FALSE;
   var $dn                     = "new";
   var $parent_dn              = "new";
   var $attributes             = array("krb5MaxLife","krb5MaxRenew","krb5KDCFlags",
@@ -68,7 +60,11 @@ class passwordMethodheimdal extends passwordMethod
     $this->parent_dn = $dn;
 
     /* Load existing entries */
-    if($dn != "new"){
+    $this->krb5MaxLife  = "86400";
+    $this->krb5MaxRenew = "604800";
+    if($dn == "new"){
+      $this->is_account = FALSE;
+    }else{
       $ldap = $this->config->get_ldap_link();
       $ldap->cd($dn);
       $ldap->ls("objectClass=krb5Principal",$dn,array("*"));
@@ -77,11 +73,8 @@ class passwordMethodheimdal extends passwordMethod
         $this->attrs = $ldap->fetch();
         $this->dn = $this->attrs['dn'];
         foreach($this->attributes as $attr){
-          $uattr = "unlimited_".$attr;
           if(isset($this->attrs[$attr][0])){
             $this->$attr = $this->attrs[$attr][0];
-          }else{
-            $this->$uattr = TRUE;
           }
         }
       }elseif($ldap->count() >= 2){
@@ -216,9 +209,7 @@ class passwordMethodheimdal extends passwordMethod
 
     $smarty = get_smarty();
     foreach($this->attributes as $attr){
-      $uattr = "unlimited_".$attr;
       $smarty->assign($attr ,$this->$attr);
-      $smarty->assign($uattr,$this->$uattr);
     }
     foreach($this->flag_list as $key => $name){
       $val = pow(2,$key);
@@ -237,13 +228,6 @@ class passwordMethodheimdal extends passwordMethod
   {
     if(isset($_POST['pwd_heimdal_posted'])){
       foreach($this->attributes as $attr){
-        $uattr = "unlimited_".$attr;
-        if(isset($_POST[$uattr])){
-          $this->$uattr = TRUE;
-        }else{
-          $this->$uattr = FALSE;
-        }
-
         if(isset($_POST[$attr])){
           $this->$attr = get_post($attr);
         }
@@ -263,19 +247,19 @@ class passwordMethodheimdal extends passwordMethod
   function check()
   {
     $message = array();
-    if(!is_numeric($this->krb5MaxLife) && !$this->unlimited_krb5MaxLife){
+    if(!is_numeric($this->krb5MaxLife) && !empty($this->krb5MaxLife)){
       $message[] = sprintf(_("Please specify a numeric value for %s."),_("Max life"));
     }
-    if(!is_numeric($this->krb5MaxRenew) && !$this->unlimited_krb5MaxRenew){
+    if(!is_numeric($this->krb5MaxRenew) && !empty($this->krb5MaxRenew)){
       $message[] = sprintf(_("Please specify a numeric value for %s."),_("Max renew"));
     }
-   if((empty($this->krb5ValidStart) || !$this->chk_times($this->krb5ValidStart)) && !$this->unlimited_krb5ValidStart){
+   if(!empty($this->krb5ValidStart) && !$this->chk_times($this->krb5ValidStart)){
      $message[] = sprintf(_("Please specify a numeric value for %s."),_("Valid start"));
    }
-   if((empty($this->krb5ValidEnd) || !$this->chk_times($this->krb5ValidEnd)) && !$this->unlimited_krb5ValidEnd){
+   if(!empty($this->krb5ValidEnd) && !$this->chk_times($this->krb5ValidEnd)){
      $message[] = sprintf(_("Please specify a numeric value for %s."),_("Valid end"));
    }
-   if((empty($this->krb5PasswordEnd) || !$this->chk_times($this->krb5PasswordEnd)) && !$this->unlimited_krb5PasswordEnd){
+   if(!empty($this->krb5PasswordEnd) && !$this->chk_times($this->krb5PasswordEnd)){
      $message[] = sprintf(_("Please specify a numeric value for %s."),_("Valid password"));
    }
     return($message);
@@ -312,7 +296,7 @@ class passwordMethodheimdal extends passwordMethod
       $data['uid'] = $uid;
       $data['krb5KeyVersionNumber'] = rand(100000,99999999);
 
-      if(!$this->is_account){ 
+      if($this->is_account){ 
         foreach($this->attributes as $attr){
           $data[$attr] = array();
         }
@@ -320,25 +304,25 @@ class passwordMethodheimdal extends passwordMethod
 
       /* Append Flags */
       $data['krb5KDCFlags']   = $this->krb5KDCFlags;
-      if(!$this->unlimited_krb5MaxLife){
+      if(!empty($this->krb5MaxLife)){
         $data['krb5MaxLife']    = $this->krb5MaxLife;
       }
-      if(!$this->unlimited_krb5MaxRenew){
+      if(!empty($this->krb5MaxRenew)){
         $data['krb5MaxRenew']   = $this->krb5MaxRenew;
       }
-      if(!$this->unlimited_krb5ValidStart){
+      if(!empty($this->krb5ValidStart)){
         $data['krb5ValidStart'] = $this->krb5ValidStart;
       }
-      if(!$this->unlimited_krb5ValidEnd){
+      if(!empty($this->krb5ValidEnd)){
         $data['krb5ValidEnd']   = $this->krb5ValidEnd;
       }
-      if(!$this->unlimited_krb5PasswordEnd){
+      if(!empty($this->krb5PasswordEnd)){
         $data['krb5PasswordEnd']= $this->krb5PasswordEnd;
       }
 
       /* Add / Updated data */
       $ldap->cd($dn);
-      if($this->is_account){
+      if(!$this->is_account){ 
         $ldap->add($data);
       }else{
         $ldap->modify($data);