summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8716a41)
raw | patch | inline | side by side (parent: 8716a41)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Aug 2006 04:10:53 +0000 (04:10 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Aug 2006 04:10:53 +0000 (04:10 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4471 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_printGeneric.inc | patch | blob | history | |
plugins/personal/environment/class_environment.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index ea4f24dc973798800917a3e0f062014069f9bd1f..803ea881eee9dc08180f6c7327a1a60c5c332b60 100644 (file)
/* Check if there was a printer "dn" given, or the "cn" */
foreach($this->member[$type] as $key => $printer){
if($printer['dn'] == $id) {
- $id = key;
+ $id = $key;
}
}
diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc
index 697f5f85b5a101c22cdbbeb3d7c120c33c657cb4..c86f52d00c80f2884b202355ff7b5f554dea0190 100644 (file)
var $objectclasses = array("gotoEnvironment"); // Specifies the objectClass which contains the attributes edited here
var $cn;
var $OrigCn;
+ var $add_del_printer_member_was_called = false;
function environment ($config, $dn= NULL)
{
if($printerObj->by_object['printgeneric']->AddMember("AddUser",$this->dn)){
$this->gotoPrinter[$pname]=$tmp2[$pname];
$this->gotoPrinter[$pname]['mode']="user";
+ $this->add_del_printer_member_was_called = true;
}
}
$printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$this->gotoPrinter[$pname]['dn']);
if($printerObj->by_object['printgeneric']->DelMember("AddUser",$this->dn)){
unset($this->gotoPrinter[$pname]);
+ $this->add_del_printer_member_was_called = true;
}
}
}
* 2.1 There are different types of members: Users / Groups, this will be defined in $suffix
* 2.2 And each type has two modes, Admin (e.g. 'gotoUserAdminPrinter') and Normal
*/
- $types = array( "gotoUserPrinter" => "AddUser",
- "gotoGroupPrinter" => "AddGroup",
- "gotoUserAdminPrinter" => "AddAdminUser",
- "gotoGroupAdminPrinter" => "AddAdminGroup");
-
- if($this->is_group){
- $s_suffix = "Group";
- $useVar = "cn";
- }else{
- $useVar = "uid";
- $s_suffix = "User";
- }
+
+ if($this->add_del_printer_member_was_called){
- /* Remove old entries */
- $ldap->search("(&(objectClass=gotoPrinter)(goto".$s_suffix."Printer=".$this->uid."))",array("*"));
- while($attr = $ldap->fetch()){
- $printerObj = NULL;
- $printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$attr['dn']);
- $printerObj->by_object['printgeneric']->DelMember($types["goto".$s_suffix."Printer"],$this->uid);
- $printerObj->by_object['printgeneric']->save();
- }
+ $types = array( "gotoUserPrinter" => "AddUser",
+ "gotoGroupPrinter" => "AddGroup",
+ "gotoUserAdminPrinter" => "AddAdminUser",
+ "gotoGroupAdminPrinter" => "AddAdminGroup");
- $ldap->search("(&(objectClass=gotoPrinter)(goto".$s_suffix."AdminPrinter=".$this->uid."))",array("*"));
- while($attr = $ldap->fetch()){
- $printerObj = NULL;
- $printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$attr['dn']);
- $printerObj->by_object['printgeneric']->DelMember($types["goto".$s_suffix."AdminPrinter"],$this->uid);
- $printerObj->by_object['printgeneric']->save();
- }
+ if($this->is_group){
+ $s_suffix = "Group";
+ $useVar = "cn";
+ }else{
+ $useVar = "uid";
+ $s_suffix = "User";
+ }
- foreach($this->gotoPrinter as $printer){
- $printerObj = NULL;
- $printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$printer['dn']);
+ /* Remove old entries */
+ $ldap->search("(&(objectClass=gotoPrinter)(goto".$s_suffix."Printer=".$this->uid."))",array("*"));
+ while($attr = $ldap->fetch()){
+ $printerObj = NULL;
+ $printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$attr['dn']);
+ $printerObj->by_object['printgeneric']->DelMember($types["goto".$s_suffix."Printer"],$this->uid);
+ $printerObj->by_object['printgeneric']->save();
+ }
- if($printer['mode'] == "admin") {
- $attribute = "goto".$s_suffix."AdminPrinter";
- }else{
- $attribute = "goto".$s_suffix."Printer";
+ $ldap->search("(&(objectClass=gotoPrinter)(goto".$s_suffix."AdminPrinter=".$this->uid."))",array("*"));
+ while($attr = $ldap->fetch()){
+ $printerObj = NULL;
+ $printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$attr['dn']);
+ $printerObj->by_object['printgeneric']->DelMember($types["goto".$s_suffix."AdminPrinter"],$this->uid);
+ $printerObj->by_object['printgeneric']->save();
}
- $printerObj->by_object['printgeneric']->AddMember($types[$attribute],$this->dn);
- $printerObj->by_object['printgeneric']->save();
- }
+ foreach($this->gotoPrinter as $printer){
+ $printerObj = NULL;
+ $printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$printer['dn']);
+
+ if($printer['mode'] == "admin") {
+ $attribute = "goto".$s_suffix."AdminPrinter";
+ }else{
+ $attribute = "goto".$s_suffix."Printer";
+ }
+
+ $printerObj->by_object['printgeneric']->AddMember($types[$attribute],$this->dn);
+ $printerObj->by_object['printgeneric']->save();
+ }
+ }
/* Prepare HotPlug devices */
$this->attrs['gotoHotplugDevice'] = array();