// Author: Jon Belanger // Date: Nov. 2004 // comments: linked to in index.php // start the session session_start(); include("functions.php"); include("gui.php"); // check if the session username or seclevel are not set // this would occur if the user was trying to get here without logging in if (! $_SESSION['username'] || ! $_SESSION['seclevel']) { redirect("logout.php"); } // only admins can manage the id pool if ($_SESSION['seclevel']!="admin") { redirect("logout.php"); } // send HTML meta and ui headers to the browser display_meta("Manage ID Pool"); display_header("Manage ID Pool"); $idpooldn=get_idpool_dn($dir."/prefs.conf");; // connect to ldap server $ds=connect_to_ldap($_SESSION['server'], $_SESSION['port'], $_SESSION['ssl'], 3); // bind as manager DN if ($ds) { $br=ldap_bind($ds,$_SESSION['managerdn'], $_SESSION['managerpass']); } // create array of attributes to get from the server $stufftoget=array('uidNumber','gidNumber'); //echo $idpooldn[0]; // get the attribute values from the server $sr=ldap_list($ds,$idpooldn[1],"(&(".$idpooldn[0].")(objectClass=sambaUnixIdPool))",$stufftoget); $info=ldap_first_entry($ds,$sr); if ($info) { $attrs=ldap_get_attributes($ds,$info); // get the current next uid and gid from the server $currentuid=$attrs['uidNumber'][0]; $currentgid=$attrs['gidNumber'][0]; } ?>
if ($_SESSION['seclevel']=="user") { echo "Editing ".$_GET['uid']; } else {?> Main - Manage ID Pool } ?> |
if ($_GET["error"]) { echo "** ".$_GET["error"]; } else { echo " "; } ?> |