From: hickert Date: Thu, 6 Dec 2007 14:56:44 +0000 (+0000) Subject: Added copy & paste for profiles X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=68a02e4d0a4fddbd60f1d84b12f099c352c2e4db;p=gosa.git Added copy & paste for profiles git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8048 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiProfile.inc b/plugins/admin/fai/class_faiProfile.inc index 0e5cacffd..4b5daea9b 100644 --- a/plugins/admin/fai/class_faiProfile.inc +++ b/plugins/admin/fai/class_faiProfile.inc @@ -404,11 +404,18 @@ class faiProfile extends plugin } $ldap = $this->config->get_ldap_link(); - $ldap->cd($_SESSION['CurrentMainBase']); + + $base = $_SESSION['faifilter']['branch']; + if($base == "main"){ + $base =$_SESSION['CurrentMainBase']; + } + $base = "ou=profiles,".$base; + + $ldap->cd($base); if ($this->old_cn == ""){ - $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn."))",array("*")); + $ldap->ls("(&(objectClass=FAIprofile)(cn=".$this->cn."))",$base,array("*")); } else { - $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",array("*")); + $ldap->ls("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",$base,array("*")); } if($ldap->count() || isset($this->FAIAllclasses[$this->cn])){ @@ -449,6 +456,28 @@ class faiProfile extends plugin } + function PrepareForCopyPaste($source) + { + plugin::PrepareForCopyPaste($source); + + /* Parse ldap attribute to get all assigned classes */ + $tmp = split(" ",$this->FAIclass); + $tmp2 = array(); + foreach($tmp as $class){ + if(!empty($class)){ + $tmp2[trim($class)] = trim($class); + } + } + + /* Sort assigned classes */ + if(is_array($tmp2)){ + foreach($tmp2 as $class){ + $this->FAIclasses[$class]=$class; + } + } + } + + /* Return plugin informations for acl handling */ static function plInfo() {