Code

Fixed some environment user problems.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Sep 2006 07:02:06 +0000 (07:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Sep 2006 07:02:06 +0000 (07:02 +0000)
- toggle admin state wasn't saved correctly.
- User names wasn't added as expected

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4590 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc

index aa7a42562a4a523a13868c93065101b0963d9b35..0245be815d65e69af0561203b0ceb7ae86843664 100644 (file)
@@ -808,8 +808,8 @@ class environment extends plugin
         }else{
           if(isset($this->NewAddedPrinters[$pname])){
             $type = "User";
-          }elseif($printerObj->by_object['printgeneric']->DelMember("AddUser",$this->cn)){
-              $type = "User";
+          }elseif($printerObj->by_object['printgeneric']->DelMember("AddUser",$this->uid)){
+            $type = "User";
           }
         }
         if($type){
@@ -825,10 +825,8 @@ class environment extends plugin
     }
 
     if((isset($_POST['gotoPrinterEdit']))&&(isset($_POST['gotoPrinterSel']))&&(!empty($_POST['gotoPrinterSel']))){
-
-
       $printers = $_POST['gotoPrinterSel'];
-
+      $this->add_del_printer_member_was_called = true;
       foreach($printers as $printer){
         if($this->gotoPrinter[$printer]['mode']=="user"){
           $this->gotoPrinter[$printer]['mode']="admin";
@@ -1059,21 +1057,21 @@ class environment extends plugin
       }
 
       /* Remove old entries */
-      $ldap->search("(&(objectClass=gotoPrinter)(goto".$s_suffix."Printer=".$this->uid."))",array("*"));
+      $ldap->search("(&(objectClass=gotoPrinter)(goto".$s_suffix."Printer=".$this->$useVar."))",array("*"));
       while($attr = $ldap->fetch()){
         $printerObj = NULL;
         $printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$attr['dn'],"printer");
         $printerObj->set_acl_base($attr['dn']);
-        $printerObj->by_object['printgeneric']->DelMember($types["goto".$s_suffix."Printer"],$this->uid);
+        $printerObj->by_object['printgeneric']->DelMember($types["goto".$s_suffix."Printer"],$this->$useVar);
         $printerObj->by_object['printgeneric']->save();
       }
 
-      $ldap->search("(&(objectClass=gotoPrinter)(goto".$s_suffix."AdminPrinter=".$this->uid."))",array("*"));
+      $ldap->search("(&(objectClass=gotoPrinter)(goto".$s_suffix."AdminPrinter=".$this->$useVar."))",array("*"));
       while($attr = $ldap->fetch()){
         $printerObj = NULL;
         $printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$attr['dn'],"printer");
         $printerObj->set_acl_base($attr['dn']);
-        $printerObj->by_object['printgeneric']->DelMember($types["goto".$s_suffix."AdminPrinter"],$this->uid);
+        $printerObj->by_object['printgeneric']->DelMember($types["goto".$s_suffix."AdminPrinter"],$this->$useVar);
         $printerObj->by_object['printgeneric']->save();
       }