class query_manager { function get_action() { global $ldap_action; if (isset ($ldap_action)) { $ldap_action = urldecode ($ldap_action); } else { $ldap_action = "read"; } return $ldap_action; } function get_base_dn() { global $base_dn; if (isset ($base_dn)) { $base_dn = urldecode ($base_dn); } else { $base_dn = "o=University of Michigan, c=US"; // $base_dn = "o=Balorda and Balorda, c=UK"; } return $base_dn; } function get_host() { global $host; if (isset ($host)) { $host = urldecode($host); } else { $host = "localhost"; } return $host; } function get_search_filter() { global $objectclass, $attrib, $precision, $search_string; // global $search_filter; // if (isset ($search_filter)) { // $search_filter = urldecode($search_filter); // } // else { $search_filter = "(objectclass="; switch(urldecode($objectclass)) { case "People": $search_filter .= "person)";break; case "Groups": $search_filter .= "organizationalUnit)"; break; case "Joinable Groups": $search_filter .= "joinableGroup)"; break; case "Organisations": $search_filter .= "organization)"; break; default: $search_filter .= "*)"; break; } switch(urldecode($attrib)) { case "Common Name": $search_filter .= "(cn"; break; case "Surname": $search_filter .= "(sn"; break; case "Business Phone": $search_filter .= "(telephone"; break; case "E-mail Address": $search_filter .= "(mail"; break; case "Title": $search_filter .= "(title"; break; case "Distinguished Name": $search_filter .="(dn"; break; case "Location": $search_filter .="(l"; break; default: break; } switch(urldecode($precision)) { case "exactly matches": $search_filter .= "=".$search_string.")"; break; case "starts with": $search_filter .= "=".$search_string."*)"; break; case "ends with": $search_filter .= "=*".$search_string.")"; break; case "approximates": $search_filter .= "~=".$search_string.")"; break; case "contains": $search_filter .= "=*".$search_string."*)"; break; default: break; } $search_filter = "(&".$search_filter.")"; // echo $search_filter; // } return $search_filter; } cfunction get_mode() { global $mode; if (isset ($mode)) { $mode = urldecode($mode); } else { $mode = "tree"; } return $mode; } function display_form() { global $lm, $FILE; ?>
} cfunction makeForm($s) { global $FILE; echo "\n"; echo $parameter[0]; echo "\t\t | \n\t|
\n"; echo "\t\t\n"; echo "\t\t | \n\t\n"; echo "\t\t\n"; echo "\t\t | \n\t
LDAP Console | |
'; $things = array( 0 => array("Bind (authenticate) to the directory.", "bind", "who"), 1 => array("Change the search base.", "cb", "where"), 2 => array("Change information associated with an entry","change","entry"), 3 => array("Create a new group entry","create","group"), 4 => array("Edit a complete Directory entry","vedit","entry"), 5 => array("Find an entry in the directory.","find","entry") ); $this->makeForm($things); echo ' | '; $things = array( 0 => array("Change the group base.","groupbase","where"), 1 => array("Display detailed help for a function","help","command"), 2 => array("Subscribe to a group.","join","group"), 3 => array("List the groups owned by someone","list","who"), 4 => array("List out the groups in which someone is a member.", "memberships", "who"), 5 => array("Remove obsolete entries from a group.", "purge", "group") ); $this->makeForm($things); echo ' |