Code

Updated posix class
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Mar 2010 17:06:47 +0000 (17:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Mar 2010 17:06:47 +0000 (17:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16003 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/personal/posix/class_posixAccount.inc
gosa-core/plugins/personal/posix/generic.tpl

index 172ae85678277f9733d3635eebf2d42cd3de4677..ad28d1b9d34a38cab1007e828280a085a5ea685e 100644 (file)
@@ -253,14 +253,6 @@ class posixAccount extends plugin
     }
     asort ($this->secondaryGroups);
 
-    /* Get global filter config */
-    if (!session::is_set("sysfilter")){
-      $ui= get_userinfo();
-      $base= get_base_from_people($ui->dn);
-      $sysfilter= array( "depselect"       => $base,
-          "regex"           => "*");
-      session::set("sysfilter", $sysfilter);
-    }
     $this->ui = get_userinfo();
   }
 
@@ -278,11 +270,6 @@ class posixAccount extends plugin
       new log("view","users/".get_class($this),$this->dn);
     }
 
-    /* Department has changed? */
-    if(isset($_POST['depselect'])){
-      session::set('CurrentMainBase',validate($_POST['depselect']));
-    }
-
     if($this->multiple_support_active){
       $this->is_account = TRUE;
     }
@@ -431,28 +418,25 @@ class posixAccount extends plugin
     $smarty= get_smarty();
     $smarty->assign("usePrototype", "true");
 
-    /* In 'MyAccount' mode, we must remove write acls if we are not in editing mode. */ 
-    $SkipWrite = (!isset($this->parent) || !$this->parent) && !session::is_set('edit');
-
-    $smarty->assign("sshPublicKeyACL", $this->getacl("sshPublicKey", $SkipWrite));
+    $smarty->assign("sshPublicKeyACL", $this->getacl("sshPublicKey"));
 
     /* Depending on pwmode, currently hardcoded because there are no other methods */
     if ( 1 == 1 ){
       $smarty->assign("pwmode", dirname(__FILE__)."/posix_shadow");
 
-      $shadowMinACL     =  $this->getacl("shadowMin",$SkipWrite);
+      $shadowMinACL     =  $this->getacl("shadowMin");
       $smarty->assign("shadowmins", sprintf(_("Password can't be changed up to %s days after last change"), 
             "<input type='text' name=\"shadowMin\" size=3 maxlength=4 value=\"".$this->shadowMin."\">"));
 
-      $shadowMaxACL     =  $this->getacl("shadowMax",$SkipWrite);
+      $shadowMaxACL     =  $this->getacl("shadowMax");
       $smarty->assign("shadowmaxs", sprintf(_("Password must be changed after %s days"), 
             "<input type='text' name=\"shadowMax\" size=3 maxlength=4 value=\"".$this->shadowMax."\">"));
 
-      $shadowInactiveACL=  $this->getacl("shadowInactive",$SkipWrite);
+      $shadowInactiveACL=  $this->getacl("shadowInactive");
       $smarty->assign("shadowinactives", sprintf(_("Disable account after %s days of inactivity after password expiry"), 
             "<input type='text' name=\"shadowInactive\" size=3 maxlength=4 value=\"".$this->shadowInactive."\">"));
 
-      $shadowWarningACL =  $this->getacl("shadowWarning",$SkipWrite);
+      $shadowWarningACL =  $this->getacl("shadowWarning");
       $smarty->assign("shadowwarnings", sprintf(_("Warn user %s days before password expiry"), 
             "<input type='text' name=\"shadowWarning\" size=3 maxlength=4 value=\"".$this->shadowWarning."\">"));
 
@@ -463,10 +447,10 @@ class posixAccount extends plugin
         } else {
           $smarty->assign("$val", "");
         }
-        $smarty->assign("$val"."ACL", $this->getacl($val,$SkipWrite));
+        $smarty->assign("$val"."ACL", $this->getacl($val));
       }
 
-      $smarty->assign("mustchangepasswordACL", $this->getacl("mustchangepassword",$SkipWrite));
+      $smarty->assign("mustchangepasswordACL", $this->getacl("mustchangepassword"));
     }
 
     // Set last system login
@@ -511,14 +495,14 @@ class posixAccount extends plugin
     /* Create onClick="" action string for the "Force UID/GID" option 
      */
     $onClickIDS ="";
-    if(preg_match("/w/",$this->getacl("uidNumber",$SkipWrite))){
+    if(preg_match("/w/",$this->getacl("uidNumber"))){
       $onClickIDS .= "changeState('uidNumber');";
     }
-    if(preg_match("/w/",$this->getacl("gidNumber",$SkipWrite))){
+    if(preg_match("/w/",$this->getacl("gidNumber"))){
       $onClickIDS .= "changeState('gidNumber');";
     }
     $smarty->assign("onClickIDS", $onClickIDS);
-    $smarty->assign("force_idsACL", $this->getacl("uidNumber",$SkipWrite).$this->getacl("gidNumber",$SkipWrite));
+    $smarty->assign("force_idsACL", $this->getacl("uidNumber").$this->getacl("gidNumber"));
 
     foreach(array("primaryGroup","trustmode","activate_shadowWarning","activate_shadowInactive","activate_shadowMin","activate_shadowMax","activate_shadowExpire","mustchangepassword") as $val){
       if(in_array($val,$this->multi_boxes)){
@@ -539,14 +523,15 @@ class posixAccount extends plugin
 
       if((session::get("js"))&&(($val=="uidNumber")||($val=="gidNumber")))
       {
-        $smarty->assign("$val"."ACL",$this->getacl($val,$SkipWrite));
+        $smarty->assign("$val"."ACL",$this->getacl($val));
         $smarty->assign("$val", $this->$val);
         continue;
       }
       $smarty->assign("$val", $this->$val);
-      $smarty->assign("$val"."ACL", $this->getacl($val,$SkipWrite));
+      $smarty->assign("$val"."ACL", $this->getacl($val));
     }
-    if($SkipWrite){
+
+    if($this->read_only){
       $smarty->assign("groupMembershipACL","r");
     }else{
       $smarty->assign("groupMembershipACL","rw");
@@ -555,18 +540,18 @@ class posixAccount extends plugin
 
     /* Work on trust modes */
     $smarty->assign("trusthide", " disabled ");
-    $smarty->assign("trustmodeACL",  $this->getacl("trustModel",$SkipWrite));
+    $smarty->assign("trustmodeACL",  $this->getacl("trustModel"));
     if ($this->trustModel == "fullaccess"){
       $trustmode= 1;
       // pervent double disable tag in html code, this will disturb our clean w3c html
-      $smarty->assign("trustmode",  $this->getacl("trustModel",$SkipWrite));
+      $smarty->assign("trustmode",  $this->getacl("trustModel"));
 
     } elseif ($this->trustModel == "byhost"){
       $trustmode= 2;
       $smarty->assign("trusthide", "");
     } else {
       // pervent double disable tag in html code, this will disturb our clean w3c html
-      $smarty->assign("trustmode",  $this->getacl("trustModel",$SkipWrite));
+      $smarty->assign("trustmode",  $this->getacl("trustModel"));
       $trustmode= 0;
     }
     $smarty->assign("trustmode", $trustmode);
index b1ac572d738561e5bcc91f56ebf2adbfb27dee51..b5bd2b9e53696b974e699e77696f368ed6f916e8 100644 (file)
@@ -1,7 +1,7 @@
 <table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
  <tr>
   <td style="width:50%; vertical-align:top;">
-   <h3>{image path="images/rightarrow.png"} {t}Generic{/t}
+   <h3>{t}Generic{/t}
    </h3>
    <table summary="">
     <tr>
@@ -87,7 +87,7 @@
    &nbsp;
   </td>
   <td style="vertical-align:top;">
-   <h3>{image path="plugins/posix/images/members.png"} {t}Group membership{/t}
+   <h3>{t}Group membership{/t}
    </h3>
    {if $groups eq "too_many_for_nfs"}
    <b style="color:red">{t}(Warning: more than 16 groups are not supported by NFS!){/t}</b>
   <td style='width:50%;vertical-align:top'>
    {if $sshPublicKey == 1}
    {render acl=$sshPublicKeyACL}
-   <h3>{image path="images/lists/key.png"} {t}SSH keys{/t}
+   <h3>{t}SSH keys{/t}
    </h3>
    <button type='submit' name='edit_sshpublickey'>{t}Edit public ssh keys...{/t}</button>
    
    <div style='border-bottom:1px solid #A0A0A0;height:8px'></div>
    {/render}
    {/if}
-   <h3>{image path="plugins/posix/images/terminal_small.png"} {t}Account{/t}
+   <h3>{t}Account{/t}
    </h3>
    {include file="$pwmode.tpl"}
   </td>
    &nbsp;
   </td>
   <td style="vertical-align:top;">
-   <h3>{image path="images/lists/locked.png"} {t}System trust{/t}
+   <h3>{t}System trust{/t}
    </h3>
    {if !$multiple_support}
    {t}Trust mode{/t}&nbsp;