Code

Updated gofax service
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Jan 2008 16:31:57 +0000 (16:31 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Jan 2008 16:31:57 +0000 (16:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8476 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/gofax/admin/systems/services/gofax/class_goFaxServer.inc [new file with mode: 0644]
gosa-plugins/gofax/admin/systems/services/gofax/goFaxServer.tpl [new file with mode: 0644]

diff --git a/gosa-plugins/gofax/admin/systems/services/gofax/class_goFaxServer.inc b/gosa-plugins/gofax/admin/systems/services/gofax/class_goFaxServer.inc
new file mode 100644 (file)
index 0000000..1e5e049
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+
+class goFaxServer extends goService {
+       
+  var $cli_summary      = "This pluign is used within the ServerService Pluign \nand indicates that this server supports fax informations.";
+  var $cli_description  = "Some longer text\nfor help";
+  var $cli_parameters   = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
+
+  /* This plugin only writes its objectClass */
+  var $objectclasses    = array("goFaxServer");
+  var $attributes       = array("goFaxAdmin", "goFaxPassword");
+  var $StatusFlag       = "goFaxServerStatus";
+  /* This class can't be assigned twice so it conflicts with itsself */
+  var $conflicts        = array("goFaxServer");
+
+  var $DisplayName      = "";
+  var $dn               = NULL;
+  var $acl;
+
+  var $goFaxAdmin         = "";
+  var $goFaxPassword      = "";
+  var $goFaxServerStatus  = "";
+  var $cn                 = "";
+  var $view_logged  =FALSE;
+  function goFaxServer(&$config,$dn)
+  {
+    goService::goService($config,$dn);
+    $this->DisplayName = _("FAX database");
+  }
+
+
+  function execute()
+  { 
+    $smarty = get_smarty(); 
+
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      new log("view","server/".get_class($this),$this->dn);
+    }
+
+    /* Assign acls */
+    $tmp = $this->plInfo();
+    foreach($tmp['plProvidedAcls'] as $name => $translation ){
+      $smarty->assign($name."ACL",$this->getacl($name));
+    }
+
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr,$this->$attr);
+    }
+    return($smarty->fetch(get_template_path("goFaxServer.tpl",TRUE,dirname(__FILE__))));
+  }
+
+
+  function getListEntry()
+  {
+    $fields               = goService::getListEntry();
+    $fields['Message']    = _("FAX database configuration");
+    $fields['AllowEdit']  = true;
+    return($fields);
+  }
+
+  function check()
+  { 
+    $message = plugin::check();
+    if (empty($this->goFaxAdmin)){
+      $message[]= _("The attribute user is empty or contains invalid characters.");
+    }
+    if (empty($this->goFaxPassword)){
+      $message[]= _("The attribute password is empty or contains invalid characters.");
+    }
+    return($message);
+  }
+  
+
+  function save_object()
+  {
+    if(isset($_POST['goFaxServerPosted'])){
+      plugin::save_object();
+    }
+  } 
+
+  /* Return plugin informations for acl handling */
+  static function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("Fax database"),
+          "plDescription" => _("Fax database")." ("._("Services").")",
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 99,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("server"),
+
+          "plProvidedAcls"=> array(
+             "goFaxAdmin"     => _("Login name"),
+             "goFaxPassword"  => _("Password"))
+          ));
+  }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/gofax/admin/systems/services/gofax/goFaxServer.tpl b/gosa-plugins/gofax/admin/systems/services/gofax/goFaxServer.tpl
new file mode 100644 (file)
index 0000000..27560b3
--- /dev/null
@@ -0,0 +1,27 @@
+<h2><img class="center" alt="" align="middle" src="images/rightarrow.png" /> {t}FAX database information{/t}</h2>
+ <table summary="">
+    <tr>
+     <td>{t}FAX DB user{/t}{$must}</td>
+     <td>
+{render acl=$goFaxAdminACL}
+       <input name="goFaxAdmin" size=30 maxlength=60 id="goFaxAdmin" value="{$goFaxAdmin}" >
+{/render}
+     </td>
+    </tr>
+    <tr>
+     <td>{t}Password{/t}{$must}</td>
+     <td>
+{render acl=$goFaxPasswordACL}
+       <input type=password name="goFaxPassword" id="goFaxPassword" size=30 maxlength=60 value="{$goFaxPassword}" >
+{/render}
+     </td>
+    </tr>
+   </table>
+
+<p class='seperator'>&nbsp;</p>
+<div style="width:100%; text-align:right;padding-top:10px;padding-bottom:3px;">
+    <input type='submit' name='SaveService' value='{t}Save{/t}'>
+    &nbsp;
+    <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+<input type="hidden" name="goFaxServerPosted" value="1">