summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f526a3)
raw | patch | inline | side by side (parent: 7f526a3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 7 Jun 2006 07:49:20 +0000 (07:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 7 Jun 2006 07:49:20 +0000 (07:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3665 594d385d-05f5-0310-b6e9-bd551577e9d8
32 files changed:
diff --git a/contrib/gosa.conf b/contrib/gosa.conf
index 461ed4d4a5e7e97db518ca47d112a0a46f0b8421..3d842d242a31fbc7291191c15e8c23b401207de5 100644 (file)
--- a/contrib/gosa.conf
+++ b/contrib/gosa.conf
<servtabs>
<tab class="servgeneric" name="Generic" />
<tab class="workstartup" name="Startup" />
- <tab class="servdb" name="Databases" />
- <tab class="servservice" name="Services" />
+<!-- <tab class="servdb" name="Databases" />-->
+<!-- <tab class="servservice" name="Services" />-->
+ <tab class="ServerService" name="Services" />
{servKolab}
<!-- external_hook should return something like that
DisplayName:ServerName -->
<tab class="reference" name="References" />
</phonetabs>
+ <serverservice>
+ <tab class="goMailServer" />
+ <tab class="goNtpServer" />
+ <tab class="goImapServer" />
+ <tab class="goKrbServer" />
+ <tab class="goFaxServer" />
+ <tab class="goFonServer" />
+ <tab class="goLogDBServer" />
+ <tab class="goGlpiServer" />
+ <tab class="goCupsServer" />
+ <tab class="goSyslogServer" />
+ <tab class="goTerminalServer" />
+ <tab class="goLdapServer" />
+ <tab class="goShareServer" />
+ </serverservice>
+
<componenttabs>
<tab class="componentgeneric" name="Generic" />
<tab class="reference" name="References" />
ppd_path="/var/spool/ppd/"
kde_applications_menu=""
compile="/var/spool/gosa"
- resolution_hook="/etc/gosa/resolutions"
+ resolution_hook="/etc/gosa/resolutions"
+ additionalrestrictionfilters="/bin/echo ''"
+ additionalprotocolls ="/bin/echo ''"
lang=""
theme="default"
debuglevel="0"
diff --git a/plugins/admin/systems/ServiceAddDialog.tpl b/plugins/admin/systems/ServiceAddDialog.tpl
--- /dev/null
@@ -0,0 +1,38 @@
+<div style="font-size: 18px;">
+ <div style="font-size: 18px;">
+ {t}Add a new service to this server.{/t}.
+ </div>
+</div>
+<br>
+<p class="seperator"><b>
+{t}This dialog allows you to add new services to the currenty edited server object. In the box below you can see all available services, services you have already in use are not shown.{/t} </b>
+<br>
+<br>
+</p>
+{if $Services}
+
+<br>
+
+<b>{t}Please choose a service listed below.{/t}</b>
+<br>
+<br>
+<br>{t}Available services{/t}
+ <select name="ServiceName" >
+ {html_options options=$Services }
+ </select>
+{else}
+ <br>
+ {t}There are no more services available, if you think that there is a service missing. Please check your gosa configuration file.{/t}
+ <br>
+{/if}
+<br>
+<br>
+<p class="seperator">
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveServiceAdd' value='{t}Save{/t}' {if !$Services} disabled {/if}>
+
+ <input type='submit' name='CancelServiceAdd' value='{t}Cancel{/t}'>
+</div>
+</p>
+
diff --git a/plugins/admin/systems/class_ServerService.inc b/plugins/admin/systems/class_ServerService.inc
--- /dev/null
@@ -0,0 +1,343 @@
+<?php
+
+define("START_SERVICE",1);
+define("STOP_SERVICE",2);
+define("RESET_SERVICE",3);
+
+define("SERVICE_STOPPED","stopped");
+define("SERVICE_STARTED","started");
+define("SERVICE_RESETTED","resetted");
+
+define("ALL_SERVICES",100);
+
+class ServerService extends plugin
+{
+ /* CLI vars */
+ var $cli_summary = "Manage server services";
+ var $cli_description = "Managing services by adding,removing and configuring services. Allows to start/stop used services.";
+ var $cli_parameters = array("config"=>"Config object" , "dn"=>"Object dn");
+
+ /* attribute list for save action */
+ var $ignore_account = TRUE;
+ var $attributes = array();
+ var $objectclasses = array();
+
+ var $divList = NULL;
+ var $dialog = NULL; // Contains dialog object if a dialog is opened
+
+ var $plugins = array();
+ var $pluign_names = array();
+
+ var $current = "";
+ var $backup = NULL;
+ var $acl ;
+
+ function ServerService ($config, $dn)
+ {
+ plugin::plugin($config);
+ $this->dn= $dn;
+ $ui= get_userinfo();
+ $this->acl= get_permissions ($ui->dn, $ui->subtreeACL);
+
+ foreach ($config->data['TABS']['SERVERSERVICE'] as $plug){
+ $name= $plug['CLASS'];
+ $this->plugin_names[]= $name;
+ $this->plugins[$name]= new $name($config, $dn);
+ $this->plugins[$name]->acl= get_module_permission($this->acl, "$name", $ui->dn);
+ }
+
+ $this->divList = new divListSystemService($config,$this);
+ }
+
+
+ function execute()
+ {
+ /* Variable initialisation */
+ $s_action = "";
+ $s_entry = "";
+
+ /* Walk through posts and check if there are some introductions for us */
+ $PossiblePosts = array("addNewService" => "",
+ "startServices" => "",
+ "stopServices" => "",
+ "resetServices" => "",
+ "removeServices" => "",
+
+ "StartSingleService" => "/^StartSingleService_(.*)_[xy]$/",
+ "StopSingleService" => "/^StopSingleService_(.*)_[xy]$/",
+ "ResetSingleService" => "/^ResetSingleService_(.*)_[xy]$/",
+ "RemoveSingleService" => "/^RemoveSingleService_(.*)_[xy]$/",
+ "EditSingleService" => "/^EditSingleService_(.*)_[xy]$/");
+
+
+ $once = true;
+ foreach($_POST as $name => $value){
+ foreach($PossiblePosts as $pregCheck => $idPreg) {
+ if(preg_match("/^".$pregCheck."/",$name) && $once){
+ $once = false;
+ $s_action = $pregCheck;
+
+ if(!empty($idPreg)){
+ $s_entry = preg_replace($idPreg,"\\1",$name);
+ }
+ }
+ }
+ }
+
+
+ /* Handle state changes for services */
+ $map = array( "startServices" => array("type" => START_SERVICE , "service" => ALL_SERVICES),
+ "stopServices" => array("type" => STOP_SERVICE , "service" => ALL_SERVICES),
+ "resetServices" => array("type" => RESET_SERVICE , "service" => ALL_SERVICES),
+ "StartSingleService" => array("type" => START_SERVICE , "service" => $s_entry),
+ "StopSingleService" => array("type" => STOP_SERVICE , "service" => $s_entry),
+ "ResetSingleService" => array("type" => RESET_SERVICE , "service" => $s_entry));
+ if(isset($map[$s_action])){
+ $type = $map[$s_action]['type'];
+ $service = $map[$s_action]['service'];
+ $this->ServiceStatusUpdate($type,$service);
+ }
+
+
+ /* Open service add dialog */
+ if($s_action == "addNewService"){
+ $this->dialog = new ServiceAddDialog($this->config,$this->dn,$this);
+ }
+
+
+ /* Remove service */
+ if($s_action == "RemoveSingleService"){
+ $this->plugins[$s_entry]->is_account= false;
+ $this->plugins[$s_entry] = NULL;
+ $this->plugins[$s_entry] = new $s_entry($this->config,$this->dn);
+ $this->plugins[$s_entry]->acl = $this->acl;
+ $this->plugins[$s_entry]->is_account = false;
+ }
+
+
+ /* Edit a service and make a backup from all attributes,
+ to be able to restore old values after aborting dialog */
+ if($s_action == "EditSingleService"){
+ $this->backup = get_object_vars($this->plugins[$s_entry]);
+ $this->dialog = $this->plugins[$s_entry];
+ $this->current = $s_entry;
+ }
+
+
+ /* Abort service add */
+ if(isset($_POST['CancelServiceAdd'])){
+ $this->dialog = NULL;
+ $this->backup = NULL;
+ $this->current = "";
+ }
+
+
+ /* Abort dialog
+ Restore vars with values before editing */
+ if(isset($_POST['CancelService'])){
+ if($this->backup == NULL){
+ $this->plugins[$this->current] = new $this->current($this->config,$this->dn);
+ }else{
+ foreach($this->backup as $name => $value){
+ $this->plugins[$this->current]->$name = $value;
+ }
+ }
+ $this->dialog = NULL;
+ $this->backup = NULL;
+ $this->current = "";
+ }
+
+
+ /* Abort dialog */
+ if(isset($_POST['SaveService'])){
+
+ $msgs = $this->dialog->check();
+ if(count($msgs)){
+ foreach($msgs as $msg){
+ print_red($msg);
+ }
+ }else{
+ $this->plugins[$this->current] = $this->dialog;
+ $this->current = "";
+ $this->dialog = NULL;
+ $this->backup = NULL;
+ }
+ }
+
+
+ /* Abort dialog */
+ if(isset($_POST['SaveServiceAdd'])){
+ $serv = $_POST['ServiceName'];
+ $this->plugins[$serv]->is_account = true;
+ $this->dialog = $this->plugins[$serv];
+ $this->current = $serv;
+ }
+
+
+ /* There is currently a subdialog open, display this dialog */
+ if($this->dialog != NULL){
+ $this->dialog->save_object();
+ return($this->dialog->execute());
+ }
+
+
+ /* Dispaly services overview */
+ $this->divList->execute();
+ $list = array();
+ foreach($this->plugins as $name => $obj){
+ if($obj->is_account){
+ $list[$name] = $obj->getListEntry();
+ }
+ }
+ $this->divList -> setEntries($list);
+ return($this->divList->Draw());
+ }
+
+
+ /* Get all used services
+ CLASSNAME => _($this->plugins[*]->DisplayName); */
+ function getAllUsedServices()
+ {
+ $ret = array();
+ foreach($this->plugins as $name => $obj){
+ if($obj->is_account){
+ if(isset($obj->DisplayName)){
+ $ret[$name] = $obj->DisplayName;
+ }else{
+ $ret[$name] = $name;
+ }
+ }
+ }
+ return($ret);
+ }
+
+
+ /* Get all unused services
+ CLASSNAME => _($this->plugins[*]->DisplayName); */
+ function getAllUnusedServices()
+ {
+ $tmp = $this->getAllUsedServices();
+ $pool_of_ocs =array();
+ foreach($tmp as $name => $value){
+ if(isset($this->plugins[$name]->conflicts)){
+ $pool_of_ocs = array_merge($pool_of_ocs,$this->plugins[$name]->conflicts);
+ }
+ }
+
+ $ret = array();
+ foreach($this->plugins as $name => $obj){
+
+ /* Skip all pluigns that will lead into conflicts */
+ $skip = false;
+ if(isset($obj->conflicts)){
+ foreach($obj->conflicts as $oc){
+ if(in_array_ics($oc,$pool_of_ocs)){
+ $skip = true;
+ }
+ }
+ }
+ if(!$skip){
+ if(isset($obj->DisplayName)){
+ $ret[$name] = $obj->DisplayName;
+ }else{
+ $ret[$name] = $name;
+ }
+ }
+ }
+ return($ret);
+ }
+
+
+ /* This function sets the status var for each used
+ service && calls an external hook if specified in gosa.conf*/
+ function ServiceStatusUpdate($method , $service)
+ {
+ /* Skip if this is a new server */
+ if($this->dn == "new"){
+ print_red(_("Can't set status while this server is not saved."));
+ return;
+ }
+
+ $action = "";
+ if($method == START_SERVICE){
+ $action = SERVICE_STARTED;
+ }elseif($method== STOP_SERVICE){
+ $action = SERVICE_STOPPED;
+ }elseif($method == RESET_SERVICE){
+ $action = SERVICE_RESETTED;
+ }else{
+ print_red(sprintf(_("The specified method '%s' can't executed for services."),$action));
+ return;
+ }
+
+ if($service == ALL_SERVICES){
+ foreach($this->plugins as $name => $obj){
+ if($this->plugins[$name]->is_account){
+ $this->plugins[$name]->setStatus($action);
+ }
+ }
+ }else{
+ if($this->plugins[$service]->is_account){
+ $this->plugins[$service]->setStatus($action);
+ }
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ return $message;
+ }
+
+
+ function save_object()
+ {
+ foreach($this->plugins as $name => $obj){
+ if($obj->is_account){
+ $this->plugins[$name]->save_object();
+ }
+ }
+ }
+
+
+ function remove_from_parent()
+ {
+ $caseVars = array("cn","dn");
+ foreach($this->plugins as $name => $obj){
+ foreach($caseVars as $var){
+ if(isset($this->$var)){
+ $this->plugins[$name]->$var = $this->$var;
+ }
+ }
+ if($this->plugins[$name]->initially_was_account){
+ $this->plugins[$name]->remove_from_parent();
+ }
+ }
+ }
+
+
+ function save()
+ {
+ $caseVars = array("cn","dn");
+ foreach($this->plugins as $name => $obj){
+
+ foreach($caseVars as $var){
+ if(isset($this->$var)){
+ $this->plugins[$name]->$var = $this->$var;
+ }
+ }
+
+ if($this->plugins[$name]->is_account){
+ $this->plugins[$name]->save();
+ }else{
+ if($this->plugins[$name]->initially_was_account){
+ $this->plugins[$name]->remove_from_parent();
+ }
+ }
+ }
+ }
+
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_ServiceAddDialog.inc b/plugins/admin/systems/class_ServiceAddDialog.inc
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+class ServiceAddDialog extends plugin{
+
+ var $cli_summary = "This dialog is used to add services";
+ var $cli_description = "Some longer text\nfor help";
+ var $cli_parameters = array("config"=>"Config object" , "dn"=>"Object dn");
+
+ /* This plugin does not have any ocs */
+ var $objectclasses = array();
+ var $parent = NULL;
+
+ function ServiceAddDialog($config,$dn,$parent)
+ {
+ plugin::plugin($config);
+ $this->parent = $parent;
+ }
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ $smarty->assign("Services",$this->parent->getAllUnusedServices());
+ return($smarty->fetch(get_template_path("ServiceAddDialog.tpl", TRUE,dirname(__FILE__))));
+ }
+
+ function check(){ return array();}
+ function save_object(){;}
+ function save(){}
+
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_divListSystemService.inc b/plugins/admin/systems/class_divListSystemService.inc
--- /dev/null
@@ -0,0 +1,127 @@
+<?php
+
+class divListSystemService extends MultiSelectWindow
+{
+ /* CheckBoxes, to change default values modify $this->AddCheckBox */
+ var $parent ;
+ var $ui ;
+
+ function divListSystemService ($config,$parent)
+ {
+ MultiSelectWindow::MultiSelectWindow($config,"SystemService");
+
+ $this->parent = $parent;
+ $this->ui = get_userinfo();
+
+ /* Set list strings */
+ $this->SetTitle(_("Installed services"));
+ $this->SetSummary(_("Installed services"));
+
+ /* Result page will look like a headpage */
+ $this->SetHeadpageMode();
+ $this->SetInformation(_("This menu allows you to add, remove and configure the properties of a specific service."));
+
+ /* Disable buttonsm */
+ $this->EnableCloseButton(false);
+ $this->EnableSaveButton (false);
+
+ /* set Page header */
+ $this->AddHeader(array("string"=>" ","attach"=>"style='width:20px;'"));
+ $this->AddHeader(array("string"=>_("Service name")));
+ $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:100px;border-right:0px;'"));
+ $this->HideFilterPart();
+ $this->SetHeight(500);
+ }
+
+ function GenHeader()
+ {
+ /* Prepare departments,
+ which are shown in the listbox on top of the listbox
+ */
+ $options= "";
+ foreach ($this->config->idepartments as $key => $value){
+ if ($this->selectedBase == $key){
+ $options.= "<option selected='selected' value='$key'>$value</option>";
+ } else {
+ $options.= "<option value='$key'>$value</option>";
+ }
+ }
+ $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
+ " <input class='center' type='image' align='middle' src='images/select_new_server.png' class='center'
+ name='addNewService' alt='"._("Add service")."' title='"._("Add new service")."'> ".
+ " <input class='center' type='image' align='middle' src='images/status_start_all.png' class='center'
+ name='startServices' alt='"._("Start all")."' title='"._("Start all services")."'> ".
+ " <input class='center' type='image' align='middle' src='images/status_stop_all.png' class='center'
+ name='stopServices' alt='"._("Stop service")."' title='"._("Stop all services")."'> ".
+ " <input class='center' type='image' align='middle' src='images/status_restart_all.png' class='center'
+ name='resetServices' alt='"._("Reset service")."' title='"._("Reset all services")."'> ".
+ "</div>";
+ $this->SetListHeader($listhead);
+ }
+
+ function execute()
+ {
+ $this->ClearElementsList();
+ $this->GenHeader();
+ }
+
+ function setEntries($list)
+ {
+ foreach($list as $name => $entry){
+
+ switch($entry['Status']){
+ case '' : $str ="";break;
+ case SERVICE_STOPPED : $str ="<img src='images/status_stopped.png' title='"._("Stopped")."'>"; break;
+ case SERVICE_STARTED : $str ="<img src='images/status_running.png' title='"._("Started")."'>"; break;
+ case SERVICE_RESETTED : $str ="<img src='images/status_restarting.png' title='"._("Restarting")."' alt='R'>"; break;
+ default: $str= "<img src='images/select_user.png' alt='".$entry['Status']."' title='"._("User status")." : ".$entry['Status']."'>";
+ }
+
+ $field1 = array("string" => $str ,"attach" => "style='width:20px;'");
+ $field2 = array("string" => $entry['Message'] );
+
+ $actions ="";
+ if($entry['AllowStart']){
+ $actions .= " <input type='image' name='StartSingleService_".$name."' src='images/status_start.png'>";
+ }else{
+ $actions .= " <img src='images/empty' width='16' alt=''>";
+ }
+ if($entry['AllowStart']){
+ $actions .= " <input type='image' name='StopSingleService_".$name."' src='images/status_stop.png'>";
+ }else{
+ $actions .= " <img src='images/empty' width='16' alt=''>";
+ }
+ if($entry['AllowStart']){
+ $actions .= " <input type='image' name='ResetSingleService_".$name."' src='images/status_restart.png'>";
+ }else{
+ $actions .= " <img src='images/empty' width='16' alt=''>";
+ }
+ if($entry['AllowEdit']){
+ $actions .= " <input type='image' name='EditSingleService_".$name."' src='images/edit.png'>";
+ }else{
+ $actions .= " <img src='images/empty' width='16' alt=''>";
+ }
+ if($entry['AllowRemove']){
+ $actions .= " <input type='image' name='RemoveSingleService_".$name."' src='images/edittrash.png'>";
+ }else{
+ $actions .= " <img src='images/empty' width='16' alt=''>";
+ }
+
+ $field3 = array("string" => $actions ,"attach" => "style='width:100px;border-right:0px;'");
+ $this->AddElement(array($field1,$field2,$field3));
+ }
+ }
+
+ function Save()
+ {
+ MultiSelectWindow :: Save();
+ }
+
+ function save_object()
+ {
+ /* Save automatic created POSTs like regex, checkboxes */
+ MultiSelectWindow :: save_object();
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goCupsServer.inc b/plugins/admin/systems/class_goCupsServer.inc
--- /dev/null
@@ -0,0 +1,128 @@
+<?php
+
+class goCupsServer extends plugin{
+
+ var $cli_summary = "This plugin is used within the ServerService Pluign \nand indicates that this server supports cups management.";
+ 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("goCupsServer");
+ var $attributes = array("goCupsServerStatus");
+ var $StatusFlag = "goCupsServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goCupsServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $acl;
+
+ var $goCupsServerStatus = "";
+
+ function goCupsServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("Print service");
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ return($smarty->fetch(get_template_path("goCupsServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Print service");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass"));
+
+ if($ldap->count()){
+ $attrs =array();
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goCupsServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goCupsServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ plugin::save_object();
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goFaxServer.inc b/plugins/admin/systems/class_goFaxServer.inc
--- /dev/null
@@ -0,0 +1,147 @@
+<?php
+
+class goFaxServer extends plugin{
+
+ 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("goFaxServerStatus","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 = "";
+
+ function goFaxServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("FAX database");
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ return($smarty->fetch(get_template_path("goFaxServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("FAX database configuration");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass","goFaxAdmin", "goFaxPassword"));
+
+ if($ldap->count()){
+ $attrs =array();
+ foreach(array("goFaxAdmin", "goFaxPassword") as $req) {
+ if(!isset($attrs[$req])){
+ if(empty($this->$req)){
+ print_red(sprintf(_("The required attribute '%s' is not set."),$req));
+ }else{
+ $attrs[$req] = $this->$req;
+ }
+ }else{
+ $attrs[$req] = $attrs[$req][0];
+ }
+ }
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goFaxServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goFaxServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ if ($this->goFaxAdmin == "" || preg_match("/ /", $this->goFaxAdmin)){
+ $message[]= sprintf(_("The attribute '%s' is empty or contains invalid characters."), "goFaxAdmin");
+ }
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ if(isset($_POST['goFaxServerPosted'])){
+ plugin::save_object();
+ }
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goFonServer.inc b/plugins/admin/systems/class_goFonServer.inc
--- /dev/null
@@ -0,0 +1,152 @@
+<?php
+
+class goFonServer extends plugin{
+
+ var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports asterisk management.";
+ 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("goFonServer");
+ var $attributes = array("goFonServerStatus","goFonAdmin", "goFonPassword","goFonAreaCode", "goFonCountryCode");
+ var $StatusFlag = "goFonServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goFonServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $acl;
+
+ var $goFonServerStatus = "";
+ var $goFonPassword = "";
+ var $goFonAdmin = "";
+ var $goFonAreaCode = "";
+ var $goFonCountryCode = "";
+
+
+ function goFonServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("Asterisk management");
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ return($smarty->fetch(get_template_path("goFonServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Asterisk management");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass","goFonAdmin", "goFonAreaCode", "goFonCountryCode","goFonPassword"));
+
+ if($ldap->count()){
+ $attrs =array();
+ foreach(array("goFonAdmin", "goFonAreaCode", "goFonCountryCode","goFonPassword") as $req) {
+ if(!isset($attrs[$req])){
+ if(empty($this->$req)){
+ print_red(sprintf(_("The required attribute '%s' is not set."),$req));
+ }else{
+ $attrs[$req] = $this->$req;
+ }
+ }else{
+ $attrs[$req] = $attrs[$req][0];
+ }
+ }
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goFonServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goFonServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ foreach (array("goFonAdmin", "goFonAreaCode", "goFonCountryCode") as $attr){
+ if ($this->$attr == "" || preg_match("/ /", $this->$attr)){
+ $message[]= sprintf(_("The attribute '%s' is empty or contains invalid characters."), $attr);
+ }
+ }
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ if(isset($_POST['goFonServerPosted'])){
+ plugin::save_object();
+ }
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goGlpiServer.inc b/plugins/admin/systems/class_goGlpiServer.inc
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+
+class goGlpiServer extends plugin{
+
+ var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports asterisk management.";
+ 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("goGlpiServer");
+ var $attributes = array("goGlpiServerStatus","goGlpiAdmin","goGlpiDatabase","goGlpiPassword");
+ var $StatusFlag = "goGlpiServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goGlpiServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $acl;
+
+ var $goGlpiServerStatus ="";
+ var $goGlpiAdmin ="";
+ var $goGlpiDatabase ="";
+ var $goGlpiPassword ="";
+
+
+ function goGlpiServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("Glpi database");
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ return($smarty->fetch(get_template_path("goGlpiServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Glpi management");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass","goGlpiAdmin","goGlpiDatabase"));
+
+ if($ldap->count()){
+ $attrs =array();
+ foreach(array("goGlpiAdmin","goGlpiDatabase") as $req) {
+ if(!isset($attrs[$req])){
+ if(empty($this->$req)){
+ print_red(sprintf(_("The required attribute '%s' is not set."),$req));
+ }else{
+ $attrs[$req] = $this->$req;
+ }
+ }else{
+ $attrs[$req] = $attrs[$req][0];
+ }
+ }
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goGlpiServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goGlpiServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ foreach(array("goGlpiAdmin","goGlpiDatabase") as $attr){
+ if(empty($this->$attr)){
+ $message[]= sprintf(_("The attribute '%s' is empty or contains invalid characters."), $attr);
+ }
+ }
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ if(isset($_POST['goLogDBServerPosted'])){
+ plugin::save_object();
+ }
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goImapServer.inc b/plugins/admin/systems/class_goImapServer.inc
--- /dev/null
@@ -0,0 +1,209 @@
+<?php
+
+class goImapServer extends plugin{
+
+ var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports mailqueue listings and so on.";
+ 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("goImapServer");
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goImapServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $StatusFlag = "goImapServerStatus";
+ var $attributes = array("goImapServerStatus",
+ "goImapName","goImapConnect","goImapAdmin","goImapPassword",
+ "goImapSieveServer","goImapSievePort",
+ "cyrusImap","cyrusImapSSL","cyrusPop3","cyrusPop3SSL");
+
+ var $cn;
+
+ var $goImapName = "";
+ var $goImapConnect = "";
+ var $goImapAdmin = "";
+ var $goImapPassword = "";
+
+ var $goImapSieveServer = "";
+ var $goImapSievePort = "";
+
+ var $goImapServerStatus = "";
+
+ var $cyrusImap = false;
+ var $cyrusImapSSL = false;
+ var $cyrusPop3 = false;
+ var $cyrusPop3SSL = false;
+ var $is_account = false;
+
+ var $acl;
+
+ var $Actions = array();
+
+ function goImapServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+
+ $this->DisplayName = _("Cyrus service");
+
+ $this->Actions = array( SERVICE_STOPPED=>SERVICE_STOPPED,
+ SERVICE_STARTED => SERVICE_STARTED,
+ SERVICE_RESETTED=>SERVICE_RESETTED,
+ "repair_database"=>_("Repair database"));
+
+ }
+
+ function execute()
+ {
+ $smarty = get_smarty();
+
+ /* set new status */
+ if(isset($_POST['ExecAction'])){
+ if(isset($this->Actions[$_POST['action']])){
+ $this->setStatus($_POST['action']);
+ }
+ }
+
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ $smarty->assign("Actions",$this->Actions);
+ $smarty->assign("is_new",$this->dn);
+ return($smarty->fetch(get_template_path("goImapServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Cyrus service");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+ function save()
+ {
+ $this->goImapSieveServer = $this->cn;
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass","goImapName","goImapConnect","goImapAdmin","goImapPassword"));
+
+ if($ldap->count()){
+
+ $attrs =array();
+ foreach(array("goImapName","goImapConnect","goImapAdmin","goImapPassword") as $required){
+ if(!isset($attrs[$required])){
+ if(empty($this->$required)){
+ print_red(_("Can't set new status while there are blank option within generic configuration part."));
+ return;
+ }else{
+ $attrs[$required] = $this->$required;
+ }
+ }else{
+ $attrs[$required] = $attrs[$required][0];
+ }
+ }
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goImapServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goImapServer";
+ }
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ if(empty($this->goImapName)){
+ $message[] =_("Please specify a server identifier.");
+ }
+ if(empty($this->goImapConnect)){
+ $message[] =_("Please specify a connect url.");
+ }
+ if(empty($this->goImapAdmin)){
+ $message[] =_("Please specify an admin user.");
+ }
+ if(empty($this->goImapPassword)){
+ $message[] =_("Please specify a password for the admin user.");
+ }
+
+ /* Check connect string */
+ if (!preg_match('/^\{[^:]+:[0-9]+.*\}$/', $this->goImapConnect)){
+ $message[]= sprintf(_("The imap connect string needs to be in the form '%s'."),
+ '{server-name:port/options}');
+ }
+ if (!preg_match('/^[0-9]+$/', $this->goImapSievePort)){
+ $message[]= _("The sieve port needs to be numeric.");
+ }
+
+ return ($message);
+ }
+
+
+ function save_object()
+ {
+ if(isset($_POST['goImapServerPosted'])){
+ plugin::save_object();
+
+ foreach(array("cyrusImap","cyrusImapSSL","cyrusPop3","cyrusPop3SSL") as $checkbox) {
+ if(!isset($_POST[$checkbox])){
+ $this->$checkbox = false;
+ }else{
+ $this->$checkbox = true;
+ }
+ }
+ }
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goKrbServer.inc b/plugins/admin/systems/class_goKrbServer.inc
--- /dev/null
@@ -0,0 +1,155 @@
+<?php
+
+class goKrbServer extends plugin{
+
+ var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports NTP service.";
+ 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("goKrbServer");
+ var $attributes = array("goKrbServerStatus","goKrbRealm", "goKrbAdmin","goKrbPassword");
+ var $StatusFlag = "goKrbServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goKrbServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $goKrbServerStatus= "";
+ var $acl;
+
+ var $goKrbRealm = "";
+ var $goKrbAdmin = "";
+ var $goKrbPassword ="";
+
+ function goKrbServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("Kerberos kadmin access informations");
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ return($smarty->fetch(get_template_path("goKrbServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Kerberos kadmin access informations");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass","goKrbRealm","goKrbAdmin","goKrbPassword"));
+
+ if($ldap->count()){
+ $attrs =array();
+ foreach(array("goKrbRealm","goKrbAdmin","goKrbPassword") as $req) {
+ if(!isset($attrs[$req])){
+ if(empty($this->$req)){
+ print_red(sprintf(_("The required attribute '%s' is not set."),$req));
+ }else{
+ $attrs[$req] = $this->$req;
+ }
+ }else{
+ $attrs[$req] = $attrs[$req][0];
+ }
+ }
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goKrbServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goKrbServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ foreach (array("goKrbAdmin", "goKrbRealm") as $attr){
+ if ($this->$attr == "" || preg_match("/ /", $this->$attr)){
+ $message[]= sprintf(_("The attribute '%s' is empty or contains invalid characters."), $attr);
+ }
+ }
+ /* goKrbPassword is a must field, if goKrbServer is used as objectClass */
+ if ($this->goKrbPassword == "" ){
+ $message[]= sprintf(_("The specified kerberos password is empty."), $attr);
+ }
+
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ if(isset($_POST['goKrbServerPosted'])){
+ plugin::save_object();
+ }
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goLdapServer.inc b/plugins/admin/systems/class_goLdapServer.inc
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+
+class goLdapServer extends plugin{
+
+ var $cli_summary = "This plugin is used within the ServerService Pluign \nand indicates that this server has goLdapServer defined.";
+ 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("goLdapServer");
+ var $attributes = array("goLdapServerStatus","goLdapBase");
+ var $StatusFlag = "goLdapServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goLdapServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $acl;
+
+ var $goLdapServerStatus = "";
+ var $goLdapBase = "";
+
+ function goLdapServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("LDAP Service");
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ return($smarty->fetch(get_template_path("goLdapServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("LDAP Service");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass","goLdapBase"));
+
+ if($ldap->count()){
+ $attrs =array();
+ foreach(array("goLdapBase") as $req) {
+ if(!isset($attrs[$req])){
+ if(empty($this->$req)){
+ print_red(sprintf(_("The required attribute '%s' is not set."),$req));
+ }else{
+ $attrs[$req] = $this->$req;
+ }
+ }else{
+ $attrs[$req] = $attrs[$req][0];
+ }
+ }
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goLdapServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goLdapServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ if(isset($_POST['goLdapServerPosted'])){
+ plugin::save_object();
+ }
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goLogDBServer.inc b/plugins/admin/systems/class_goLogDBServer.inc
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+
+class goLogDBServer extends plugin{
+
+ var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports asterisk management.";
+ 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("goLogDBServer");
+ var $attributes = array("goLogDBServerStatus","goLogAdmin", "goLogPassword");
+ var $StatusFlag = "goLogDBServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goLogDBServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $acl;
+
+ var $goLogDBServerStatus = "";
+ var $goLogAdmin = "";
+ var $goLogPassword = "";
+
+
+ function goLogDBServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("Logging database");
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ return($smarty->fetch(get_template_path("goLogDBServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Asterisk management");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass","goLogAdmin","goLogPassword"));
+
+ if($ldap->count()){
+ $attrs =array();
+ foreach(array("goLogAdmin","goLogPassword") as $req) {
+ if(!isset($attrs[$req])){
+ if(empty($this->$req)){
+ print_red(sprintf(_("The required attribute '%s' is not set."),$req));
+ }else{
+ $attrs[$req] = $this->$req;
+ }
+ }else{
+ $attrs[$req] = $attrs[$req][0];
+ }
+ }
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goLogDBServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goLogDBServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ if ($this->goLogAdmin == "" || preg_match("/ /", $this->goLogAdmin)){
+ $message[]= sprintf(_("The attribute '%s' is empty or contains invalid characters."), "goLogAdmin");
+ }
+ if ($this->goLogPassword == "" || preg_match("/ /", $this->goLogPassword)){
+ $message[]= sprintf(_("The attribute '%s' is empty or contains invalid characters."), "goLogPassword");
+ }
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ if(isset($_POST['goLogDBServerPosted'])){
+ plugin::save_object();
+ }
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goMailServer.inc b/plugins/admin/systems/class_goMailServer.inc
--- /dev/null
@@ -0,0 +1,690 @@
+<?php
+
+class goMailServer extends plugin{
+
+ var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports mailqueue listings and so on.";
+ 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("goMailServer");
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goMailServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $StatusFlag = "goMailServerStatus";
+ var $attributes = array("goMailServerStatus","description","postfixHeaderSizeLimit",
+ "postfixMailboxSizeLimit","postfixMessageSizeLimit",
+ "postfixMyDestinations","postfixMyDomain","postfixMyhostname",
+ "postfixMyNetworks","postfixRelayhost","postfixTransportTable",
+ "postfixSenderRestrictions","postfixRecipientRestrictions");
+
+ var $goMailServerStatus ;
+ var $postfixHeaderSizeLimit = 0;
+ var $postfixMailboxSizeLimit = 0;
+ var $postfixMessageSizeLimit = 0;
+ var $postfixMyDestinations = array();
+ var $postfixMyDomain = "";
+ var $postfixMyhostname = "";
+ var $postfixMyNetworks = array();
+ var $postfixRelayhost = "";
+ var $postfixTransportTable = array();
+ var $postfixSenderRestrictions = array();
+ var $postfixRecipientRestrictions = array();
+ var $description = "";
+ var $RestrictionFilters = array();
+ var $TransportProtocols = array();
+ var $Actions = array();
+
+
+ function goMailServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("Postfix service");
+
+ $this->Actions = array( SERVICE_STOPPED=>SERVICE_STOPPED,
+ SERVICE_STARTED => SERVICE_STARTED,
+ SERVICE_RESETTED=>SERVICE_RESETTED,
+ "mailqueue"=>"mailqueue");
+
+ /* Fill RestrictionFilters TransportProtocols from external hooks */
+ $str = $this->config->data['TABS']['SERVERSERVICE'];
+ $this->TransportProtocols =array("smtp"=>"SMTP");
+ $this->RestrictionFilters = array("FILTER"=>"FILTER");
+ foreach(array("ADDITIONALRESTRICTIONFILTERS"=>"RestrictionFilters",
+ "ADDITIONALPROTOCOLLS" =>"TransportProtocols") as $file => $var){
+ $file = $this->config->data['MAIN'][$file];
+ if((isset($file)) && is_readable($file)){
+ $tmp = file_get_contents($file);
+ $tmp2= split("\n",$tmp);
+ foreach($tmp2 as $entry){
+ if(empty($entry)) continue;
+ if(preg_match("/:/",$entry)){
+ $tmp3 = split(":",$entry);
+ $r = $this->$var;
+ $r[$tmp3[0]]=$tmp3[1];
+ $this->$var = $r;
+ }else{
+ $r = $this->$var;
+ $r[$entry] =$entry;
+ $this->$var = $r;
+ }
+ }
+ }
+ }
+
+
+ /* Get postfix my networks */
+ $this->postfixMyNetworks = array();
+ if(isset($this->attrs['postfixMyNetworks'][0])){
+ $tmp = split(",",$this->attrs['postfixMyNetworks'][0]);
+ foreach($tmp as $str){
+ if(!empty($str)){
+ $this->postfixMyNetworks[base64_encode($str)] = $str;
+ }
+ }
+ }
+
+
+ /* Create full name */
+ if(isset($this->attrs['postfixMyDomain'][0])){
+ $this->postfixMyhostname .= ".".$this->attrs['postfixMyDomain'][0];
+ }
+
+
+ /* Get postfix my domains */
+ $this->postfixMyDestinations = array();
+ if(isset($this->attrs['postfixMyDestinations'][0])){
+ unset($this->attrs['postfixMyDestinations']['count']);
+ foreach($this->attrs['postfixMyDestinations'] as $str){
+ $this->postfixMyDestinations[base64_encode($str)] = $str;
+ }
+ }
+
+
+ /* Get transport tables */
+ $this->postfixTransportTable = array();
+ if(isset($this->attrs['postfixTransportTable'])){
+ $tmp = array();
+ unset($this->attrs['postfixTransportTable']['count']);
+ foreach($this->attrs['postfixTransportTable'] as $entry){
+ $nr = preg_replace("/:.*$/","",$entry);
+ $rest= trim(preg_replace("/^[^:]+:/","",$entry));
+ $src = preg_replace("/ .*$/","",$rest);
+ $rest= preg_replace("/^[^ ]+ /","",$rest);
+ $dst = preg_replace("/^.*:/","",$rest);
+ $prt = preg_replace("/:.*$/","",$rest);
+
+ $tmp[$nr]['src'] = $src;
+ $tmp[$nr]['dst'] = $dst;
+ $tmp[$nr]['prt'] = $prt;
+
+ }
+ ksort($tmp);
+ foreach($tmp as $entry){
+ $this->postfixTransportTable[] = $entry;
+ }
+ }
+
+
+ /* Get sender restrictions */
+ $this->postfixSenderRestrictions = array();
+ if(isset($this->attrs['postfixSenderRestrictions'])){
+ unset($this->attrs['postfixSenderRestrictions']['count']);
+ foreach($this->attrs['postfixSenderRestrictions'] as $entry){
+ $nr = preg_replace("/:.*$/","",$entry);
+ $rest= trim(preg_replace("/^[^:]+:/","",$entry));
+ $src = preg_replace("/ .*$/","",$rest);
+ $rest= preg_replace("/^[^ ]+ /","",$rest);
+ $dst = preg_replace("/^.* /","",$rest);
+ $prt = preg_replace("/ .*$/","",$rest);
+
+ $tmp[$nr]['src'] = $src;
+ $tmp[$nr]['dst'] = $dst;
+ $tmp[$nr]['filter'] = $prt;
+ }
+ ksort($tmp);
+ foreach($tmp as $entry){
+ $this->postfixSenderRestrictions[] = $entry;
+ }
+ }
+
+
+ /* Get sender restrictions */
+ $this->postfixRecipientRestrictions = array();
+ if(isset($this->attrs['postfixRecipientRestrictions'])){
+ unset($this->attrs['postfixRecipientRestrictions']['count']);
+ foreach($this->attrs['postfixRecipientRestrictions'] as $entry){
+ $nr = preg_replace("/:.*$/","",$entry);
+ $rest= trim(preg_replace("/^[^:]+:/","",$entry));
+ $src = preg_replace("/ .*$/","",$rest);
+ $rest= preg_replace("/^[^ ]+ /","",$rest);
+ $dst = preg_replace("/^.* /","",$rest);
+ $prt = preg_replace("/ .*$/","",$rest);
+
+ $tmp[$nr]['src'] = $src;
+ $tmp[$nr]['dst'] = $dst;
+ $tmp[$nr]['filter'] = $prt;
+ }
+ ksort($tmp);
+ foreach($tmp as $entry){
+ $this->postfixRecipientRestrictions[] = $entry;
+ }
+ }
+
+ }
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ $delAr = array( "TranslationDel_"=>"TranslationDel",
+ "SenderRestrictDel_"=>"SenderRestrictDel",
+ "RecipientRestrictDel_"=>"RecipientRestrictDel");
+
+ $once = true;
+ $s_action = "";
+ $s_entry = "";
+
+ /* Check posts for some intruductions */
+ foreach($_POST as $name => $value){
+ foreach($delAr as $preg => $type){
+ if((preg_match("/^".$preg."/",$name)) && ($once)){
+ $once = false;
+ $s_action = $type;
+ $s_entry = preg_replace("/^".$preg."/","",$name);
+ $s_entry = preg_replace("/_[xy]$/","",$s_entry);
+ }
+ }
+
+
+ if(preg_match("/^TranslationUp_/",$name) && $once){
+ $once = false;
+ $key = preg_replace("/^TranslationUp_/","",$name);
+ $key = preg_replace("/_[xy]$/","",$key);
+ $this->postfixTransportTable = $this->ArrayUp($key,$this->postfixTransportTable) ;
+ }
+ if(preg_match("/^TranslationDown_/",$name) && $once){
+ $once = false;
+ $key = preg_replace("/^TranslationDown_/","",$name);
+ $key = preg_replace("/_[xy]$/","",$key);
+ $this->postfixTransportTable = $this->ArrayDown($key,$this->postfixTransportTable) ;
+ }
+ if(preg_match("/^SenderRestrictUp_/",$name) && $once){
+ $once = false;
+ $key = preg_replace("/^SenderRestrictUp_/","",$name);
+ $key = preg_replace("/_[xy]$/","",$key);
+ $this->postfixSenderRestrictions = $this->ArrayUp($key,$this->postfixSenderRestrictions) ;
+ }
+ if(preg_match("/^SenderRestrictDown_/",$name) && $once){
+ $once = false;
+ $key = preg_replace("/^SenderRestrictDown_/","",$name);
+ $key = preg_replace("/_[xy]$/","",$key);
+ $this->postfixSenderRestrictions = $this->ArrayDown($key,$this->postfixSenderRestrictions) ;
+ }
+ if(preg_match("/^RecipientRestrictUp_/",$name) && $once){
+ $once = false;
+ $key = preg_replace("/^RecipientRestrictUp_/","",$name);
+ $key = preg_replace("/_[xy]$/","",$key);
+ $this->postfixRecipientRestrictions = $this->ArrayUp($key,$this->postfixRecipientRestrictions) ;
+ }
+ if(preg_match("/^RecipientRestrictDown_/",$name) && $once){
+ $once = false;
+ $key = preg_replace("/^RecipientRestrictDown_/","",$name);
+ $key = preg_replace("/_[xy]$/","",$key);
+ $this->postfixRecipientRestrictions = $this->ArrayDown($key,$this->postfixRecipientRestrictions) ;
+ }
+ }
+
+
+ /* Add delete my network entry */
+ if((isset($_POST['AddpostfixMyNetworks'])) && (!empty($_POST['NewString_postfixMyNetworks']))){
+ $str = $_POST['NewString_postfixMyNetworks'];
+ $this->postfixMyNetworks[base64_encode($str)] = $str;
+ }
+
+ if((isset($_POST['DelpostfixMyNetworks'])) && (count($_POST['Select_postfixMyNetworks']))){
+ foreach($_POST['Select_postfixMyNetworks'] as $str ){
+ unset($this->postfixMyNetworks[$str]);
+ }
+ }
+
+
+ /* Add delete my domain entry */
+ if((isset($_POST['AddpostfixMyDestinations'])) && (!empty($_POST['NewString_postfixMyDestinations']))){
+ $str = $_POST['NewString_postfixMyDestinations'];
+ $this->postfixMyDestinations[base64_encode($str)] = $str;
+ }
+
+ if((isset($_POST['DelpostfixMyDestinations'])) && (count($_POST['Select_postfixMyDestinations']))){
+ foreach($_POST['Select_postfixMyDestinations'] as $str ){
+ unset($this->postfixMyDestinations[$str]);
+ }
+ }
+
+
+ /* Add sender restriction */
+ if(($s_action == "SenderRestrictDel") && (isset($this->postfixSenderRestrictions[$s_entry]))){
+ unset($this->postfixSenderRestrictions[$s_entry]);
+ }
+
+ if(isset($_POST['AddpostfixSenderRestrictions'])){
+ $src = $_POST['Source_postfixSenderRestrictions'];
+ $dst = $_POST['Destination_postfixSenderRestrictions'];
+ $Filter = $_POST['SenderRestrictionFilter'];
+ $tmp['src'] = $src;
+ $tmp['dst'] = $dst;
+ $tmp['filter'] = $Filter;
+ $this->postfixSenderRestrictions[] = $tmp;
+ }
+
+
+ /* Add sender restriction */
+ if(($s_action == "RecipientRestrictDel") && (isset($this->postfixRecipientRestrictions[$s_entry]))){
+ unset($this->postfixRecipientRestrictions[$s_entry]);
+ }
+
+ if(isset($_POST['AddpostfixRecipientRestrictions'])){
+ $src = $_POST['Source_postfixRecipientRestrictions'];
+ $dst = $_POST['Destination_postfixRecipientRestrictions'];
+ $Filter = $_POST['RecipientRestrictionFilter'];
+ $tmp['src'] = $src;
+ $tmp['dst'] = $dst;
+ $tmp['filter'] = $Filter;
+ $this->postfixRecipientRestrictions[] = $tmp;
+ }
+
+
+ /* Handle transports */
+ if(($s_action == "TranslationDel") && (isset($this->postfixTransportTable[$s_entry]))){
+ unset($this->postfixTransportTable[$s_entry]);
+ }
+
+ if(isset($_POST['AddpostfixTransportTable'])){
+ $src = trim($_POST['Source_postfixTransportTable']);
+ $dst = trim($_POST['Destination_postfixTransportTable']);
+ $prt = trim($_POST['TransportProtocol']);
+
+ if((!empty($src)) && (!empty($dst))){
+ if(preg_match("/:/",$dst)){
+ $tmp = split("\:",$dst);
+ $port = trim($tmp[1]);
+ $ip = trim($tmp[0]);
+
+ if((is_ip($ip)) && (is_numeric($port))){
+ $dst = "[".$ip."]:".$port;
+ }
+ }
+ if(is_ip($dst)){
+ $dst = "[".$dst."]";
+ }
+ $tmp2 ['src'] = $src;
+ $tmp2 ['dst'] = $dst;
+ $tmp2 ['prt'] = $prt;
+
+ $this->postfixTransportTable[] = $tmp2;
+ }
+ }
+
+
+ /* Set attributes */
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ }
+
+
+ /* Create divList for translation tables */
+ $divTranslation = new divSelectBox("TransportProtocols");
+ $divTranslation->SetHeight(110);
+ foreach($this->postfixTransportTable as $key => $entry){
+ $img = "";
+
+ if($key != 0){
+ $img.= "<input type='image' src='images/sort_up.png' name='TranslationUp_".$key."' class='center'> ";
+ }else{
+ $img.= "<img src='images/empty.png' style='width:10px;'>";
+ }
+ if(($key+1) < count($this->postfixTransportTable)){
+ $img.= "<input type='image' src='images/sort_down.png' name='TranslationDown_".$key."' class='center'> ";
+ }else{
+ $img.= "<img src='images/empty.png' style='width:10px;'>";
+ }
+
+ $img.= "<input type='image' src='images/edittrash.png' name='TranslationDel_".$key."' class='center'> ";
+ $field1 = array("string"=> $entry['src']);
+ $field2 = array("string"=> $entry['dst']);
+ $field3 = array("string"=> $entry['prt'],"attach"=>"style='width:120px;'");
+ $field4 = array("string"=> $img, "attach"=>"style='border-right:0px;width:40px;'");
+ $divTranslation->AddEntry(array($field1,$field2,$field3,$field4,));
+ }
+ $smarty->assign("Div_postfixTransportTable" ,$divTranslation->DrawList());
+
+
+ /* Create divList for sender restrictions */
+ $DivSenderRestrict = new divSelectBox("postfixSenderRestrictions");
+ $DivSenderRestrict->SetHeight(110);
+ foreach($this->postfixSenderRestrictions as $key => $entry){
+ $img ="";
+
+ if($key != 0){
+ $img.= "<input type='image' src='images/sort_up.png' name='SenderRestrictUp_".$key."' class='center'> ";
+ }else{
+ $img.= "<img src='images/empty.png' style='width:10px;'>";
+ }
+ if(($key+1) < count($this->postfixSenderRestrictions)){
+ $img.= "<input type='image' src='images/sort_down.png' name='SenderRestrictDown_".$key."' class='center'> ";
+ }else{
+ $img.= "<img src='images/empty.png' style='width:10px;'>";
+ }
+
+ $img.= "<input type='image' src='images/edittrash.png' name='SenderRestrictDel_".$key."' class='center'> ";
+
+ $field1 = array("string"=> $entry['src']);
+ $field2 = array("string"=> $entry['dst']);
+ $field3 = array("string"=> $entry['filter'],"attach"=>"style='width:100px;'");
+ $field4 = array("string"=> $img, "attach"=>"style='border-right:0px;width:40px;'");
+ $DivSenderRestrict->AddEntry(array($field1,$field2,$field3,$field4,));
+ }
+ $smarty->assign("Div_postfixSenderRestrictions" ,$DivSenderRestrict->DrawList());
+
+
+ /* Create divList for translation tables */
+ $DivRecipientRestrict = new divSelectBox("postfixRecipientRestrictions");
+ $DivRecipientRestrict->SetHeight(110);
+ foreach($this->postfixRecipientRestrictions as $key => $entry){
+ $img = "";
+ if($key != 0){
+ $img.= "<input type='image' src='images/sort_up.png' name='RecipientRestrictUp_".$key."' class='center'> ";
+ }else{
+ $img.= "<img src='images/empty.png' style='width:10px;'>";
+ }
+ if(($key+1) < count($this->postfixRecipientRestrictions)){
+ $img.= "<input type='image' src='images/sort_down.png' name='RecipientRestrictDown_".$key."' class='center'> ";
+ }else{
+ $img.= "<img src='images/empty.png' style='width:10px;'>";
+ }
+ $img.= "<input type='image' src='images/edittrash.png' name='RecipientRestrictDel_".$key."' class='center'> ";
+ $field1 = array("string"=> $entry['src']);
+ $field2 = array("string"=> $entry['dst']);
+ $field3 = array("string"=> $entry['filter'],"attach"=>"style='width:100px;'");
+ $field4 = array("string"=> $img, "attach"=>"style='border-right:0px;width:40px;'");
+ $DivRecipientRestrict->AddEntry(array($field1,$field2,$field3,$field4,));
+ }
+ $smarty->assign("Div_postfixRecipientRestrictions" ,$DivRecipientRestrict->DrawList());
+
+
+ /* set new status */
+ if(isset($_POST['ExecAction'])){
+ if(isset($this->Actions[$_POST['action']])){
+ $this->setStatus($_POST['action']);
+ }
+ }
+
+
+ $smarty->assign("is_new", $this->dn);
+ $smarty->assign("TransportProtocols", $this->TransportProtocols);
+ $smarty->assign("Actions", $this->Actions);
+ $smarty->assign("RestrictionFilters", $this->RestrictionFilters);
+ $smarty->assign("postfixTransportTable" , $this->getTransports());
+ $smarty->assign("postfixSenderRestrictions" , $this->getSenderRestrictions());
+ $smarty->assign("postfixRecipientRestrictions" ,$this->getRecipientRestrictions());
+
+ return($smarty->fetch(get_template_path("goMailServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ /* return transports formated for select box */
+ function getTransports()
+ {
+ $ret = array();
+ foreach($this->postfixTransportTable as $key => $vals){
+ $ret[$key] = $vals['src']." -> ".$vals['prt'].":".$vals['dst'];
+ }
+ return($ret);
+ }
+
+
+ /* return sender restriction formated for select box */
+ function getSenderRestrictions()
+ {
+ $ret = array();
+ foreach($this->postfixSenderRestrictions as $key => $vals){
+ $ret[$key] = $vals['src']." ".$vals['filter']." ".$vals['dst'];
+ }
+ return($ret);
+ }
+
+
+ /* return recipient restriction formated for select box */
+ function getRecipientRestrictions()
+ {
+ $ret = array();
+ foreach($this->postfixRecipientRestrictions as $key => $vals){
+ $ret[$key] = $vals['src']." ".$vals['filter']." ".$vals['dst'];
+ }
+ return($ret);
+ }
+
+
+ /* Return list entry */
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Postfix"). " - ".$this->postfixMyhostname;
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+
+ /* Fix transport table*/
+ $i = 0 ;
+ $this->attrs['postfixTransportTable'] = array();
+ foreach($this->postfixTransportTable as $key => $entry){
+ $this->attrs['postfixTransportTable'][] = $i.": ".$entry['src']." ".$entry['prt'].":".$entry['dst'];
+ $i ++;
+ }
+
+
+ /* Fix sender restrictions */
+ $i = 0;
+ $this->attrs['postfixSenderRestrictions'] =array();
+ foreach($this->postfixSenderRestrictions as $key => $entry){
+ $this->attrs['postfixSenderRestrictions'][] = $i.": ".$entry['src']." ".$entry['filter']." ".$entry['dst'];
+ $i ++;
+ }
+
+
+ /* Fix recipient restrictions */
+ $i = 0;
+ $this->attrs['postfixRecipientRestrictions'] =array();
+ foreach($this->postfixRecipientRestrictions as $key => $entry){
+ $this->attrs['postfixRecipientRestrictions'][] = $i.": ".$entry['src']." ".$entry['filter']." ".$entry['dst'];
+ $i ++;
+ }
+
+
+ /* Fix mydomains */
+ $this->attrs['postfixMyDestinations'] = array();
+ foreach($this->postfixMyDestinations as $entry){
+ $this->attrs['postfixMyDestinations'][] =$entry;
+ }
+
+
+ /* Fix mydomains */
+ if(count($this->postfixMyNetworks)){
+ $this->attrs['postfixMyNetworks'] = "";
+ foreach($this->postfixMyNetworks as $entry){
+ $this->attrs['postfixMyNetworks'] .=$entry.",";
+ }
+ }else{
+ $this->attrs['postfixMyNetworks'] = array();
+ }
+
+ $this->attrs['postfixMyNetworks'] = preg_replace("/,$/","",$this->attrs['postfixMyNetworks']);
+
+ $this->attrs['postfixMyhostname'] = preg_replace("/\..*$/","",$this->postfixMyhostname);
+ $this->attrs['postfixMyDomain'] = preg_replace("/^[^\.]+\./","",$this->postfixMyhostname);
+
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass"));
+
+ if($ldap->count()){
+
+ $attrs =array();
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goMailServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goMailServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message =plugin::check();
+
+ if(!is_numeric($this->postfixHeaderSizeLimit)){
+ $message[] = _("Please specify a numeric value for header size limit.");
+ }
+
+ if(!is_numeric($this->postfixMailboxSizeLimit)){
+ $message[] = _("Please specify a numeric value for mailbox size limit.");
+ }
+
+ if(!is_numeric($this->postfixMessageSizeLimit)){
+ $message[] = _("Please specify a numeric value for message size limit.");
+ }
+
+ return $message;
+ }
+
+
+ /* Combine new array */
+ function combineArrays($ar0,$ar1,$ar2)
+ {
+ $ret = array();
+ if(is_array($ar0))
+ foreach($ar0 as $ar => $a){
+ $ret[]=$a;
+ }
+ if(is_array($ar1))
+ foreach($ar1 as $ar => $a){
+ $ret[]=$a;
+ }
+ if(is_array($ar2))
+ foreach($ar2 as $ar => $a){
+ $ret[]=$a;
+ }
+ return($ret);
+ }
+
+
+ function getpos($atr,$attrs)
+ {
+ $i = 0;
+ foreach($attrs as $attr => $name) {
+ $i++;
+ if($attr == $atr){
+ return($i);
+ }
+ }
+
+ return(-1);
+ }
+
+
+ /* TRansports the geiven Arraykey one position up*/
+ function ArrayUp($atr,$attrs)
+ {
+ $ret = $attrs;
+ $pos = $this->getpos($atr,$attrs) ;
+ $cn = count($attrs);
+ if(!(($pos == -1)||($pos == 1))){
+ $before = array_slice($attrs,0,($pos-2));
+ $mitte = array_reverse(array_slice($attrs,($pos-2),2));
+ $unten = array_slice($attrs,$pos);
+ $ret = array();
+ $ret = $this->combineArrays($before,$mitte,$unten);
+ }
+ return($ret);
+ }
+
+
+ /* TRansports the geiven Arraykey one position up*/
+ function ArrayDown($atr,$attrs)
+ {
+ $ret = $attrs;
+ $pos = $this->getpos($atr,$attrs) ;
+ $cn = count($attrs);
+ if(!(($pos == -1)||($pos == $cn))){
+ $before = array_slice($attrs,0,($pos-1));
+ $mitte = array_reverse(array_slice($attrs,($pos-1),2));
+ $unten = array_slice($attrs,($pos+1));
+ $ret = array();
+ $ret = $this->combineArrays($before,$mitte,$unten);
+ }
+ return($ret);
+ }
+
+
+ function save_object()
+ {
+ plugin::save_object();
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goNtpServer.inc b/plugins/admin/systems/class_goNtpServer.inc
--- /dev/null
@@ -0,0 +1,147 @@
+<?php
+
+class goNtpServer extends plugin{
+
+ var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports NTP service.";
+ 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("goNtpServer");
+ var $attributes = array("goTimeSource","goNtpServerStatus");
+ var $StatusFlag = "goNtpServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goNtpServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $goTimeSource = array();
+ var $goNtpServerStatus= "";
+ var $acl;
+
+
+ function goNtpServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("NTP Service");
+
+ /* Load arrays */
+ $tmp = array();
+ if (isset($this->attrs['goTimeSource'])){
+ for ($i= 0; $i<$this->attrs['goTimeSource']['count']; $i++){
+ $tmp[$this->attrs['goTimeSource'][$i]]= $this->attrs['goTimeSource'][$i];
+ }
+ }
+ $this->goTimeSource= $tmp;
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+
+ /* Here we add a new entry */
+ if(isset($_POST['NewNTPAdd']) && $_POST['NewNTPExport'] != "") {
+ $this->goTimeSource[$_POST['NewNTPExport']]= $_POST['NewNTPExport'];
+ asort($this->goTimeSource);
+ }
+
+ /* Deleting an Entry, is a bit more complicated than adding one*/
+ if(isset($_POST['DelNTPEnt'])) {
+ foreach ($_POST['goTimeSource'] as $entry){
+ if (isset($this->goTimeSource[$entry])){
+ unset($this->goTimeSource[$entry]);
+ }
+ }
+ }
+
+ $smarty->assign("goNtpServerACL",chkacl($this->acl,"goNtpServer")) ;
+ $smarty->assign("goTimeSource" , $this->goTimeSource);
+ return($smarty->fetch(get_template_path("goNtpServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("NTP service");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ $this->attrs['goTimeSource'] =array();
+ foreach($this->goTimeSource as $entry){
+ $this->attrs['goTimeSource'][] = $entry;
+ }
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass"));
+
+ if($ldap->count()){
+ $attrs =array();
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goNtpServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goNtpServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+ function check(){ return array();}
+
+function save_object(){;}
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goShareServer.inc b/plugins/admin/systems/class_goShareServer.inc
--- /dev/null
@@ -0,0 +1,269 @@
+<?php
+
+class goShareServer extends plugin{
+
+ var $cli_summary = "This plugin is used within the ServerService Pluign \nand indicates that this server supports shares.";
+ 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("goShareServer");
+ var $attributes = array("goShareServerStatus","goExportEntry");
+ var $StatusFlag = "goShareServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goShareServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $acl;
+
+ var $goShareServerStatus = "";
+ var $goExportEntry = array();
+ var $allow_mounts = false;
+
+ function goShareServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+
+ $this->DisplayName = _("Shares");
+
+ $tmp =array();
+ if(isset($this->attrs['goExportEntry'])){
+ if(isset($this->attrs['goExportEntry']['count'])){
+ for($i= 0; $i<$this->attrs['goExportEntry']['count']; $i++){
+ $entry= $this->attrs['goExportEntry'][$i];
+ $tmp[preg_replace('/\|.*$/', '', $entry)]= $entry;
+ }
+ }
+ }
+ $this->goExportEntryList = $tmp;
+
+ $ldap = $this->config->get_ldap_link();
+ $avl_objectclasses = $ldap->get_objectclasses();
+ if (isset($avl_objectclasses["mount"])) {
+ $this->allow_mounts = true;
+ }
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+
+
+ if((isset($_POST['DelNfsEnt']))&&(isset($_POST['goExportEntryList']))){
+ if($this->allow_mounts){
+ foreach($_POST['goExportEntryList'] as $entry){
+ $this->deleteFromMountList($this->goExportEntryList[$entry]);
+ }
+ }
+ foreach($_POST['goExportEntryList'] as $entry){
+ $this->deleteFromList($entry);
+ }
+ }
+
+ if(isset($_POST['NewNfsAdd'])){
+ $this->oldone = NULL;
+ $this->o_subWindow = new servnfs($this->config,$this->acl, $this->allow_mounts, $this->dn);
+ $this->dialog = true;
+ }
+
+ if((isset($_POST['NewNfsEdit']))&&(isset($_POST['goExportEntryList']))){
+ $entry = $this->goExportEntryList[$_POST['goExportEntryList'][0]];
+ $add_mount=isset($this->mounts_to_add[$entry]);
+ $this->oldone=$entry;
+ $this->o_subWindow = new servnfs($this->config,$this->acl,$this->allow_mounts,$this->dn,$entry,$add_mount);
+ $this->dialog = true;
+ }
+ if(isset($this->o_subWindow)){
+ $this->o_subWindow->save_object(TRUE);
+ }
+
+ /* Save NFS setup */
+ if(isset($_POST['NFSsave'])){
+ if(count($this->o_subWindow->check())>0){
+ foreach($this->o_subWindow->check() as $msg) {
+ print_red($msg);
+ }
+ }else{
+ $this->o_subWindow->save_object();
+ $newone = $this->o_subWindow->save();
+ $this->addToList($newone);
+ if($this->allow_mounts){
+ if($this->oldone) {
+ $this->deleteFromMountList($this->oldone);
+ }
+ if ($this->o_subWindow->should_create_mount()) {
+ $this->addToMountList($newone);
+ }
+ }
+ unset($this->o_subWindow);
+ $this->dialog = false;
+ }
+ }
+
+ /* Cancel NFS setup */
+ if(isset($_POST['NFScancel'])){
+ $this->oldone = NULL;
+ unset($this->o_subWindow);
+ $this->dialog = false;
+ }
+
+ /* Execute NFS setup dialog*/
+ if(isset($this->o_subWindow)){
+ return $this->o_subWindow->execute();
+ }
+
+
+
+
+
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ $tellSmarty= array();
+ ksort($this->goExportEntryList);
+ foreach($this->goExportEntryList as $name=>$values){
+ $tmp = split("\|",$values);
+ $tellSmarty[$name] = $tmp[0]." ".$tmp[4]." (".$tmp[2].")";
+ }
+ $smarty->assign("goExportEntry",array_keys($tellSmarty));
+ $smarty->assign("goExportEntryKeys",($tellSmarty));
+ $smarty->assign("goExportEntryACL", chkacl($this->acl, "goExportEntry"));
+
+
+ return($smarty->fetch(get_template_path("goShareServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Shares");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+
+ /* Arrays */
+ foreach (array("goExportEntryList"=>"goExportEntry") as $source => $destination){
+ $this->attrs[$destination]= array();
+ foreach ($this->$source as $element){
+ $this->attrs[$destination][]= $element;
+ }
+ }
+
+
+ /* Process netatalk mounts */
+ if($this->allow_mounts) {
+ $this->process_mounts();
+ }
+
+
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass"));
+
+ if($ldap->count()){
+ $attrs =array();
+ foreach(array() as $req) {
+ if(!isset($attrs[$req])){
+ if(empty($this->$req)){
+ print_red(sprintf(_("The required attribute '%s' is not set."),$req));
+ }else{
+ $attrs[$req] = $this->$req;
+ }
+ }else{
+ $attrs[$req] = $attrs[$req][0];
+ }
+ }
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goShareServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goShareServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ if(isset($_POST['goShareServerPosted'])){
+ plugin::save_object();
+ }
+ }
+
+ function addToList($entry){
+ $key = key($entry);
+ $this->goExportEntryList[$key]=$entry[$key];
+ }
+
+ function deleteFromList($id){
+ unset($this->goExportEntryList[$id]);
+ }
+
+
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goSyslogServer.inc b/plugins/admin/systems/class_goSyslogServer.inc
--- /dev/null
@@ -0,0 +1,128 @@
+<?php
+
+class goSyslogServer extends plugin{
+
+ var $cli_summary = "This plugin is used within the ServerService Pluign \nand indicates that this server has syslog server enabled.";
+ 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("goSyslogServer");
+ var $attributes = array("goSyslogServerStatus");
+ var $StatusFlag = "goSyslogServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goSyslogServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $acl;
+
+ var $goSyslogServerStatus = "";
+
+ function goSyslogServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("Syslog service");
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ return($smarty->fetch(get_template_path("goSyslogServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Syslog service");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass"));
+
+ if($ldap->count()){
+ $attrs =array();
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goSyslogServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goSyslogServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ plugin::save_object();
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/class_goTerminalServer.inc b/plugins/admin/systems/class_goTerminalServer.inc
--- /dev/null
@@ -0,0 +1,154 @@
+<?php
+
+class goTerminalServer extends plugin{
+
+ var $cli_summary = "This pluign is used within the ServerService Pluign \nand indicates that this server supports asterisk management.";
+ 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("goTerminalServer");
+ var $attributes = array("goTerminalServerStatus","goXdmcpIsEnabled", "goFontPath");
+ var $StatusFlag = "goTerminalServerStatus";
+
+ /* This class can't be assigned twice so it conflicts with itsself */
+ var $conflicts = array("goTerminalServer");
+
+ var $DisplayName = "";
+ var $dn = NULL;
+ var $acl;
+
+ var $goTerminalServerStatus = "";
+ var $goXdmcpIsEnabled = false;
+ var $goFontPath = "";
+
+
+ function goTerminalServer($config,$dn)
+ {
+ plugin::plugin($config,$dn);
+ $this->DisplayName = _("Terminal service");
+ }
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+ return($smarty->fetch(get_template_path("goTerminalServer.tpl",TRUE,dirname(__FILE__))));
+ }
+
+
+ function getListEntry()
+ {
+ $flag = $this->StatusFlag;
+ $fields['Status'] = $this->$flag;
+ $fields['Message'] = _("Terminal service");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowReset'] = true;
+ $fields['AllowRemove']= true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+
+ function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ function save()
+ {
+ plugin::save();
+ /* Check if this is a new entry ... add/modify */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+ }
+
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass","goXdmcpIsEnabled", "goFontPath"));
+
+ if($ldap->count()){
+ $attrs =array();
+ foreach(array("goXdmcpIsEnabled", "goFontPath") as $req) {
+ if(!isset($attrs[$req])){
+ if(empty($this->$req)){
+ print_red(sprintf(_("The required attribute '%s' is not set."),$req));
+ }else{
+ $attrs[$req] = $this->$req;
+ }
+ }else{
+ $attrs[$req] = $attrs[$req][0];
+ }
+ }
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ if(!in_array("goTerminalServer",$attrs['objectClass'])){
+ $attrs['objectClass'][] = "goTerminalServer";
+ }
+
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
+ }
+
+
+ function check()
+ {
+ $message = plugin::check();
+ if(empty($this->goFontPath)){
+ $message[]=_("Terminal server, must have fontpath specified.");
+ }
+
+ return($message);
+ }
+
+
+ function save_object()
+ {
+ if(isset($_POST['goTerminalServerPosted'])){
+ plugin::save_object();
+ if(isset($_POST['goXdmcpIsEnabled'])){
+ $this->goXdmcpIsEnabled = true;
+ }else{
+ $this->goXdmcpIsEnabled = false;
+ }
+ }
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/admin/systems/contents.tpl b/plugins/admin/systems/contents.tpl
--- /dev/null
@@ -0,0 +1 @@
+{$Kekse} sind gesund
diff --git a/plugins/admin/systems/goCupsServer.tpl b/plugins/admin/systems/goCupsServer.tpl
--- /dev/null
@@ -0,0 +1,11 @@
+<b>{t}Print Service{/t} {t}enabled{/t}</b>
+
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goCupsServerPosted" value="1">
diff --git a/plugins/admin/systems/goFaxServer.tpl b/plugins/admin/systems/goFaxServer.tpl
--- /dev/null
@@ -0,0 +1,21 @@
+<b>{t}Kerberos kadmin access{/t}</b>
+ <table summary="">
+ <tr>
+ <td>{t}FAX DB user{/t}</td>
+ <td><input name="goFaxAdmin" size=30 maxlength=60 {$goFaxAdminACL} id="goFaxAdmin" value="{$goFaxAdmin}" ></td>
+ </tr>
+ <tr>
+ <td>{t}Password{/t}</td>
+ <td><input type=password name="goFaxPassword" id="goFaxPassword" size=30 maxlength=60 {$goFaxPasswordACL} value="{$goFaxPassword}" ></td>
+ </tr>
+ </table>
+
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goFaxServerPosted" value="1">
diff --git a/plugins/admin/systems/goFonServer.tpl b/plugins/admin/systems/goFonServer.tpl
--- /dev/null
@@ -0,0 +1,28 @@
+ <table summary="">
+ <tr>
+ <td>{t}Asterisk DB user{/t}</td>
+ <td><input name="goFonAdmin" size=30 maxlength=60 id="goFonAdmin" {$goFonAdminACL} value="{$goFonAdmin}"></td>
+ </tr>
+ <tr>
+ <td>{t}Password{/t}</td>
+ <td><input type=password name="goFonPassword" id="goFonPassword" size=30 maxlength=60 {$goFonPasswordACL} value="{$goFonPassword}"></td>
+ </tr>
+ <tr>
+ <td>{t}Country dial prefix{/t}</td>
+ <td><input name="goFonCountryCode" size=10 maxlength=30 id="goFonCountryCode" {$goFonCountryCodeACL} value="{$goFonCountryCode}"></td>
+ </tr>
+ <tr>
+ <td>{t}Local dial prefix{/t}</td>
+ <td><input name="goFonAreaCode" size=10 maxlength=30 id="goFonAreaCode" {$goFonAreaCodeACL} value="{$goFonAreaCode}"></td>
+ </tr>
+ </table>
+
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goFonServerPosted" value="1">
diff --git a/plugins/admin/systems/goGlpiServer.tpl b/plugins/admin/systems/goGlpiServer.tpl
--- /dev/null
@@ -0,0 +1,30 @@
+<b>{t}Glpi database{/t}</b>
+
+ <table summary="">
+ <tr>
+ <td>{t}Logging DB user{/t}</td>
+ <td><input name="goGlpiAdmin" id="goGlpiAdmin" size=30 maxlength=60 {$goGlpiAdminACL}
+value="{$goGlpiAdmin}"></td>
+ </tr>
+ <tr>
+ <td>{t}Password{/t}</td>
+ <td><input type="password" name="goGlpiPassword" id="goGlpiPassword" size=30 maxlength=60 {$goGlpiPasswordACL}
+value="{$goGlpiPassword}"></td>
+ </tr>
+ <tr>
+ <td>{t}Database{/t}</td>
+ <td><input name="goGlpiDatabase" id="goGlpiDatabase" size=30 maxlength=60 {$goGlpiDatabaseACL}
+value="{$goGlpiDatabase}"></td>
+ </tr>
+ </table>
+
+
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goLogDBServerPosted" value="1">
diff --git a/plugins/admin/systems/goImapServer.tpl b/plugins/admin/systems/goImapServer.tpl
--- /dev/null
@@ -0,0 +1,92 @@
+<b>{t}Generic{/t}</b>
+<br>
+<table width="100%">
+ <tr>
+ <td style='width:50%;'>
+ <table summary="">
+ <tr>
+ <td>{t}Server identifier{/t}
+ </td>
+ <td><input name="goImapName" id="goImapName" size=40 maxlength=60 {$goImapNameACL} value="{$goImapName}" >
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Connect URL{/t}
+ </td>
+ <td><input name="goImapConnect" id="goImapConnect" size=40 maxlength=60 {$goImapConnectACL} value="{$goImapConnect}" >
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Admin user{/t}
+ </td>
+ <td><input name="goImapAdmin" id="goImapAdmin" size=30 maxlength=60 {$goImapAdminACL} value="{$goImapAdmin}" >
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Password{/t}
+ </td>
+ <td><input type=password name="goImapPassword" id="goImapPassword" size=30 maxlength=60 {$goImapPasswordACL} value="{$goImapPassword}" >
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Sieve port{/t}
+ </td>
+ <td><input name="goImapSievePort" id="goImapSievePort" size=10 maxlength=30 {$goImapSievePortACL} value="{$goImapSievePort}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td style="border-left:1px solid #A0A0A0;vertical-align:top;">
+ <table>
+ <tr>
+ <td>{t}Start IMAP service{/t}
+ </td>
+ <td>
+ <input type='checkbox' name='cyrusImap' value=1 {if $cyrusImap} checked {/if} {$cyrusImapACL}>
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Start IMAP SSL service{/t}
+ </td>
+ <td>
+ <input type='checkbox' name='cyrusImapSSL' value=1 {if $cyrusImapSSL} checked {/if} {$cyrusImapSSLACL}>
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Start POP3 service{/t}
+ </td>
+ <td>
+ <input type='checkbox' name='cyrusPop3' value=1 {if $cyrusPop3} checked {/if} {$cyrusPop3ACL}>
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Start POP3 SSL service{/t}
+ </td>
+ <td>
+ <input type='checkbox' name='cyrusPop3SSL' value=1 {if $cyrusPop3SSL} checked {/if} {$cyrusPop3SSLACL}>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+<p class='seperator'> </p>
+<br>
+{if $is_new == "new"}
+ {t}The server must be saved before you can use the status flag.{/t}
+{/if}
+<br>
+<select name="action" title='{t}{/t}' {if $is_new =="new"} disabled {/if}>
+ {html_options options=$Actions selected=$goImapServerStatus}
+</select>
+<input type='submit' name='ExecAction' title='{t}Set status{/t}' value='{t}Execute{/t}' {if $is_new == "new"} disabled {/if}>
+
+<p class="seperator"> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goImapServerPosted" value="1">
diff --git a/plugins/admin/systems/goKrbServer.tpl b/plugins/admin/systems/goKrbServer.tpl
--- /dev/null
@@ -0,0 +1,24 @@
+<b>{t}Kerberos kadmin access{/t}</b>
+ <table summary="">
+ <tr>
+ <td>{t}Kerberos Realm{/t}</td>
+ <td><input name="goKrbRealm" id="goKrbRealm" size=30 maxlength=60 {$goKrbRealmACL} value="{$goKrbRealm}"></td>
+ </tr>
+ <tr>
+ <td>{t}Admin user{/t}</td>
+ <td><input name="goKrbAdmin" id="goKrbAdmin" size=30 maxlength=60 {$goKrbAdminACL} value="{$goKrbAdmin}"></td>
+ </tr>
+ <tr>
+ <td>{t}Password{/t}</td>
+ <td><input type=password name="goKrbPassword" id="goKrbPassword" size=30 maxlength=60 {$goKrbPasswordACL} value="{$goKrbPassword}"></td>
+ </tr>
+ </table>
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goKrbServerPosted" value="1">
diff --git a/plugins/admin/systems/goLdapServer.tpl b/plugins/admin/systems/goLdapServer.tpl
--- /dev/null
@@ -0,0 +1,13 @@
+<b>{t}LDAP Service{/t}</b>
+
+<input type="text" style="width:70%" value="{$goLdapBase}" {$goLdapBaseACL} name="goLdapBase" id="goLdapBaseId">
+
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goLdapServerPosted" value="1">
diff --git a/plugins/admin/systems/goLogDBServer.tpl b/plugins/admin/systems/goLogDBServer.tpl
--- /dev/null
@@ -0,0 +1,21 @@
+<b>{t}Logging database{/t}</b>
+<table summary="">
+ <tr>
+ <td>{t}Logging DB user{/t}</td>
+ <td><input name="goLogAdmin" id="goLogAdmin" size=30 maxlength=60 {$goLogAdminACL} value="{$goLogAdmin}"></td>
+ </tr>
+ <tr>
+ <td>{t}Password{/t}</td>
+ <td><input type=password name="goLogPassword" id="goLogPassword" size=30 maxlength=60 {$goLogPasswordACL} value="{$goLogPassword}"></td>
+ </tr>
+ </table>
+
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goLogDBServerPosted" value="1">
diff --git a/plugins/admin/systems/goMailServer.tpl b/plugins/admin/systems/goMailServer.tpl
--- /dev/null
@@ -0,0 +1,157 @@
+<img src='images/mail.png'><b>{t}Generic{/t}</b>
+<br><br>
+{t}Visible full qualified hostname{/t} <input type="text" name='postfixMyhostname' value='{$postfixMyhostname}' title='{t}The full qualified host name.{/t}'>
+<table style="width:100%;">
+ <tr>
+ <td width="50%">
+ <table >
+ <tr>
+ <td>{t}Max mail header size{/t}
+ </td>
+ <td>
+ <input type="text" name='postfixHeaderSizeLimit' value='{$postfixHeaderSizeLimit}'
+ title='{t}This value specifies the maximal header size.{/t}'> {t}KB{/t}
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Max mailbox size{/t}
+ </td>
+ <td>
+ <input type="text" name='postfixMailboxSizeLimit' value='{$postfixMailboxSizeLimit}'
+ title='{t}Defines the maximal size of mail box.{/t}'> {t}KB{/t}
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Max message size{/t}
+ </td>
+ <td>
+ <input type="text" name='postfixMessageSizeLimit' value='{$postfixMessageSizeLimit}'
+ title='{t}Specify the maximal size of a message.{/t}'> {t}KB{/t}
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Relay host{/t}
+ </td>
+ <td>
+ <input type="text" name='postfixRelayhost' value='{$postfixRelayhost}'
+ title='{t}Relay messages to following host.{/t}'>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td style="border-left:1px solid #A0A0A0; ">
+ <table style="width:100%;">
+ <tr>
+ <td>
+ {t}Local networks{/t}<br>
+ <select name='Select_postfixMyNetworks[]' multiple size=6 style='width:100%;' title='{t}Postfix networks{/t}'>
+ {html_options options=$postfixMyNetworks}
+ </select>
+ <input type="text" name="NewString_postfixMyNetworks" value="">
+ <input type="submit" name="AddpostfixMyNetworks" value="{t}Add{/t}">
+ <input type="submit" name="DelpostfixMyNetworks" value="{t}Remove{/t}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <p class='seperator'> </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table style="width:100%;">
+ <tr>
+ <td>
+ {t}Domains and routing{/t}<br>
+ <select name='Select_postfixMyDestinations[]' multiple size=6 style='width:100%;' title='{t}Postfix is responsilbe for the follwing domains.{/t}'>
+ {html_options options=$postfixMyDestinations}
+ </select>
+ <input type="text" name="NewString_postfixMyDestinations" value="">
+ <input type="submit" name="AddpostfixMyDestinations" value="{t}Add{/t}">
+ <input type="submit" name="DelpostfixMyDestinations" value="{t}Remove{/t}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td style="border-left:1px solid #A0A0A0; ">
+ <table style="width:100%;">
+ <tr>
+ <td>
+ {t}Transports{/t}<br>
+ {$Div_postfixTransportTable}
+ <input type="text" name="Source_postfixTransportTable" value="">
+ <select name='TransportProtocol' title='{t}Select a transport protocoll.{/t}'>
+ {html_options options=$TransportProtocols}
+ </select>
+ <input type="text" name="Destination_postfixTransportTable" value="">
+ <input type="submit" name="AddpostfixTransportTable" value="{t}Add{/t}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <p class='seperator'> </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table style="width:100%;">
+ <tr>
+ <td>
+ {t}Restrictions for sender{/t}<br>
+ {$Div_postfixSenderRestrictions}
+ <input type="text" name="Source_postfixSenderRestrictions" value="">
+ <select name='SenderRestrictionFilter' title='{t}Restriction filter{/t}'>
+ {html_options options=$RestrictionFilters}
+ </select>
+ <input type="text" name="Destination_postfixSenderRestrictions" value="">
+ <input type="submit" name="AddpostfixSenderRestrictions" value="{t}Add{/t}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td style="border-left:1px solid #A0A0A0;">
+ <table style="width:100%;">
+ <tr>
+ <td>
+ {t}Restrictions for recipient{/t}<br>
+ {$Div_postfixRecipientRestrictions}
+ <input type="text" name="Source_postfixRecipientRestrictions" value="">
+ <select name='RecipientRestrictionFilter' title='{t}Restriction filter{/t}'>
+ {html_options options=$RestrictionFilters}
+ </select>
+ <input type="text" name="Destination_postfixRecipientRestrictions" value="">
+ <input type="submit" name="AddpostfixRecipientRestrictions" value="{t}Add{/t}">
+
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<p class='seperator'> </p>
+<br>
+{if $is_new == "new"}
+ {t}The server must be saved before you can use the status flag.{/t}
+{/if}
+<br>
+<select name="action" title='{t}{/t}' {if $is_new == "new"} disabled {/if}>
+ {html_options options=$Actions selected=$goMailServerStatus}
+</select>
+<input type='submit' name='ExecAction' title='{t}Set status{/t}' value='{t}Execute{/t}' {if $is_new == "new"} disabled {/if}>
+
+<p class="seperator"> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+
diff --git a/plugins/admin/systems/goNtpServer.tpl b/plugins/admin/systems/goNtpServer.tpl
--- /dev/null
@@ -0,0 +1,26 @@
+<br>
+<b>{t}Time server{/t}</b>
+<br>
+<table summary="" style="width:100%">
+<tr>
+ <td>
+ <select style="width:100%;" id="goTimeEntry" name="goTimeSource[]" {$goNtpServerACL} size=8 multiple>
+ {html_options values=$goTimeSource output=$goTimeSource}
+ <option disabled> </option>
+ </select>
+<br>
+ <input type="text" name="NewNTPExport" id="NewNTPExportId">
+ <input type="submit" value="{t}Add{/t}" name="NewNTPAdd" {$goNtpServerACL} id="NewNTPAddId">
+ <input type="submit" value="{t}Delete{/t}" name="DelNTPEnt" {$goNtpServerACL} id="DelNTPEntId">
+</td>
+</tr>
+</table>
+
+<p class="seperator"> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
diff --git a/plugins/admin/systems/goShareServer.tpl b/plugins/admin/systems/goShareServer.tpl
--- /dev/null
@@ -0,0 +1,26 @@
+<b>{t}Shares{/t}</b>
+ <table summary="" style="width:100%">
+ <tr>
+ <td>
+ <select style="width:100%" id="goExportEntry" name="goExportEntryList[]" {$goExportEntryACL} size=12 multiple >
+ {html_options values=$goExportEntry output=$goExportEntryKeys}
+ <option disabled> </option>
+ </select>
+ <br>
+ <input type="submit" value="{t}Add{/t}" name="NewNfsAdd" {$goExportEntryACL} id="NewNfsAddId">
+ <input type="submit" value="{t}Edit{/t}" name="NewNfsEdit" {$goExportEntryACL} id="NewNfsEditId">
+ <input type="submit" value="{t}Delete{/t}" name="DelNfsEnt" {$goExportEntryACL} id="DelNfsEntId">
+ </td>
+ </tr>
+ </table>
+
+
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goShareServerPosted" value="1">
diff --git a/plugins/admin/systems/goSyslogServer.tpl b/plugins/admin/systems/goSyslogServer.tpl
--- /dev/null
@@ -0,0 +1,11 @@
+<b>{t}Syslog Service{/t} {t}enabled{/t}</b>
+
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goCupsServerPosted" value="1">
diff --git a/plugins/admin/systems/goTerminalServer.tpl b/plugins/admin/systems/goTerminalServer.tpl
--- /dev/null
@@ -0,0 +1,23 @@
+<b>{t}Terminal Service{/t}</b>
+
+<table summary="">
+ <tr>
+ <td colspan=2>
+ <input type="checkbox" value="true" name="goXdmcpIsEnabled" {$goXdmcpIsEnabledACL}
+ id="Temporariid" {if $goXdmcpIsEnabled} checked {/if}>{t}Temporary disable login{/t}</td>
+ </tr>
+ <tr>
+ <td>{t}Font path{/t}</td>
+ <td> <input type="text" value="{$goFontPath}" name="goFontPath" {$goXdmcpIsEnabledACL} id="FontPathId"></td>
+ </tr>
+ </table>
+
+<p class='seperator'> </p>
+<p>
+<div style="width:100%; text-align:right;">
+ <input type='submit' name='SaveService' value='{t}Save{/t}'>
+
+ <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+</p>
+<input type="hidden" name="goTerminalServerPosted" value="1">