function BuildOus() { $ldap = new clladp(); $mny = new usersMenus(); if ($mny->IsGlobalAdmin()) { $hash = $ldap->hash_get_ou_full_datas(); } else { $hash = $ldap->Hash_Get_ou_from_users($_SESSION["uid"]); } if (is_array($hash)) { while (list($num, $ligne) = each($hash)) { $items = $items . "{\n"; $items = $items . "\t\t'id' : 'ou:{$ligne}',\n"; $items = $items . "\t\t'txt' : '{$num}',\n"; $items = $items . "\t\t'img' : 'tree-server.gif',\n"; $items = $items . "\t\t'onopenpopulate' : myOpenPopulate,\n"; $items = $items . "\t\t'openlink' : 'ldapTree.php',\n"; $items = $items . "\t\t'canhavechildren' : true\n"; $items = $items . "\t\t},"; } } if ($items[strlen($items) - 1] == ',') { $items = substr($items, 0, strlen($items) - 1); } return $items . ""; }