From: hickert Date: Thu, 11 Jan 2007 06:46:00 +0000 (+0000) Subject: Fixed account toggle for mail/samba/posix/environment. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=349fac7c66e211e7c9aa4ca2aa270ec209068a5b;p=gosa.git Fixed account toggle for mail/samba/posix/environment. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5525 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index a163a7e4a..accb3d7e8 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -293,7 +293,11 @@ class environment extends plugin /* Change state if needed */ if (isset($_POST['modify_state'])){ - $this->is_account= !$this->is_account; + if($this->is_account && $this->acl == "#all#"){ + $this->is_account= !$this->is_account; + }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){ + $this->is_account= !$this->is_account; + } } /* Group Dialog with enabled environment options */ @@ -327,13 +331,17 @@ class environment extends plugin /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ - - /* Onyl change state if we have posixs enabled or we want to remove this account */ - if(!(!$this->parent->by_object['posixAccount']->is_account && !$this->is_account)){ + + /* Onyl change account state if allowed */ + if(!$this->parent->by_object['posixAccount']->is_account && !$this->is_account){ + }elseif($this->is_account && $this->acl == "#all#"){ + $this->is_account= !$this->is_account; + }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){ $this->is_account= !$this->is_account; } } + if(isset($this->parent)){ // 3. Account enabled . Editing from adminmenu diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index a0bc50807..0bf0c134a 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -242,7 +242,13 @@ class mailAccount extends plugin /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ - $this->is_account= !$this->is_account; + + /* Onyl change account state if allowed */ + if($this->is_account && $this->acl == "#all#" && !$this->accountDelegationsConfigured()){ + $this->is_account= !$this->is_account; + }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){ + $this->is_account= !$this->is_account; + } } /* Do we represent a valid account? */ @@ -625,6 +631,11 @@ class mailAccount extends plugin } } } + if(isset($this->parent->by_object['connectivity']->plugin['kolabAccount'])){ + if($this->parent->by_object['connectivity']->plugin['kolabAccount']->is_account){ + return(true); + } + } return(false); } diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index ba2fdeb1e..3f06a241e 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -233,9 +233,13 @@ class posixAccount extends plugin } if(!$isCopyPaste){ + + $required = (isset($this->parent->by_object['sambaAccount']) && $this->parent->by_object['sambaAccount']->is_account) || + (isset($this->parent->by_object['environment'] ) && $this->parent->by_object['environment'] ->is_account); + /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ - if($this->is_account && $this->acl == "#all#"){ + if($this->is_account && $this->acl == "#all#" && !$required ){ $this->is_account= !$this->is_account; }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){ $this->is_account= !$this->is_account; diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc index 690ece7f5..96513ee1b 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -193,13 +193,21 @@ class sambaAccount extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); + /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ - $this->is_account= !$this->is_account; + + /* Only change account state if allowed */ + if($this->is_account && $this->acl == "#all#"){ + $this->is_account= !$this->is_account; + }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){ + $this->is_account= !$this->is_account; + } } + /* Do we represent a valid account? */ if (!$this->is_account && $this->parent == NULL){ $display= "\"\"src=\"images/stop.png\" ".