summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 04e6ae6)
raw | patch | inline | side by side (parent: 04e6ae6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Sep 2006 08:58:02 +0000 (08:58 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Sep 2006 08:58:02 +0000 (08:58 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4809 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_printGeneric.inc | patch | blob | history | |
plugins/admin/systems/class_selectUserToPrinterDialog.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 72d099ca0d3513e42e7174071e3d86494b8a9d8c..d35b85ef818695eae249bccb7b03430ec4374607 100644 (file)
/* Base select dialog */
$once = true;
foreach($_POST as $name => $value){
- if(preg_match("/^chooseBase/",$name) && $once){
+ if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_moveable()){
$once = false;
$this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
$this->dialog->setCurrentBase($this->base);
function generateList(){
$a_return=array();
+
foreach($this->member as $type => $values){
$a_return[$type]=array();
foreach($values as $value){
$ldap = $this->config->get_ldap_link();
$ldap->cd($dn);
- $ldap->cat($dn,array($var));
+ $ldap->cat($dn,array($var,"cn"));
if($ldap->count()){
$attrs = $ldap->fetch();
diff --git a/plugins/admin/systems/class_selectUserToPrinterDialog.inc b/plugins/admin/systems/class_selectUserToPrinterDialog.inc
index 91d1ca4597e64730796d8a8d6fc2fc7ee4a1583c..9cb403b5d74d45e33438606faedf65458b460c5d 100644 (file)
var $searchAppend = "";
var $baseAddition = "";
var $type = "";
-
+ var $search_cat = "";
+
function selectUserToPrinterDialog ($config, $dn= NULL,$type=false )
{
plugin::plugin ($config, $dn);
$this->searchAttrs = array("cn","uid");
$this->searchAppend = "uid";
$this->baseAddition = get_people_ou();
+ $this->search_cat = "users";
;break;
case "AddGroup" :
$this->searchObjects = "(objectClass=posixGroup)";
$this->searchAttrs = array("cn","description");
$this->searchAppend = "cn";
$this->baseAddition = get_groups_ou();
+ $this->search_cat = "groups";
;break;
case "AddAdminUser" :
$this->searchObjects = "(objectClass=gosaAccount)(!(uid=*$))";
$this->searchAttrs = array("cn","uid");
$this->searchAppend = "uid";
$this->baseAddition = get_people_ou();
+ $this->search_cat = "users";
;break;
case "AddAdminGroup" :
$this->searchObjects = "(objectClass=posixGroup)";
$this->searchAttrs = array("cn","description");
$this->searchAppend = "cn";
$this->baseAddition = get_groups_ou();
+ $this->search_cat = "groups";
;break;
}
$this->type = $type;
function getPrinter($detailed = false)
{
$a_return=array();
- $ldap = $this->config->get_ldap_link();
- $ldap->cd($this->depselect);
- #$ldap->search("(&".$this->searchObjects."(cn=".$this->regex."))", $this->depselect, $this->searchAttrs);
- $ldap->ls("(&".$this->searchObjects."(cn=".$this->regex."))", $this->baseAddition.$this->depselect, $this->searchAttrs);
- while($printer = $ldap->fetch()){
+
+ $filter = "(&".$this->searchObjects."(cn=".$this->regex."))";
+ $base = $this->baseAddition.$this->depselect;
+ $attrs = $this->searchAttrs;
+ $cat = $this->search_cat;
+
+ $res = get_list($filter,$cat,$base,$attrs);
+ foreach($res as $printer){
if(($detailed ==true)){
if(isset($printer[$this->searchAppend])){
$a_return[$printer[$this->searchAppend][0]] = $printer;