From bea2a304f9badbbe5db2853f60ad95b72256f789 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 3 Mar 2010 17:06:47 +0000 Subject: [PATCH] Updated posix class git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16003 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/posix/class_posixAccount.inc | 49 +++++++------------ gosa-core/plugins/personal/posix/generic.tpl | 10 ++-- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index 172ae8567..ad28d1b9d 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -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"), "shadowMin."\">")); - $shadowMaxACL = $this->getacl("shadowMax",$SkipWrite); + $shadowMaxACL = $this->getacl("shadowMax"); $smarty->assign("shadowmaxs", sprintf(_("Password must be changed after %s days"), "shadowMax."\">")); - $shadowInactiveACL= $this->getacl("shadowInactive",$SkipWrite); + $shadowInactiveACL= $this->getacl("shadowInactive"); $smarty->assign("shadowinactives", sprintf(_("Disable account after %s days of inactivity after password expiry"), "shadowInactive."\">")); - $shadowWarningACL = $this->getacl("shadowWarning",$SkipWrite); + $shadowWarningACL = $this->getacl("shadowWarning"); $smarty->assign("shadowwarnings", sprintf(_("Warn user %s days before password expiry"), "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); diff --git a/gosa-core/plugins/personal/posix/generic.tpl b/gosa-core/plugins/personal/posix/generic.tpl index b1ac572d7..b5bd2b9e5 100644 --- a/gosa-core/plugins/personal/posix/generic.tpl +++ b/gosa-core/plugins/personal/posix/generic.tpl @@ -1,7 +1,7 @@
-

{image path="images/rightarrow.png"} {t}Generic{/t} +

{t}Generic{/t}

@@ -87,7 +87,7 @@   @@ -143,7 +143,7 @@  
-

{image path="plugins/posix/images/members.png"} {t}Group membership{/t} +

{t}Group membership{/t}

{if $groups eq "too_many_for_nfs"} {t}(Warning: more than 16 groups are not supported by NFS!){/t} @@ -128,14 +128,14 @@
{if $sshPublicKey == 1} {render acl=$sshPublicKeyACL} -

{image path="images/lists/key.png"} {t}SSH keys{/t} +

{t}SSH keys{/t}

{/render} {/if} -

{image path="plugins/posix/images/terminal_small.png"} {t}Account{/t} +

{t}Account{/t}

{include file="$pwmode.tpl"}
-

{image path="images/lists/locked.png"} {t}System trust{/t} +

{t}System trust{/t}

{if !$multiple_support} {t}Trust mode{/t}  -- 2.30.2