Code

Moved imap
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Jan 2008 16:36:29 +0000 (16:36 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Jan 2008 16:36:29 +0000 (16:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8477 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/systems/services/imap/class_goImapServer.inc [deleted file]
gosa-core/plugins/admin/systems/services/imap/goImapServer.tpl [deleted file]
gosa-plugins/mail/admin/systems/services/imap/class_goImapServer.inc [new file with mode: 0644]
gosa-plugins/mail/admin/systems/services/imap/goImapServer.tpl [new file with mode: 0644]

diff --git a/gosa-core/plugins/admin/systems/services/imap/class_goImapServer.inc b/gosa-core/plugins/admin/systems/services/imap/class_goImapServer.inc
deleted file mode 100644 (file)
index e5681b9..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-<?php
-
-class goImapServer extends goService {
-       
-  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 $DisplayName      = "";
-  var $dn               = NULL;
-  var $StatusFlag       = "goImapServerStatus";
-  var $attributes       = array("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 $view_logged  =FALSE;
-
-  var $acl; 
-
-  var $Actions              = array();  
-  var $conflicts            = array("goImapServer","kolab");
-  function goImapServer(&$config,$dn)
-  {
-    goService::goService($config,$dn);
-  
-    $this->DisplayName = _("IMAP/POP3 service");
-
-    $this->Actions = array( SERVICE_STOPPED=>SERVICE_STOPPED,
-                            SERVICE_STARTED => SERVICE_STARTED,
-                            SERVICE_RESTARTED=>SERVICE_RESTARTED,
-                            "repair_database"=>_("Repair database"));
-    
-  }
-
-  function execute()
-  { 
-    $smarty = get_smarty();
-    if($this->is_account && !$this->view_logged){
-      $this->view_logged = TRUE;
-      new log("view","server/".get_class($this),$this->dn);
-    }
-    /* set new status */
-    if(isset($_POST['ExecAction'])){
-      if(isset($this->Actions[$_POST['action']])){
-
-        $tmp = $this->plInfo();
-        foreach($tmp['plProvidedAcls'] as $name => $translation) {
-          if(preg_match("/^".$_POST['action']."$/i",$name)){
-            if($this->acl_is_writeable($name)){
-              $this->setStatus($_POST['action']);
-            }
-          }
-        }
-
-      }
-    }
-
-    foreach($this->attributes as $attr){
-      $smarty->assign($attr,$this->$attr);  
-    }
-
-    $tmp = $this->plInfo();
-    foreach($tmp['plProvidedAcls'] as $name => $translation){
-      $smarty->assign($name."ACL",$this->getacl($name));
-    }
-    $smarty->assign("Actions",$this->Actions);
-    $smarty->assign("is_new",$this->dn);
-    $smarty->assign("is_acc",$this->initially_was_account);
-    return($smarty->fetch(get_template_path("goImapServer.tpl",TRUE,dirname(__FILE__))));
-  }
-
-  function getListEntry()
-  {
-    $fields               = goService::getListEntry();
-    $fields['Message']    = _("IMAP/POP3 (Cyrus) service");
-    $fields['AllowRemove']= true;
-    $fields['AllowEdit']  = true;
-    return($fields);
-  }
-
-  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($this->acl_is_writeable($checkbox)){
-          if(!isset($_POST[$checkbox])){
-            $this->$checkbox = false;
-          }else{
-            $this->$checkbox = true;
-          }
-        }
-      }
-    }
-  }
-
-
-  /* Return plugin informations for acl handling */
-  static function plInfo()
-  {
-    return (array(
-          "plShortName"   => _("IMAP/POP3"),
-          "plDescription" => _("IMAP/POP3")." ("._("Services").")",
-          "plSelfModify"  => FALSE,
-          "plDepends"     => array(),
-          "plPriority"    => 94,
-          "plSection"     => array("administration"),
-          "plCategory"    => array("server"),
-
-          "plProvidedAcls"=> array(
-
-            "start"           => _("Start"),
-            "stop"            => _("Stop"),
-            "restart"         => _("Restart"),
-            "repair_database" => _("Repair database"),
-
-            "goImapName"        =>_("Server identifier"),
-            "goImapConnect"     =>_("Connect URL"),
-            "goImapAdmin"       =>_("Admin user"),
-            "goImapPassword"    =>_("Admin password"),
-            "goImapSievePort"   =>_("Sieve port"),
-            "cyrusImap"         =>_("Start IMAP service"),
-            "cyrusImapSSL"      =>_("Start IMAP SSL service"),
-            "cyrusPop3"         =>_("Start POP3 service"),
-            "cyrusPop3SSL"      =>_("Start POP3 SSL service"))
-          ));
-  }
-
-}
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/admin/systems/services/imap/goImapServer.tpl b/gosa-core/plugins/admin/systems/services/imap/goImapServer.tpl
deleted file mode 100644 (file)
index 17c4009..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-<h2><img class="center" alt="" align="middle" src="images/rightarrow.png" /> {t}Generic{/t}</h2>
-<table width="100%">
-       <tr>
-               <td style='width:50%;'>
-                       <table summary="">
-                               <tr>
-                                       <td>{t}Server identifier{/t}{$must}
-                                       </td>
-                                       <td>
-{render acl=$goImapNameACL}
-                                               <input name="goImapName" id="goImapName" size=40 maxlength=60 value="{$goImapName}" >
-{/render}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>{t}Connect URL{/t}{$must}
-                                       </td>
-                                       <td>
-{render acl=$goImapConnectACL}
-                                               <input name="goImapConnect" id="goImapConnect" size=40 maxlength=60 value="{$goImapConnect}" >
-{/render}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>{t}Admin user{/t}{$must}
-                                       </td>
-                                       <td>
-{render acl=$goImapAdminACL}
-                                               <input name="goImapAdmin" id="goImapAdmin" size=30 maxlength=60 value="{$goImapAdmin}" >
-{/render}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>{t}Password{/t}{$must}
-                                       </td>
-                                       <td>
-{render acl=$goImapPasswordACL}
-                                       <input type=password name="goImapPassword" id="goImapPassword" size=30 maxlength=60 value="{$goImapPassword}" >
-{/render}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>{t}Sieve port{/t}{$must}
-                                       </td>
-                                       <td>
-{render acl=$goImapSievePortACL}
-                                               <input name="goImapSievePort" id="goImapSievePort" size=10 maxlength=30 value="{$goImapSievePort}">
-{/render}
-                                       </td>
-                               </tr>
-                       </table>
-               </td>
-               <td style="border-left:1px solid #A0A0A0;vertical-align:top;">
-                       <table>
-                               <tr>
-                                       <td>
-{render acl=$cyrusImapACL}
-                                               <input type='checkbox' name='cyrusImap' value=1 {if $cyrusImap} checked {/if} > 
-{/render}
-                                       </td>
-                                       <td>{t}Start IMAP service{/t}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>
-{render acl=$cyrusImapSSLACL}
-                                               <input type='checkbox' name='cyrusImapSSL' value=1 {if $cyrusImapSSL} checked {/if}> 
-{/render}
-                                       </td>
-                                       <td>{t}Start IMAP SSL service{/t}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>
-{render acl=$cyrusPop3ACL}
-                                               <input type='checkbox' name='cyrusPop3' value=1 {if $cyrusPop3} checked {/if} > 
-{/render}
-                                       </td>
-                                       <td>{t}Start POP3 service{/t}
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td>
-{render acl=$cyrusPop3SSLACL}
-                                               <input type='checkbox' name='cyrusPop3SSL' value=1 {if $cyrusPop3SSL} checked {/if} > 
-{/render}
-                                       </td>
-                                       <td>{t}Start POP3 SSL service{/t}
-                                       </td>
-                               </tr>
-                       </table>
-               </td>
-       </tr>
-</table>
-<p class='seperator'>&nbsp;</p>
-<br>
-<h2><img class="center" alt="" src="images/rocket.png" align="middle"> Action</h2>
-{if $is_new == "new"}
-    {t}The server must be saved before you can use the status flag.{/t}
-{elseif !$is_acc}
-    {t}The service must be saved before you can use the status flag.{/t}
-{/if}
-<br>
-<select name="action" title='{t}Set new status{/t}' 
-       {if $is_new =="new" || !$is_acc} disabled {/if}
->
-       <option value="none">&nbsp;</option>
-    {html_options options=$Actions}
-</select>
-<input type='submit' name='ExecAction' title='{t}Set status{/t}' value='{t}Execute{/t}' 
-       {if $is_new == "new" | !$is_acc} disabled {/if}
->
-
-<p class="seperator">&nbsp;</p>
-<div style="width:100%; text-align:right;padding-top:10px;padding-bottom:3px;">
-    <input type='submit' name='SaveService' value='{t}Save{/t}'>
-    &nbsp;
-    <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
-</div>
-<input type="hidden" name="goImapServerPosted" value="1">
diff --git a/gosa-plugins/mail/admin/systems/services/imap/class_goImapServer.inc b/gosa-plugins/mail/admin/systems/services/imap/class_goImapServer.inc
new file mode 100644 (file)
index 0000000..e5681b9
--- /dev/null
@@ -0,0 +1,187 @@
+<?php
+
+class goImapServer extends goService {
+       
+  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 $DisplayName      = "";
+  var $dn               = NULL;
+  var $StatusFlag       = "goImapServerStatus";
+  var $attributes       = array("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 $view_logged  =FALSE;
+
+  var $acl; 
+
+  var $Actions              = array();  
+  var $conflicts            = array("goImapServer","kolab");
+  function goImapServer(&$config,$dn)
+  {
+    goService::goService($config,$dn);
+  
+    $this->DisplayName = _("IMAP/POP3 service");
+
+    $this->Actions = array( SERVICE_STOPPED=>SERVICE_STOPPED,
+                            SERVICE_STARTED => SERVICE_STARTED,
+                            SERVICE_RESTARTED=>SERVICE_RESTARTED,
+                            "repair_database"=>_("Repair database"));
+    
+  }
+
+  function execute()
+  { 
+    $smarty = get_smarty();
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      new log("view","server/".get_class($this),$this->dn);
+    }
+    /* set new status */
+    if(isset($_POST['ExecAction'])){
+      if(isset($this->Actions[$_POST['action']])){
+
+        $tmp = $this->plInfo();
+        foreach($tmp['plProvidedAcls'] as $name => $translation) {
+          if(preg_match("/^".$_POST['action']."$/i",$name)){
+            if($this->acl_is_writeable($name)){
+              $this->setStatus($_POST['action']);
+            }
+          }
+        }
+
+      }
+    }
+
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr,$this->$attr);  
+    }
+
+    $tmp = $this->plInfo();
+    foreach($tmp['plProvidedAcls'] as $name => $translation){
+      $smarty->assign($name."ACL",$this->getacl($name));
+    }
+    $smarty->assign("Actions",$this->Actions);
+    $smarty->assign("is_new",$this->dn);
+    $smarty->assign("is_acc",$this->initially_was_account);
+    return($smarty->fetch(get_template_path("goImapServer.tpl",TRUE,dirname(__FILE__))));
+  }
+
+  function getListEntry()
+  {
+    $fields               = goService::getListEntry();
+    $fields['Message']    = _("IMAP/POP3 (Cyrus) service");
+    $fields['AllowRemove']= true;
+    $fields['AllowEdit']  = true;
+    return($fields);
+  }
+
+  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($this->acl_is_writeable($checkbox)){
+          if(!isset($_POST[$checkbox])){
+            $this->$checkbox = false;
+          }else{
+            $this->$checkbox = true;
+          }
+        }
+      }
+    }
+  }
+
+
+  /* Return plugin informations for acl handling */
+  static function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("IMAP/POP3"),
+          "plDescription" => _("IMAP/POP3")." ("._("Services").")",
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 94,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("server"),
+
+          "plProvidedAcls"=> array(
+
+            "start"           => _("Start"),
+            "stop"            => _("Stop"),
+            "restart"         => _("Restart"),
+            "repair_database" => _("Repair database"),
+
+            "goImapName"        =>_("Server identifier"),
+            "goImapConnect"     =>_("Connect URL"),
+            "goImapAdmin"       =>_("Admin user"),
+            "goImapPassword"    =>_("Admin password"),
+            "goImapSievePort"   =>_("Sieve port"),
+            "cyrusImap"         =>_("Start IMAP service"),
+            "cyrusImapSSL"      =>_("Start IMAP SSL service"),
+            "cyrusPop3"         =>_("Start POP3 service"),
+            "cyrusPop3SSL"      =>_("Start POP3 SSL service"))
+          ));
+  }
+
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/mail/admin/systems/services/imap/goImapServer.tpl b/gosa-plugins/mail/admin/systems/services/imap/goImapServer.tpl
new file mode 100644 (file)
index 0000000..17c4009
--- /dev/null
@@ -0,0 +1,120 @@
+<h2><img class="center" alt="" align="middle" src="images/rightarrow.png" /> {t}Generic{/t}</h2>
+<table width="100%">
+       <tr>
+               <td style='width:50%;'>
+                       <table summary="">
+                               <tr>
+                                       <td>{t}Server identifier{/t}{$must}
+                                       </td>
+                                       <td>
+{render acl=$goImapNameACL}
+                                               <input name="goImapName" id="goImapName" size=40 maxlength=60 value="{$goImapName}" >
+{/render}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>{t}Connect URL{/t}{$must}
+                                       </td>
+                                       <td>
+{render acl=$goImapConnectACL}
+                                               <input name="goImapConnect" id="goImapConnect" size=40 maxlength=60 value="{$goImapConnect}" >
+{/render}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>{t}Admin user{/t}{$must}
+                                       </td>
+                                       <td>
+{render acl=$goImapAdminACL}
+                                               <input name="goImapAdmin" id="goImapAdmin" size=30 maxlength=60 value="{$goImapAdmin}" >
+{/render}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>{t}Password{/t}{$must}
+                                       </td>
+                                       <td>
+{render acl=$goImapPasswordACL}
+                                       <input type=password name="goImapPassword" id="goImapPassword" size=30 maxlength=60 value="{$goImapPassword}" >
+{/render}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>{t}Sieve port{/t}{$must}
+                                       </td>
+                                       <td>
+{render acl=$goImapSievePortACL}
+                                               <input name="goImapSievePort" id="goImapSievePort" size=10 maxlength=30 value="{$goImapSievePort}">
+{/render}
+                                       </td>
+                               </tr>
+                       </table>
+               </td>
+               <td style="border-left:1px solid #A0A0A0;vertical-align:top;">
+                       <table>
+                               <tr>
+                                       <td>
+{render acl=$cyrusImapACL}
+                                               <input type='checkbox' name='cyrusImap' value=1 {if $cyrusImap} checked {/if} > 
+{/render}
+                                       </td>
+                                       <td>{t}Start IMAP service{/t}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>
+{render acl=$cyrusImapSSLACL}
+                                               <input type='checkbox' name='cyrusImapSSL' value=1 {if $cyrusImapSSL} checked {/if}> 
+{/render}
+                                       </td>
+                                       <td>{t}Start IMAP SSL service{/t}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>
+{render acl=$cyrusPop3ACL}
+                                               <input type='checkbox' name='cyrusPop3' value=1 {if $cyrusPop3} checked {/if} > 
+{/render}
+                                       </td>
+                                       <td>{t}Start POP3 service{/t}
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td>
+{render acl=$cyrusPop3SSLACL}
+                                               <input type='checkbox' name='cyrusPop3SSL' value=1 {if $cyrusPop3SSL} checked {/if} > 
+{/render}
+                                       </td>
+                                       <td>{t}Start POP3 SSL service{/t}
+                                       </td>
+                               </tr>
+                       </table>
+               </td>
+       </tr>
+</table>
+<p class='seperator'>&nbsp;</p>
+<br>
+<h2><img class="center" alt="" src="images/rocket.png" align="middle"> Action</h2>
+{if $is_new == "new"}
+    {t}The server must be saved before you can use the status flag.{/t}
+{elseif !$is_acc}
+    {t}The service must be saved before you can use the status flag.{/t}
+{/if}
+<br>
+<select name="action" title='{t}Set new status{/t}' 
+       {if $is_new =="new" || !$is_acc} disabled {/if}
+>
+       <option value="none">&nbsp;</option>
+    {html_options options=$Actions}
+</select>
+<input type='submit' name='ExecAction' title='{t}Set status{/t}' value='{t}Execute{/t}' 
+       {if $is_new == "new" | !$is_acc} disabled {/if}
+>
+
+<p class="seperator">&nbsp;</p>
+<div style="width:100%; text-align:right;padding-top:10px;padding-bottom:3px;">
+    <input type='submit' name='SaveService' value='{t}Save{/t}'>
+    &nbsp;
+    <input type='submit' name='CancelService' value='{t}Cancel{/t}'>
+</div>
+<input type="hidden" name="goImapServerPosted" value="1">