Code

Removed acls from main.inc, readded goFonDeliveryMode
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 9 Aug 2006 10:34:00 +0000 (10:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 9 Aug 2006 10:34:00 +0000 (10:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4440 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/phoneaccount/class_phoneAccount.inc
plugins/gofon/phoneaccount/main.inc

index dd5d5591d42403258e2249ce5f204dac019d155a..c20d7cf4d5d0bbc4758ebcc656b1843371822f23 100644 (file)
@@ -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")){ 
index 62675fd740cb740b160a28a986255c4ac137bf60..aed88aa7c94b87b7d86297a983ceaba8049d0fe8 100644 (file)
@@ -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= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png')."\"> ".$ui->dn."&nbsp;";
                } else {
                        $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png')."\"> ".$ui->dn."&nbsp;";
-                       if (isset($editacl) && $editacl != "#none#"){
+
+                       if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/phoneAccount"))){
                                $info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\">"._("Click the 'Edit' button below to change informations in this dialog");
                                $display.= "<input type=submit name=\"edit\" value=\""._("Edit")."\">\n";
                        }