From: hickert Date: Wed, 27 Jan 2010 10:47:16 +0000 (+0000) Subject: Updated member selection for printer X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8cdd7e1b48cf52cfc80db8159ab5dc0c95a30e47;p=gosa.git Updated member selection for printer git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15362 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc index e296759f6..f584a0069 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc @@ -49,6 +49,11 @@ class printgeneric extends plugin var $view_logged = FALSE; var $parent; + + // Memeber dialog object + var $userSelect; + var $adminUserSelect; + function printgeneric (&$config, $dn,$parent_init,$parent) { $this->config = &$config; @@ -530,24 +535,40 @@ class printgeneric extends plugin $users = array(); if($this->userSelect instanceOf userGroupSelect){ $users = $this->userSelect->save(); + $add = ''; }elseif($this->adminUserSelect instanceOf userGroupSelect){ $users = $this->adminUserSelect->save(); + $add = 'Admin'; } foreach($users as $user){ - print_a($user); -# foreach($data as $mem){ -# $this->AddMember($new['type'], $mem['dn']); -# } + if(in_array('gosaAccount', $user['objectClass'])){ + $type = 'Add'.$add.'User'; + }else{ + $type = 'Add'.$add.'Group'; + } + $this->AddMember($type, $user['dn']); } $this->dialog=FALSE; $this->userSelect = NULL; $this->adminUserSelect = NULL; } - if($this->userSelect instanceOf userGroupSelect){ - return($this->userSelect->execute()); - }elseif($this->adminUserSelect instanceOf userGroupSelect){ - return($this->adminUserSelect->execute()); + // Display add user/group dialogs + if($this->userSelect instanceOf userGroupSelect || $this->adminUserSelect instanceOf userGroupSelect){ + + // Build up blocklist + $used = array(); + foreach($this->member as $type => $members){ + foreach($members as $member){ + $used['dn'][] = $member['dn']; + } + } + session::set('filterBlacklist', $used); + if($this->userSelect instanceOf userGroupSelect){ + return($this->userSelect->execute()); + }elseif($this->adminUserSelect instanceOf userGroupSelect){ + return($this->adminUserSelect->execute()); + } } diff --git a/gosa-plugins/goto/admin/systems/goto/printer.tpl b/gosa-plugins/goto/admin/systems/goto/printer.tpl index 535d94835..4d63647c5 100644 --- a/gosa-plugins/goto/admin/systems/goto/printer.tpl +++ b/gosa-plugins/goto/admin/systems/goto/printer.tpl @@ -102,10 +102,7 @@
{/render} {render acl=$gotoUserPrinterACL} - -{/render} -{render acl=$gotoUserPrinterACL} - + {/render} {render acl=$gotoUserPrinterACL} @@ -126,10 +123,7 @@
{/render} {render acl=$gotoUserPrinterACL} - -{/render} -{render acl=$gotoUserPrinterACL} - + {/render} {render acl=$gotoUserPrinterACL}