From 443b270aa3ac63aa325bff83247959df18d572e4 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 9 Aug 2006 10:34:00 +0000 Subject: [PATCH] Removed acls from main.inc, readded goFonDeliveryMode git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4440 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../gofon/phoneaccount/class_phoneAccount.inc | 14 ++++++++++++++ plugins/gofon/phoneaccount/main.inc | 16 ++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index dd5d5591d..c20d7cf4d 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -855,6 +855,20 @@ class phoneAccount extends plugin $nummsinorder=array(""); } + + /* Save checkbox */ + $tmp = preg_replace("/[^a-z]/i","",$this->goFonDeliveryMode); + if($this->acl_is_writeable("goFonDeliveryMode")){ + if(isset($_POST['fon_to_mail']) && !preg_match("/M/",$this->goFonDeliveryMode)){ + $tmp .= "M"; + }elseif(!isset($_POST['fon_to_mail']) && preg_match("/M/",$this->goFonDeliveryMode)){ + $tmp = preg_replace ("/M/","",$tmp); + } + } + $this->goFonDeliveryMode= "[".$tmp."]"; + + + /* get all Postvars */ if(isset($this->macroarray[$this->macro])){ if($this->acl_is_writeable("goFonMarco")){ diff --git a/plugins/gofon/phoneaccount/main.inc b/plugins/gofon/phoneaccount/main.inc index 62675fd74..aed88aa7c 100644 --- a/plugins/gofon/phoneaccount/main.inc +++ b/plugins/gofon/phoneaccount/main.inc @@ -31,6 +31,8 @@ if (!$remove_lock){ /* Create phoneAccount object on demand */ if (!isset($_SESSION['phoneAccount']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ $_SESSION['phoneAccount']= new phoneAccount ($config, $ui->dn); + $_SESSION['phoneAccount']->set_acl_base($ui->dn); + $_SESSION['phoneAccount']->set_acl_category("users"); } $phoneAccount= $_SESSION['phoneAccount']; @@ -55,16 +57,6 @@ if (!$remove_lock){ $_SESSION['edit']= TRUE; } - /* Adjust acl's to mode */ - if (isset($_SESSION['edit'])){ - $acl= get_permissions ($ui->dn, $ui->subtreeACL); - $phoneAccount->acl= get_module_permission($acl, "phoneAccount", $ui->dn); - } else { - $acl= get_permissions ($ui->dn, $ui->subtreeACL); - $editacl= get_module_permission($acl, "phoneAccount", $ui->dn); - $phoneAccount->acl="#none#"; - } - /* save changes to LDAP and disable edit mode */ if (isset($_POST['edit_finish'])){ @@ -75,7 +67,6 @@ if (!$remove_lock){ if (count ($message) == 0){ $phoneAccount->save (); - $phoneAccount->acl="#none#"; gosa_log ("User/phone object'".$ui->dn."' has been saved"); del_lock ($ui->dn); sess_del ('edit'); @@ -108,7 +99,8 @@ if (!$remove_lock){ $info= "\"\" ".$ui->dn." "; } else { $info= "\"\" ".$ui->dn." "; - if (isset($editacl) && $editacl != "#none#"){ + + if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/phoneAccount"))){ $info.= "\"\""._("Click the 'Edit' button below to change informations in this dialog"); $display.= "\n"; } -- 2.30.2