From 42444726b9a5e7e5cc9f2b807de6626ba48ab5ca Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 2 Nov 2006 09:06:49 +0000 Subject: [PATCH] Fixed acls && white page for mail tab git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4993 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/mail/class_mailAccount.inc | 1 - plugins/personal/mail/main.inc | 33 ++++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index fd2d0ceee..3ec98eea5 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -448,7 +448,6 @@ class mailAccount extends plugin $filter.= "(!(|$exclude))"; } - $acl= array($this->config->current['BASE'] => ":all"); $res= get_list("(&(objectClass=gosaMailAccount)$filter)", "users", $mailfilter['depselect'], array("sn", "mail", "givenName"), GL_SIZELIMIT | GL_SUBSEARCH); $ldap->cd($mailfilter['depselect']); diff --git a/plugins/personal/mail/main.inc b/plugins/personal/mail/main.inc index f09d858ab..d88189b90 100644 --- a/plugins/personal/mail/main.inc +++ b/plugins/personal/mail/main.inc @@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +$lock_msg =""; +$display =""; if (!$remove_lock){ /* Reset requested? */ if (isset($_POST['edit_cancel']) || @@ -41,19 +43,21 @@ if (!$remove_lock){ } /* Enter edit mode? */ - if (isset($_POST['edit'])){ + if (isset($_POST['edit']) && preg_match("/w/",$ui->get_permissions($ui->dn,"users/mailAccount"))){ /* Check locking */ if (($username= get_lock($ui->dn)) != ""){ $_SESSION['back_plugin']= $plug; - gen_locked_message ($username, $ui->dn); - exit (); - } + $_SESSION['LOCK_VARS_TO_USE'] = array("/^edit$/","/^plug$/"); + $lock_msg = gen_locked_message ($username, $ui->dn); + + }else{ - /* Lock the current entry */ - add_lock ($ui->dn, $ui->dn); - $_SESSION['dn']= $ui->dn; - $_SESSION['edit']= TRUE; + /* Lock the current entry */ + add_lock ($ui->dn, $ui->dn); + $_SESSION['dn']= $ui->dn; + $_SESSION['edit']= TRUE; + } } /* save changes to LDAP and disable edit mode */ @@ -78,7 +82,11 @@ if (!$remove_lock){ } /* Execute formular */ - $display= $mailAccount->execute (); + if($lock_msg){ + $display.= $lock_msg; + }else{ + $display.= $mailAccount->execute (); + } /* Store changes in session */ if (isset ($_SESSION['edit'])){ @@ -87,7 +95,7 @@ if (!$remove_lock){ $info= ""; /* Show page footer depending on the mode */ - if (!$mailAccount->forward_dialog && $mailAccount->is_account){ + if (!$mailAccount->forward_dialog && $mailAccount->is_account && empty($lock_msg)){ $display.= "

"; /* Are we in edit mode? */ @@ -103,7 +111,10 @@ if (!$remove_lock){ $info.= "\"\" "._("Click the 'Edit' button below to change informations in this dialog"); - $display.= "\n"; + + if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/mailAccount"))){ + $display.= "\n"; + } $display.= "\n"; } -- 2.30.2