Code

Added PIN field
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Jun 2005 07:46:59 +0000 (07:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Jun 2005 07:46:59 +0000 (07:46 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@865 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/phoneaccount/class_phoneAccount.inc
plugins/gofon/phoneaccount/generic.tpl

index 8b7fdca069b8898b1321db50edca427fe5f73f55..a3a489ba6e94da317d9bc46cbaa534d0ef885e82 100644 (file)
@@ -330,6 +330,7 @@ class phoneAccount extends plugin
     /* Transfer ACL's */
     foreach($this->attributes as $val){
       $smarty->assign($val."ACL", chkacl($this->acl, "$val"));
+      $smarty->assign($val,$this->$val);
     }
 
     /* Fill arrays */
@@ -453,6 +454,16 @@ class phoneAccount extends plugin
       $message[]= sprintf(_("You need to specify at least one phone number!"));
     }
 
+    if(($this->goFonPIN)==""){
+      $this->goFonPIN = array();
+    }else{
+      if(strcmp ((int)($this->goFonPIN),($this->goFonPIN))){
+        $message[] = sprintf(_("The given PIN is not valid, only numbers are allowed for this type."));
+      }elseif(strlen($this->goFonPIN) < 4){
+        $message[] = sprintf(_("The given PIN is too short"));
+      }
+
+    }
     /* Check timestamps and phonenumbers */
     foreach ($this->forwarders as $fw){
 
index 34e5c1744c14f561077e38fb78249bff2ccfbfe7..4375af155c2963cc06512e0624627043aaecbddd 100644 (file)
   </td>
 
  </tr>
+ <tr>
+       <td style="vertical-align:top; border-top:1px solid #A0A0A0; width:50%" colspan="2">&nbsp;</td>
+ </tr>
+ <tr style="vertical-align:top; border-top:1px solid #A0A0A0;">
+       <td  style="vertical-align:top; border-right:1px solid #A0A0A0; width:50%">
+               <br>
+               <table summary="{t}Phone macro{/t}">
+                       <tr>
+                               <td colspan=2><img alt="" src="images/select_macro.png" align="middle">&nbsp;{t}Phone macro{/t}
+                                        <select name="macro" onchange="document.mainform.submit()" {$telephoneNumberACL}>
+                                          {html_options options=$macros selected=$macro}
+                               <option disabled>&nbsp;</option>
+                                        </select>
+                                        <input type="submit" name="refresh" value="{t}refresh{/t}" {$goFonMacroACL}>
+                               </td>
+                       </tr>
+               </table>
+               <br>
+               {$macrotab}
+       </td>
+       <td valign="top" style="vertical-align:top; border-right:1px solid #A0A0A0; width:50%">
+               <table summary="">
+                       <tr>
+                               <td>
+                                       {t}Telefon PIN{/t}
+                               </td>
+                               <td>
+                                       <input type="password" name="goFonPIN" value="{$goFonPIN}">
+                               </td>
+                       </tr>
+               </table>
+       </td>
+ </tr>
 </table>
-<p class="seperator">&nbsp;</p>
-<br>
-<table summary="{t}Phone macro{/t}">
-       <tr>
-               <td colspan=2><img alt="" src="images/select_macro.png" align="middle">&nbsp;{t}Phone macro{/t}
-                        <select name="macro" onchange="document.mainform.submit()" {$telephoneNumberACL}>
-                          {html_options options=$macros selected=$macro}
-               <option disabled>&nbsp;</option>
-                        </select>
-                        <input type="submit" name="refresh" value="{t}refresh{/t}" {$goFonMacroACL}>
-               </td>
-       </tr>
-</table>
-<br>
-{$macrotab}
 <input type="hidden" name="phoneTab" value="phoneTab">