Code

Fixed smaller "cosmetic" errors
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 May 2005 14:20:26 +0000 (14:20 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 May 2005 14:20:26 +0000 (14:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@261 594d385d-05f5-0310-b6e9-bd551577e9d8

16 files changed:
TODO
include/class_sambaMungedDial.inc
include/functions.inc
plugins/personal/connectivity/class_kolabAccount.inc
plugins/personal/connectivity/class_phpgwAccount.inc
plugins/personal/connectivity/class_proxyAccount.inc
plugins/personal/connectivity/class_pureftpdAccount.inc
plugins/personal/connectivity/class_webdavAccount.inc
plugins/personal/connectivity/oxchange.tpl
plugins/personal/connectivity/phpgw.tpl
plugins/personal/connectivity/proxy.tpl
plugins/personal/connectivity/pureftpd.tpl
plugins/personal/generic/class_user.inc
plugins/personal/mail/class_mailAccount.inc
plugins/personal/posix/class_posixAccount.inc
plugins/personal/samba/class_sambaAccount.inc

diff --git a/TODO b/TODO
index 60a6e011c0f4e79d79ec9118e01d66daa8997002..00c3a6b53fc851c883c8d84e7a47428326202b9d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,6 +5,7 @@ Things to fix before 2.4:
   - mail groups
   - shared folders
   - server
+    + ACLs
 
 * Make it "barrierefrei"
 
index 82b514be312e00425bb8a2e1165ac62648348d35..2c08b9b9a6b47c6e95eda7e23d7077bdf0dfcb6a 100644 (file)
@@ -262,11 +262,15 @@ class sambaMungedDial
                foreach ($this->timeParams as $value) {
                        if (!isset($this->ctx[$value]) || (isset($this->ctx[$value]) && $this->ctx[$value] == 0)) {
                                $result[$value."Mode"]= "disabled";
+                       } else {
+                               $result[$value."Mode"]= "";
                        }
                }
                
                if (substr($this->ctx['CtxCfgFlags1'], 6, 1) == "1") {
                        $result['CtxInitialProgramMode'] = "disabled";
+               } else {
+                       $result['CtxInitialProgramMode'] = "";
                }
        }
 
index 72bd6723f2092d9b0e4cc94c4bbc650b13f1facf..58d618b8b0e89ff61e817d312b7cdf5475c2c8e2 100644 (file)
@@ -1529,7 +1529,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
   $trace= debug_backtrace();
   
   /* Create error header */
-  $error_collector.= "<table width=100% cellspacing=0 style='background-color:#402005;color:white;border:2px solid red'><tr><td colspan=3><b>"._("PHP error")."</b> \"$errstr\"</td></tr>";
+  $error_collector.= "<table width=100% cellspacing=0 style='background-color:#402005;color:white;border:2px solid red'><tr><td colspan=3><h1>"._("PHP error")."</h1> \"$errstr\"</td></tr>";
   
   /* Generate trace history */
   for ($index= 1; $index<count($trace); $index++){
@@ -1564,7 +1564,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
     $args= preg_replace("/, $/", "", $args);
     $file= $ct['file'];
     $line= $ct['line'];
-    $color= ($index&1)?'#452510':'351500';
+    $color= ($index&1)?'#856520':'452500';
     $error_collector.= "<tr style='background-color:$color'><td style='padding-left:20px' width=30%>"._("Trace")."[$index]: $loc</td>";
     $error_collector.= "<td>"._("File").": $file ("._('Line')." $line)</td><td width=10%>"._("Type").": $type</td></tr>";
     $error_collector.= "<tr style='background-color:$color'><td colspan=3 style='padding-left:20px;'>"._("Arguments").": $args</td></tr>";
index a7a609a5ad747c74f4374b7c4bb0b29fa291f169..705e25c00e085a7dbc6c9fad4e6ece8f1cbc5884 100644 (file)
@@ -157,6 +157,7 @@ class kolabAccount extends plugin
 
     /* Transfer delegation list */
     $smarty->assign("kolabDelegate", $this->kolabDelegate);
+    $smarty->assign("kolabDelegateACL", chkacl($this->acl, $this->kolabDelegate));
 
     /* Create InvitationPolicy table */
     $invitation= "";
index 451dbfa5fb8bd807c1f250d8f5fcc4219b97eae1..9be083a9f54aafbcab7ac25a85c273783c356c11 100644 (file)
@@ -40,6 +40,7 @@ class phpgwAccount extends plugin
     if ($this->is_account){
       $smarty->assign("phpgwState", "checked");
     } else {
+      $smarty->assign("phpgwState", "");
       $smarty->assign("fstate", "disabled");
     }
 
@@ -47,6 +48,8 @@ class phpgwAccount extends plugin
       $smarty->assign("tabbed", 1);
     }
 
+    $smarty->assign('phpgwAccountACL', chkacl($this->acl, 'phpgwAccount'));
+
     $display.= $smarty->fetch (get_template_path('phpgw.tpl', TRUE, dirname(__FILE__)));
     return ($display);
   }
index 440f25c7520101180eaec63f7fc041b73ce6b7de..9422d83e3ff61ec0a18d463062ce0acbbd22ed31 100644 (file)
@@ -73,6 +73,8 @@ class proxyAccount extends plugin
     $smarty->assign("quota_u", preg_replace("/^[0-9]+/", "", $this->gosaProxyQuota));
     if ($this->is_account){
       $smarty->assign("proxyState", "checked");
+    } else {
+      $smarty->assign("proxyState", "");
     }
 
     /* Prepare correct state */
index afc31740e1f5c06ad4c3a7ac776ada68542019e4..e2457b6651e2b3a501954a3f6683762f3d8b0d82 100644 (file)
@@ -48,6 +48,7 @@ class pureftpdAccount extends plugin
     if ($this->is_account){
       $smarty->assign("pureftpdState", "checked");
     } else {
+      $smarty->assign("pureftpdState", "");
       $smarty->assign("fstate", "disabled");
     }
     $smarty->assign("use_FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : "");
@@ -55,6 +56,7 @@ class pureftpdAccount extends plugin
     if ($this->parent != NULL){
       $smarty->assign("tabbed", 1);
     }
+    $smarty->assign("pureftpdACL", chkacl($this->acl, 'pureftpd'));
 
     $display.= $smarty->fetch (get_template_path('pureftpd.tpl', TRUE, dirname(__FILE__)));
     return ($display);
index 1618c5c702d48317cbc1268293305a2c84726bf6..2353535f29583245bb7743a41e81e2b0b0a23f57 100644 (file)
@@ -31,6 +31,7 @@ class webdavAccount extends plugin
     if ($this->is_account){
       $smarty->assign("webdavState", "checked");
     } else {
+      $smarty->assign("webdavState", "");
       $smarty->assign("wstate", "disabled");
     }
 
@@ -38,6 +39,8 @@ class webdavAccount extends plugin
       $smarty->assign("tabbed", 1);
     }
 
+    $smarty->assign('gosaWebdavACL', chkacl($this->acl, 'gosaWebdav'));
+
     $display.= $smarty->fetch (get_template_path('webdav.tpl', TRUE, dirname(__FILE__)));
     return ($display);
   }
index 72908dd70922efee07fd7b2fff0b309448b9a710..8c8ff33c00367c61f8b748c655f5a469a4792928 100644 (file)
@@ -1,7 +1,5 @@
 { if !$pg }
-<h2>{t}Open-Xchange Account{/t}
-<BR>
-{t}Disabled by lack of Postgresql Support{/t}</h2>
+<h2>{t}Open-Xchange Account{/t} - {t}disabled, no Postgresql support detected{/t}</h2>
 {else}
 <h2>{if $tabbed eq 1}<input type="checkbox" name="oxchange" value="B" {$oxchangeState} {$oxchangeAccount} onCLick="changeState('OXAppointmentDays');changeState('OXTaskDays');changeState('OXTimeZone');" >{/if}{t}Open-Xchange account{/t}</h2>
 <table style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
index b6a949e277ecbb9e4f9e6505df06528fdb7ef491..a4913d125d2e7788afd38b4112911ae6faa527fc 100644 (file)
@@ -1 +1 @@
-<h2>{if $tabbed eq 1}<input type="checkbox" name="phpgw" value="B" {$phpgwState} {$phpgwAccount}>{/if}{t}PHPGroupware account{/t}</h2>
+<h2>{if $tabbed eq 1}<input type="checkbox" name="phpgw" value="B" {$phpgwState} {$phpgwAccountACL}>{/if}{t}PHPGroupware account{/t}</h2>
index d9f4657e1070f329876c4633ee9918ededf3d62b..3af7a14179119ccd1947217dd920657518632b7a 100644 (file)
@@ -1,4 +1,4 @@
-<h2>{if $tabbed eq 1}<input type="checkbox" name="proxy" value="B" {$proxyState} {$gosaProxyACL} onclick="changeState('filterF'); changeState('filterT'); changeState('startHour'); changeState('startMinute'); changeState('stopHour'); changeState('stopMinute'); changeState('filterB'); changeState('quota_size'); changeState('quota_unit'); changeState('gosaProxyQuotaPeriod');">{/if}{t}Proxy account{/t}</h2>
+<h2>{if $tabbed eq 1}<input type="checkbox" name="proxy" value="B" {$proxyState} {$gosaProxyAcctFlagsACL} onclick="changeState('filterF'); changeState('filterT'); changeState('startHour'); changeState('startMinute'); changeState('stopHour'); changeState('stopMinute'); changeState('filterB'); changeState('quota_size'); changeState('quota_unit'); changeState('gosaProxyQuotaPeriod');">{/if}{t}Proxy account{/t}</h2>
 <table style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
  <tr>
    <td>
index 0506d2be77ef9dde05d298c996110734f9486110..d7dd875841e57f91cb46329ec789b8b7d8f52490 100644 (file)
@@ -1,4 +1,4 @@
-<h2>{if $tabbed eq 1}<input type="checkbox" name="pureftpd" value="B" {$pureftpdState} {$gosaPureftpdACL} onclick="changeState('FTPUploadBandwidth'); changeState('FTPDownloadBandwidth'); changeState('FTPQuotaFiles'); changeState('FTPQuotaMBytes'); changeState('FTPUploadRatio'); changeState('FTPDownloadRatio'); changeState('FTPStatus');" {$pureftpdACL}>{/if}{t}FTP account{/t}</h2>
+<h2>{if $tabbed eq 1}<input type="checkbox" name="pureftpd" value="B" {$pureftpdState} {$pureftpdACL} onclick="changeState('FTPUploadBandwidth'); changeState('FTPDownloadBandwidth'); changeState('FTPQuotaFiles'); changeState('FTPQuotaMBytes'); changeState('FTPUploadRatio'); changeState('FTPDownloadRatio'); changeState('FTPStatus');" {$pureftpdACL}>{/if}{t}FTP account{/t}</h2>
 
 <table style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
 
index 3368cc4181d58e19a172dfb232af3048c6bec2c3..d4babd96397c749061131ec74972ab8ea608fe77 100644 (file)
@@ -78,6 +78,7 @@ class user extends plugin
   /* variables to trigger password changes */
   var $pw_storage= "crypt";
   var $last_pw_storage= "unset";
+  var $had_userCertificate= FALSE;
 
   /* attribute list for save action */
   var $attributes= array("sn", "givenName", "uid", "personalTitle", "academicTitle",
@@ -158,8 +159,11 @@ class user extends plugin
       }
 
       /* Load extra attributes: certificate and picture */
-      $this->load_cert();
       $this->load_picture();
+      $this->load_cert();
+      if ($this->userCertificate != ""){
+        $this->had_userCertificate= TRUE;
+      }
     }
 
     /* Reset password storage indicator, used by password_change_needed() */
@@ -451,6 +455,8 @@ class user extends plugin
       } else {
         $smarty->assign("has_phoneaccount", "false");
       }
+    } else {
+        $smarty->assign("has_phoneaccount", "false");
     }
 
     return($smarty->fetch (get_template_path('generic.tpl', TRUE, dirname(__FILE__))));
@@ -728,7 +734,7 @@ class user extends plugin
     /* Remove cert? 
        For some reason, the 'ldap' class doesn't want to remove binary entries, so I need
        to work around myself. */
-    if ($remove_userCertificate == true && !$this->new){
+    if ($remove_userCertificate == true && !$this->new && $this->had_userCertificate){
 
       /* Reset array, assemble new, this should be reworked */
       $this->attrs= array();
@@ -752,9 +758,8 @@ class user extends plugin
       }
 
       /* Modify using attrs */
-      @ldap_mod_del($ds,$this->dn,$this->attrs);
+      ldap_mod_del($ds,$this->dn,$this->attrs);
       ldap_close($ds);
-
     }
 
     /* Kerberos server defined? */
index 365252c3d8ed75a1a8162b0f82a9968455b5379c..19517a7be294753c746569dc93f5b7a5d0363958 100644 (file)
@@ -448,30 +448,45 @@ class mailAccount extends plugin
     /* Fill checkboxes */
     if (!preg_match("/L/", $this->gosaMailDeliveryMode)) {
       $smarty->assign("drop_own_mails", "checked");
+    } else {
+      $smarty->assign("drop_own_mails", "");
     }
     if (preg_match("/V/", $this->gosaMailDeliveryMode)) {
       $smarty->assign("use_vacation", "checked");
+    } else {
+      $smarty->assign("use_vacation", "");
     }
     if (preg_match("/S/", $this->gosaMailDeliveryMode)) {
       $smarty->assign("use_spam_filter", "checked");
+    } else {
+      $smarty->assign("use_spam_filter", "");
     }
     if (preg_match("/R/", $this->gosaMailDeliveryMode)) {
       $smarty->assign("use_mailsize_limit", "checked");
+    } else {
+      $smarty->assign("use_mailsize_limit", "");
     }
     if (preg_match("/I/", $this->gosaMailDeliveryMode)) {
       $smarty->assign("only_local", "checked");
+    } else {
+      $smarty->assign("only_local", "");
     }
     if (preg_match("/C/", $this->gosaMailDeliveryMode)) {
       $smarty->assign("own_script", "checked");
+    } else {
+      $smarty->assign("own_script", "");
     }
 
     /* Have vacation templates? */
+    $smarty->assign("template", "");
     if (count($this->vacation)){
       $smarty->assign("show_templates", "true");
       $smarty->assign("vacationtemplates", $this->vacation);
       if (isset($_POST['vacation_template'])){
         $smarty->assign("template", $_POST['vacation_template']);
       }
+    } else {
+      $smarty->assign("show_templates", "false");
     }
 
     /* Fill spam selector */
index 47b7b36ada1c2b0c9ab95955e8279d7b165c0083..12a460d8698f119a50db1798f67155dce3bd82f0 100644 (file)
@@ -438,8 +438,10 @@ class posixAccount extends plugin
             "use_shadowWarning") as $val){
         if ($this->$val == 1){
           $smarty->assign("$val", "checked");
-          $smarty->assign("$val"."ACL", chkacl($this->acl, $val));
+        } else {
+          $smarty->assign("$val", "");
         }
+        $smarty->assign("$val"."ACL", chkacl($this->acl, $val));
       }
     }
 
@@ -471,6 +473,8 @@ class posixAccount extends plugin
     $smarty->assign("groupMembership", $this->groupMembership);
     if (count($this->groupMembership) > 16){
       $smarty->assign("groups", "too_many_for_nfs");
+    } else {
+      $smarty->assign("groups", "");
     }
     $smarty->assign("printerList", $this->printerList);
     $smarty->assign("languages", $this->config->data['MAIN']['LANGUAGES']);
@@ -482,6 +486,7 @@ class posixAccount extends plugin
       if ($_SESSION["js"]){
         $smarty->assign("forceMode", "disabled");
       }
+      $smarty->assign("force_ids", "");
     }
     $smarty->assign("force_idsACL", chkacl($this->acl, "force_ids"));
 
@@ -491,7 +496,7 @@ class posixAccount extends plugin
       $smarty->assign("$val"."ACL", chkacl($this->acl,$val));
     }
     $smarty->assign("groupMembershipACL", chkacl($this->acl, "groupMembership"));
-    $smarty->assign("must_change_password", chkacl($this->acl, "must_change_password"));
+    $smarty->assign("status", $this->status);
 
     /* Work on trust modes */
     $smarty->assign("trustmodeACL", chkacl($this->acl, "trustmode"));
index ce752adc5ed47c3bbd969c32f1479a5f7eac1982..7c39ce448a6a4c48f29c20ac1c6b5f1f5c438fd7 100644 (file)
@@ -431,6 +431,8 @@ class sambaAccount extends plugin
               $smarty->assign("$attr", "");
             }
           }
+        } else {
+          $smarty->assign("$attr", "");
         }
         $smarty->assign("$attr"."ACL", chkacl($this->acl, $attr));
       }
@@ -501,28 +503,42 @@ class sambaAccount extends plugin
     if (is_integer(strpos($this->sambaAcctFlags, "D")) ||
         is_integer(strpos($this->sambaAcctFlags, "L"))) {
         $smarty->assign("flagsD", "checked");
+    } else {
+        $smarty->assign("flagsD", "");
     }
     
     /* Check for no_password_required flag 'N' */
     if (is_integer(strpos($this->sambaAcctFlags, "N"))) {
         $smarty->assign("flagsN", "checked");
+    } else {
+        $smarty->assign("flagsN", "");
     }
 
     /* 'normal' Checkboxes */
     if ($this->pwdCanChange=="1"){
       $smarty->assign("flagsP", "checked");
+    } else {
+      $smarty->assign("flagsP", "");
     }
     if ($this->password_expires=="1"){
       $smarty->assign("flagsC", "checked");
+    } else {
+      $smarty->assign("flagsC", "");
     }
     if ($this->logon_time_set=="1"){
       $smarty->assign("flagsT", "checked");
+    } else {
+      $smarty->assign("flagsT", "");
     }
     if ($this->logoff_time_set=="1"){
       $smarty->assign("flagsO", "checked");
+    } else {
+      $smarty->assign("flagsO", "");
     }
     if ($this->kickoff_time_set=="1"){
       $smarty->assign("flagsK", "checked");
+    } else {
+      $smarty->assign("flagsK", "");
     }
     
     $smarty->assign("allow_pwchangeACL", chkacl($this->acl, "allow_pwchange"));