Code

Moved iconmenu to be always on top
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 22 Sep 2006 06:36:54 +0000 (06:36 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 22 Sep 2006 06:36:54 +0000 (06:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4763 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servKolab.inc
plugins/admin/systems/servkolab.tpl

index e7b78bf035d34de914ed4fa688f374d36604e4cd..7d8544a37a62188a4d3a4b74229d70d0099db085 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 
-class servkolab extends plugin {
+require_once("class_goService.inc");
+
+class servkolab extends goService {
   /* CLI vars */
   var $cli_summary = "Manage server basic objects";
   var $cli_description = "Some longer text\nfor help";
@@ -93,15 +95,13 @@ class servkolab extends plugin {
 
 
     /* Assemble free/busy string */
-    $edit       = sprintf('<input name="kolabFreeBusyFuture" value="%s" %s type="text" maxlength="3" size="4">',
-                    $this->kolabFreeBusyFuture, 
-                    chkacl($this->acl, 'kolabFreeBusyFuture'));
+    $edit       = sprintf('<input name="kolabFreeBusyFuture" value="%s" type="text" maxlength="3" size="4">',
+                    $this->kolabFreeBusyFuture);
     $fbfuture   = sprintf(_("Include data from %s days in the past when creating free/busy lists"), $edit);
 
     /* Assemble quota string */
-    $edit       = sprintf('<input name="cyrus_quotawarn" value="%s" type="text" maxlength="3" size="4" %s>',
-                    $this->cyrus_quotawarn, 
-                    chkacl($this->acl, 'cyrus_quotawarn'));
+    $edit       = sprintf('<input name="cyrus_quotawarn" value="%s" type="text" maxlength="3" size="4">',
+                    $this->cyrus_quotawarn);
     $quotastr   = sprintf(_("Warn users when using more than %s%% of their mail quota"), $edit);
 
     /***************
@@ -115,11 +115,15 @@ class servkolab extends plugin {
       $smarty->assign("RelayMxSupportCheck","");
     }
 
+    /* Set acls */
+    $tmp = $this->plInfo();
+    foreach($tmp['plProvidedAcls'] as $name => $translation){
+      $smarty->assign($name."ACL",$this->getacl($name));
+    }
+
     /* Initialize all attributes, that were submitted */
     foreach($this->attributes as $val) 
     {
-      $smarty->assign($val."ACL",chkacl($this->acl,str_replace("_","-",$val)));
-
       /* Tell smarty which variables we are useing */
       $smarty->assign($val, $this->$val);
       if (($this->$val != "FALSE") && !empty($this->$val)){
@@ -218,15 +222,25 @@ class servkolab extends plugin {
     if (isset($_POST['kolabtab'])){
       plugin::save_object();
 
+
+      foreach($this->attributes as $attr){
+        if(($this->acl_is_writeable(preg_replace("/_/","",$attr))) && (isset($_POST[$attr]))){
+          $this->$attr = $_POST[$attr];
+        }
+      }
+
       /* Save checkboxes */
       foreach (array( "postfix_enable_virus_scan", "postfix_allow_unauthenticated",
             "cyrus_admins", "cyrus_imap", "cyrus_pop3", "cyrus_imaps",
             "cyrus_pop3s", "cyrus_sieve", "apache_allow_unauthenticated_fb",
             "proftpd_ftp", "apache_http") as $cb){
-        if (isset($_POST[$cb])){
-          $this->$cb= "TRUE";
-        } else {
-          $this->$cb= "FALSE";
+
+        if($this->acl_is_writeable(preg_replace("/_/","",$cb))){
+          if (isset($_POST[$cb])){
+            $this->$cb= "TRUE";
+          } else {
+            $this->$cb= "FALSE";
+          }
         }
       }
 
@@ -344,67 +358,12 @@ class servkolab extends plugin {
 
   function getListEntry()
   {
-    $this->updateStatusState();
-    $flag = $this->StatusFlag;
-    if(empty($flag)){
-      $fields['Status']       = "";
-    }else{
-      $fields['Status']       = $this->$flag;
-    }
+    $fields                 = goService::getListEntry();
     $fields['Message']      = _("Kolab mail service");
-    $fields['AllowStart']   = true;
-    $fields['AllowStop']    = true;
-    $fields['AllowRestart'] = true;
-    $fields['AllowRemove']  = true;
     $fields['AllowEdit']    = true;
     return($fields);
   }
 
-    /* Directly save new status flag */
-  function setStatus($value)
-  { 
-    return;
-  
-    if($value == "none") return;
-    if(!$this->initially_was_account) return;
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd($this->dn);
-    $ldap->cat($this->dn,array("objectClass"));
-    if($ldap->count()){
-
-      $tmp = $ldap->fetch();
-      for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
-        $attrs['objectClass'][] = $tmp['objectClass'][$i];
-      }
-      $flag = $this->StatusFlag;
-      $attrs[$flag] = $value;
-      $this->$flag = $value;
-      $ldap->modify($attrs);
-      show_ldap_error($ldap->get_error(), sprintf(_("Set status flag for system server/kolab with dn '%s' failed."),$this->dn)); 
-      $this->action_hook();
-    }
-  }
-
-
-  /* Get updates for status flag */
-  function updateStatusState()
-  {
-    if(empty($this->StatusFlag)) return;
-
-    $attrs = array();
-    $flag = $this->StatusFlag;
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd($this->cn);
-    $ldap->cat($this->dn,array($flag));
-    if($ldap->count()){
-      $attrs = $ldap->fetch();
-    }
-    if(isset($attrs[$flag][0])){
-      $this->$flag = $attrs[$flag][0];
-    }
-  }
-
-
 
   /* Return plugin informations for acl handling */
   function plInfo()
@@ -419,21 +378,22 @@ class servkolab extends plugin {
           "plCategory"    => array("server"),
 
           "plProvidedAcls"=> array(
-            "postfix_mydomain"                => _("Postfix mydomain") ,
-            "postfix_mydestination"           => _("My destination") ,
-            "proftpd_ftp"                     => _("FTP FreeBusy service") ,
-            "postfix_mynetworks"              => _("SMTP privileged networks") ,
-            "postfix_enable_virus_scan"       => _("Enable virus scan") ,
-            "postfix_relayhost"               => _("Relayhost") ,
-            "apache_http"                     => _("HTTP FreeBusy service") ,
-            "postfix_allow_unauthenticated"   => _("Accept Internet Mail") ,
-            "cyrus_imap"                      => _("IMAP service") ,
-            "kolabFreeBusyFuture"             => _("kolabFreeBusyFuture") ,
-            "cyrus_pop3"                      => _("POP3 service") ,
-            "cyrus_imaps"                     => _("IMAP/SSL service") ,
-            "cyrus_pop3s"                     => _("POP3/SSL service") ,
-            "cyrus_sieve"                     => _("Sieve service") ,
-            "cyrus_quotawarn"                 => _("Quota settings")) 
+            "postfixmydomain"                => _("Postfix mydomain") ,
+            "postfixmydestination"           => _("My destination") ,
+            "proftpdftp"                     => _("FTP FreeBusy service") ,
+            "postfixmynetworks"              => _("SMTP privileged networks") ,
+            "postfixenablevirusscan"         => _("Enable virus scan") ,
+            "postfixrelayhost"               => _("Relayhost") ,
+            "apachehttp"                     => _("HTTP FreeBusy service") ,
+            "apacheallowunauthenticatedfb"   => _("Allow unauthenticated free busy"),
+            "postfixallowunauthenticated"    => _("Accept Internet Mail") ,
+            "cyrusimap"                      => _("IMAP service") ,
+            "kolabFreeBusyFuture"            => _("kolabFreeBusyFuture") ,
+            "cyruspop3"                      => _("POP3 service") ,
+            "cyrusimaps"                     => _("IMAP/SSL service") ,
+            "cyruspop3s"                     => _("POP3/SSL service") ,
+            "cyrussieve"                     => _("Sieve service") ,
+            "cyrusquotawarn"                 => _("Quota settings")) 
             ));
   }
 }
index e7276ee99e4ceaa869759660a30fe528de102129..d292a7f6fdf2eafd492390a400e425d120b51d5b 100644 (file)
@@ -9,14 +9,18 @@
                <td>{t}Postfix mydomain{/t}
                </td>
                <td>
-                       <input type="text" name="postfix_mydomain" value="{$postfix_mydomain}" {$postfix_mydomainACL}>
+{render acl=$postfixmydomainACL}
+                       <input type="text" name="postfix_mydomain" value="{$postfix_mydomain}" {$postfixmydomainACL}>
+{/render}
                </td>
        </tr>
        <tr>
                <td>{t}Postfix mydestination{/t}
                </td>
                <td>
-                       <input type="text" name="postfix_mydestination" value="{$postfix_mydestination}" {$postfix_mydestinationACL}>
+{render acl=$postfixmydestinationACL}
+                       <input type="text" name="postfix_mydestination" value="{$postfix_mydestination}" {$postfixmydestinationACL}>
+{/render}
                </td>
        </tr>
    </table>    
@@ -27,7 +31,9 @@
        </tr>
        <tr>
                <td>
-                       <input id="cyrus_pop3" name="cyrus_pop3" value="1" type="checkbox" {$cyrus_pop3Check} {$cyrus_pop3ACL}>
+{render acl=$cyruspop3ACL}
+                       <input id="cyrus_pop3" name="cyrus_pop3" value="1" type="checkbox" {$cyrus_pop3Check} {$cyruspop3ACL}>
+{/render}
                </td>
                <td>
                        <LABEL for="cyrus_pop3">{t}POP3 service{/t}</LABEL>
@@ -35,7 +41,9 @@
        </tr>
        <tr>
         <td>
-            <input id="cyrus_pop3s" name="cyrus_pop3s" value="1" type="checkbox" {$cyrus_pop3sCheck} {$cyrus_pop3sACL}>
+{render acl=$cyruspop3sACL}
+            <input id="cyrus_pop3s" name="cyrus_pop3s" value="1" type="checkbox" {$cyrus_pop3sCheck} {$cyruspop3sACL}>
+{/render}
         </td>
                <td>
                        <LABEL for="cyrus_pop3s">{t}POP3/SSL service{/t}</LABEL>
@@ -43,7 +51,9 @@
     </tr>
     <tr>
         <td>
-            <input id="cyrus_imap" name="cyrus_imap" value="1" type="checkbox" {$cyrus_imapCheck} {$cyrus_imapACL}>
+{render acl=$cyrusimapACL}
+            <input id="cyrus_imap" name="cyrus_imap" value="1" type="checkbox" {$cyrus_imapCheck} {$cyrusimapACL}>
+{/render}
         </td>
         <td>
                        <LABEL for="cyrus_imap">{t}IMAP service{/t}</LABEL>
@@ -51,7 +61,9 @@
     </tr>
     <tr>
         <td>
-            <input id="cyrus_imaps" name="cyrus_imaps" value="1" type="checkbox" {$cyrus_imapsCheck} {$cyrus_imapsACL}>
+{render acl=$cyrusimapsACL}
+            <input id="cyrus_imaps" name="cyrus_imaps" value="1" type="checkbox" {$cyrus_imapsCheck} {$cyrusimapsACL}>
+{/render}
         </td>
         <td>
                        <LABEL for="cyrus_imaps">{t}IMAP/SSL service{/t}</LABEL>
@@ -59,7 +71,9 @@
     </tr>
     <tr>
         <td>
-            <input id="cyrus_sieve" name="cyrus_sieve" value="1" type="checkbox" {$cyrus_sieveCheck} {$cyrus_sieveACL}>
+{render acl=$cyrussieveACL}
+            <input id="cyrus_sieve" name="cyrus_sieve" value="1" type="checkbox" {$cyrus_sieveCheck} {$cyrussieveACL}>
+{/render}
         </td>
         <td>
                        <LABEL for="cyrus_sieve">{t}Sieve service{/t}</LABEL>
@@ -67,7 +81,9 @@
     </tr>
     <tr>
         <td>
-            <input id="proftpd_ftp" name="proftpd_ftp" value="1" type="checkbox" {$proftpd_ftpCheck} {$proftpd_ftpACL}>
+{render acl=$proftpdftpACL}
+            <input id="proftpd_ftp" name="proftpd_ftp" value="1" type="checkbox" {$proftpd_ftpCheck} {$proftpdftpACL}>
+{/render}
         </td>  
         <td>
                        <LABEL for="proftpd_ftp">{t}FTP FreeBusy service (legacy, not interoperable with Kolab2 FreeBusy){/t}</LABEL>
@@ -75,7 +91,9 @@
     </tr>
     <tr>
         <td>
-            <input id="apache_http" name="apache_http" value="1" type="checkbox" {$apache_httpCheck} {$apache_httpACL}>
+{render acl=$apachehttpACL}
+            <input id="apache_http" name="apache_http" value="1" type="checkbox" {$apache_httpCheck} {$apachehttpACL}>
+{/render}
         </td>
         <td>
                        <LABEL for="apache_http">{t}HTTP FreeBusy service (legacy){/t}</LABEL>
     </tr>
     <tr>
         <td>
-                       <input id="postfix_enable_virus_scan" name="postfix_enable_virus_scan" value="1" type="checkbox" {$postfix_enable_virus_scanCheck} {$postfix_enable_virus_scanACL}>
+{render acl=$postfixenablevirusscanACL}
+                       <input id="postfix_enable_virus_scan" name="postfix_enable_virus_scan" value="1" type="checkbox" {$postfix_enable_virus_scanCheck} {$postfixenablevirusscanACL}>
+{/render}
         </td>
         <td>
                        <LABEL for="postfix_enable_virus_scan">{t}Amavis email scanning (virus/spam){/t}</LABEL>
        </tr>
        <tr>
                <td>
+{render acl=$cyrusquotawarnACL}
                        {$quotastr}
+{/render}
                </td>
        </tr>
    </table>
     </tr>
     <tr>
         <td>
-            <input name="apache_allow_unauthenticated_fb" value="1" type="checkbox" {$apache_allow_unauthenticated_fbCheck} {$apache_allow_unauthenticated_fbACL}> {t}Allow unauthenticated downloading of Free/Busy information{/t}
+{render acl=$apacheallowunauthenticatedfbACL}
+            <input name="apache_allow_unauthenticated_fb" value="1" type="checkbox" {$apache_allow_unauthenticated_fbCheck} {$apacheallowunauthenticatedfbACL}> {t}Allow unauthenticated downloading of Free/Busy information{/t}
+{/render}
         </td>
         </tr>
         <tr>
         <td>
+{render acl=$kolabFreeBusyFutureACL}
                {$fbfuture}
+{/render}
        </td>
      </tr>
    </table>
     <tr>
          <td>
            <LABEL for="postfix_mynetworks">{t}Hosts/networks allowed to relay{/t}</LABEL><br>
-        <input id="postfix_mynetworks" name="postfix_mynetworks" size="60" maxlength="220" value="{$postfix_mynetworks}" {$postfix_mynetworksACL} type="text">
+{render acl=$postfixmynetworksACL}
+        <input id="postfix_mynetworks" name="postfix_mynetworks" size="60" maxlength="220" value="{$postfix_mynetworks}" {$postfixmynetworksACL} type="text">
+{/render}
                <br>
                ( {t}Enter multiple values, seperated with{/t} , )
        </td>
     </tr>
     <tr>
         <td>
-            <input id="RelayMxSupport" name="RelayMxSupport" value="1" type="checkbox" {$RelayMxSupportCheck} {$postfix_relayhostACL}>
+{render acl=$postfixrelayhostACL}
+            <input id="RelayMxSupport" name="RelayMxSupport" value="1" type="checkbox" {$RelayMxSupportCheck} {$postfixrelayhostACL}>
+{/render}
                        <LABEL for="RelayMxSupport">{t}Enable MX lookup for relayhost{/t}</LABEL>
                </td>
      </tr>
        <tr>    
                <td>
                    <LABEL for="postfix_relayhost">{t}Host used to relay mails{/t}</LABEL>&nbsp;
-                       <input id="postfix_relayhost" name="postfix_relayhost" size="35" maxlength="120" value="{$postfix_relayhost}" {$postfix_relayhostACL} type="text">
+{render acl=$postfixrelayhostACL}
+                       <input id="postfix_relayhost" name="postfix_relayhost" size="35" maxlength="120" value="{$postfix_relayhost}" {$postfixrelayhostACL} type="text">
+{/render}
                </td>
        </tr>
    </table>
     </tr>
     <tr>
         <td>
-            <input id="postfix_allow_unauthenticated" name="postfix_allow_unauthenticated" value="1" type="checkbox" {$postfix_allow_unauthenticatedCheck} {$postfix_allow_unauthenticatedACL}>
+{render acl=$postfixallowunauthenticatedACL}
+            <input id="postfix_allow_unauthenticated" name="postfix_allow_unauthenticated" value="1" type="checkbox" {$postfix_allow_unauthenticatedCheck} {$postfixallowunauthenticatedACL}>
+{/render}
                <LABEL for="postfix_allow_unauthenticated">{t}Accept mail from other domains over non-authenticated SMTP{/t}</LABEL>
                </td>
      </tr>