index c670748a194b83e876ea78d51037e23700561ba1..d13bcf5d919b2d3e1c477dbccc692ea8736de9b5 100644 (file)
--- a/include/class_config.inc
+++ b/include/class_config.inc
/* Keep a copy of the current deparment list */
var $departments= array();
var $idepartments= array();
+ var $adepartments= array();
function config($filename, $basedir= "")
{
}
}
+
+ function get_departments($ignore_dn= "")
+ {
+ global $config;
+
+ /* Initialize result hash */
+ $result= array();
+ $administrative= array();
+ $result['/']= $this->current['BASE'];
+
+ /* Get list of department objects */
+ $ldap= $this->get_ldap_link();
+ $ldap->cd ($this->current['BASE']);
+ $ldap->search ("(objectClass=gosaDepartment)", array("ou", "objectClass", "gosaUnitTag"));
+ while ($attrs= $ldap->fetch()){
+ $dn= $ldap->getDN();
+
+ /* Save administrative departments */
+ if (in_array_ics("gosaAdministrativeUnit", $attrs['objectClass']) &&
+ isset($attrs['gosaUnitTag'][0])){
+ $administrative[$dn]= $attrs['gosaUnitTag'][0];
+ }
+
+ if ($dn == $ignore_dn){
+ continue;
+ }
+
+ /* Only assign non-root departments */
+ if ($dn != $result['/']){
+ $result[convert_department_dn($dn)]= $dn;
+ }
+ }
+
+ $this->adepartments= $administrative;
+ $this->departments= $result;
+ }
+
+
function make_idepartments($max_size= 28)
{
global $config;
if(isset($entry['goExportEntry']['count'])){
unset($entry['goExportEntry']['count']);
}
- foreach($entry['goExportEntry'] as $export){
- $shareAttrs = split("\|",$export);
- if($listboxEntry) {
- $return[$shareAttrs[0]."|".$entry['cn'][0]] = $shareAttrs[0]." - ".$entry['cn'][0];
- }else{
- $return[$shareAttrs[0]."|".$entry['cn'][0]]['server'] = $entry['cn'][0];
- $return[$shareAttrs[0]."|".$entry['cn'][0]]['name'] = $shareAttrs[0];
- $return[$shareAttrs[0]."|".$entry['cn'][0]]['description'] = $shareAttrs[1];
- $return[$shareAttrs[0]."|".$entry['cn'][0]]['type'] = $shareAttrs[2];
- $return[$shareAttrs[0]."|".$entry['cn'][0]]['charset'] = $shareAttrs[3];
- $return[$shareAttrs[0]."|".$entry['cn'][0]]['path'] = $shareAttrs[4];
- $return[$shareAttrs[0]."|".$entry['cn'][0]]['option'] = $shareAttrs[5];
+ if(isset($entry['goExportEntry'])){
+ foreach($entry['goExportEntry'] as $export){
+ $shareAttrs = split("\|",$export);
+ if($listboxEntry) {
+ $return[$shareAttrs[0]."|".$entry['cn'][0]] = $shareAttrs[0]." - ".$entry['cn'][0];
+ }else{
+ $return[$shareAttrs[0]."|".$entry['cn'][0]]['server'] = $entry['cn'][0];
+ $return[$shareAttrs[0]."|".$entry['cn'][0]]['name'] = $shareAttrs[0];
+ $return[$shareAttrs[0]."|".$entry['cn'][0]]['description'] = $shareAttrs[1];
+ $return[$shareAttrs[0]."|".$entry['cn'][0]]['type'] = $shareAttrs[2];
+ $return[$shareAttrs[0]."|".$entry['cn'][0]]['charset'] = $shareAttrs[3];
+ $return[$shareAttrs[0]."|".$entry['cn'][0]]['path'] = $shareAttrs[4];
+ $return[$shareAttrs[0]."|".$entry['cn'][0]]['option'] = $shareAttrs[5];
+ }
}
}
}
function getShareServerList()
{
$ldap= $this->get_ldap_link();
- $a_res = $ldap->search("(objectClass=goShareServer)",array("goExportEntry","cn"));
+ $a_res = $ldap->search("(&(objectClass=goShareServer)(goExportEntry=*))",array("goExportEntry","cn"));
$return= array();
while($entry = $ldap->fetch($a_res)){
if(isset($entry['goExportEntry']['count'])){