show only used suffixes
This commit is contained in:
parent
6fa703549e
commit
da610f4d5e
|
@ -320,12 +320,6 @@ exit;
|
||||||
else display_main();
|
else display_main();
|
||||||
|
|
||||||
function display_main() {
|
function display_main() {
|
||||||
// generate lists of possible suffixes
|
|
||||||
$usr_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_UserSuffix());
|
|
||||||
$grp_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_GroupSuffix());
|
|
||||||
$hst_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_HostSuffix());
|
|
||||||
$dom_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_DomainSuffix());
|
|
||||||
|
|
||||||
// display main page
|
// display main page
|
||||||
echo $_SESSION['header'];
|
echo $_SESSION['header'];
|
||||||
echo ("<title>OU-Editor</title>\n");
|
echo ("<title>OU-Editor</title>\n");
|
||||||
|
@ -336,136 +330,152 @@ function display_main() {
|
||||||
echo ("<form action=\"ou_edit.php?type=user\" method=\"post\">\n");
|
echo ("<form action=\"ou_edit.php?type=user\" method=\"post\">\n");
|
||||||
|
|
||||||
// user OUs
|
// user OUs
|
||||||
echo ("<fieldset><legend><b>" . _("Users") . "</b></legend>\n");
|
if ($_SESSION["config"]->get_UserSuffix() != "") {
|
||||||
echo ("<table border=0>\n");
|
// generate lists of possible suffixes
|
||||||
// new OU
|
$usr_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_UserSuffix());
|
||||||
echo ("<tr>\n");
|
echo ("<fieldset><legend><b>" . _("Users") . "</b></legend>\n");
|
||||||
echo ("<td><input type=radio name=\"type\" value=\"new_usr\" checked></td>\n");
|
echo ("<table border=0>\n");
|
||||||
echo ("<td><b>" . _("New organizational unit") . ":</b></td>\n");
|
// new OU
|
||||||
echo ("<td> </td>\n");
|
echo ("<tr>\n");
|
||||||
echo ("<td><select size=1 name=usersuff_n>");
|
echo ("<td><input type=radio name=\"type\" value=\"new_usr\" checked></td>\n");
|
||||||
for ($i = 0; $i < sizeof($usr_units); $i++) {
|
echo ("<td><b>" . _("New organizational unit") . ":</b></td>\n");
|
||||||
echo ("<option>" . $usr_units[$i] . "</option>\n");
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><select size=1 name=usersuff_n>");
|
||||||
|
for ($i = 0; $i < sizeof($usr_units); $i++) {
|
||||||
|
echo ("<option>" . $usr_units[$i] . "</option>\n");
|
||||||
|
}
|
||||||
|
echo ("</select><td>\n");
|
||||||
|
echo ("<td><input type=text name=newsuff_u></td>\n");
|
||||||
|
echo ("<td><a href=\"help.php?HelpNumber=601\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
||||||
|
echo ("</tr>\n");
|
||||||
|
// delete OU
|
||||||
|
echo ("<tr>\n");
|
||||||
|
echo ("<td><input type=radio name=\"type\" value=\"del_usr\"></td>\n");
|
||||||
|
echo ("<td><b>" . _("Delete organizational unit") . ":</b></td>\n");
|
||||||
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><select size=1 name=usersuff_d>");
|
||||||
|
for ($i = 0; $i < sizeof($usr_units); $i++) {
|
||||||
|
echo ("<option>" . $usr_units[$i] . "</option>\n");
|
||||||
|
}
|
||||||
|
echo ("</select><td>\n");
|
||||||
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><a href=\"help.php?HelpNumber=602\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
||||||
|
echo ("</tr>\n");
|
||||||
|
echo ("</table>\n");
|
||||||
|
echo ("</fieldset>\n");
|
||||||
|
echo ("<br>\n");
|
||||||
}
|
}
|
||||||
echo ("</select><td>\n");
|
|
||||||
echo ("<td><input type=text name=newsuff_u></td>\n");
|
|
||||||
echo ("<td><a href=\"help.php?HelpNumber=601\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
|
||||||
echo ("</tr>\n");
|
|
||||||
// delete OU
|
|
||||||
echo ("<tr>\n");
|
|
||||||
echo ("<td><input type=radio name=\"type\" value=\"del_usr\"></td>\n");
|
|
||||||
echo ("<td><b>" . _("Delete organizational unit") . ":</b></td>\n");
|
|
||||||
echo ("<td> </td>\n");
|
|
||||||
echo ("<td><select size=1 name=usersuff_d>");
|
|
||||||
for ($i = 0; $i < sizeof($usr_units); $i++) {
|
|
||||||
echo ("<option>" . $usr_units[$i] . "</option>\n");
|
|
||||||
}
|
|
||||||
echo ("</select><td>\n");
|
|
||||||
echo ("<td> </td>\n");
|
|
||||||
echo ("<td><a href=\"help.php?HelpNumber=602\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
|
||||||
echo ("</tr>\n");
|
|
||||||
echo ("</table>\n");
|
|
||||||
echo ("</fieldset>\n");
|
|
||||||
echo ("<br>\n");
|
|
||||||
|
|
||||||
// group OUs
|
// group OUs
|
||||||
echo ("<fieldset><legend><b>" . _("Groups") . "</b></legend>\n");
|
if ($_SESSION["config"]->get_GroupSuffix() != "") {
|
||||||
echo ("<table border=0>\n");
|
// generate lists of possible suffixes
|
||||||
// new OU
|
$grp_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_GroupSuffix());
|
||||||
echo ("<tr>\n");
|
echo ("<fieldset><legend><b>" . _("Groups") . "</b></legend>\n");
|
||||||
echo ("<td><input type=radio name=\"type\" value=\"new_grp\"></td>\n");
|
echo ("<table border=0>\n");
|
||||||
echo ("<td><b>" . _("New organizational unit") . ":</b></td>\n");
|
// new OU
|
||||||
echo ("<td> </td>\n");
|
echo ("<tr>\n");
|
||||||
echo ("<td><select size=1 name=groupsuff_n>");
|
echo ("<td><input type=radio name=\"type\" value=\"new_grp\"></td>\n");
|
||||||
for ($i = 0; $i < sizeof($grp_units); $i++) {
|
echo ("<td><b>" . _("New organizational unit") . ":</b></td>\n");
|
||||||
echo ("<option>" . $grp_units[$i] . "</option>\n");
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><select size=1 name=groupsuff_n>");
|
||||||
|
for ($i = 0; $i < sizeof($grp_units); $i++) {
|
||||||
|
echo ("<option>" . $grp_units[$i] . "</option>\n");
|
||||||
|
}
|
||||||
|
echo ("</select><td>\n");
|
||||||
|
echo ("<td><input type=text name=newsuff_g></td>\n");
|
||||||
|
echo ("<td><a href=\"help.php?HelpNumber=601\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
||||||
|
echo ("</tr>\n");
|
||||||
|
// delete OU
|
||||||
|
echo ("<tr>\n");
|
||||||
|
echo ("<td><input type=radio name=\"type\" value=\"del_grp\"></td>\n");
|
||||||
|
echo ("<td><b>" . _("Delete organizational unit") . ":</b></td>\n");
|
||||||
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><select size=1 name=groupsuff_d>");
|
||||||
|
for ($i = 0; $i < sizeof($grp_units); $i++) {
|
||||||
|
echo ("<option>" . $grp_units[$i] . "</option>\n");
|
||||||
|
}
|
||||||
|
echo ("</select><td>\n");
|
||||||
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><a href=\"help.php?HelpNumber=602\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
||||||
|
echo ("</tr>\n");
|
||||||
|
echo ("</table>\n");
|
||||||
|
echo ("</fieldset>\n");
|
||||||
|
echo ("<br>\n");
|
||||||
}
|
}
|
||||||
echo ("</select><td>\n");
|
|
||||||
echo ("<td><input type=text name=newsuff_g></td>\n");
|
|
||||||
echo ("<td><a href=\"help.php?HelpNumber=601\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
|
||||||
echo ("</tr>\n");
|
|
||||||
// delete OU
|
|
||||||
echo ("<tr>\n");
|
|
||||||
echo ("<td><input type=radio name=\"type\" value=\"del_grp\"></td>\n");
|
|
||||||
echo ("<td><b>" . _("Delete organizational unit") . ":</b></td>\n");
|
|
||||||
echo ("<td> </td>\n");
|
|
||||||
echo ("<td><select size=1 name=groupsuff_d>");
|
|
||||||
for ($i = 0; $i < sizeof($grp_units); $i++) {
|
|
||||||
echo ("<option>" . $grp_units[$i] . "</option>\n");
|
|
||||||
}
|
|
||||||
echo ("</select><td>\n");
|
|
||||||
echo ("<td> </td>\n");
|
|
||||||
echo ("<td><a href=\"help.php?HelpNumber=602\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
|
||||||
echo ("</tr>\n");
|
|
||||||
echo ("</table>\n");
|
|
||||||
echo ("</fieldset>\n");
|
|
||||||
echo ("<br>\n");
|
|
||||||
|
|
||||||
// host OUs
|
// host OUs
|
||||||
echo ("<fieldset><legend><b>" . _("Samba Hosts") . "</b></legend>\n");
|
if ($_SESSION["config"]->get_HostSuffix() != "") {
|
||||||
echo ("<table border=0>\n");
|
// generate lists of possible suffixes
|
||||||
// new OU
|
$hst_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_HostSuffix());
|
||||||
echo ("<tr>\n");
|
echo ("<fieldset><legend><b>" . _("Samba Hosts") . "</b></legend>\n");
|
||||||
echo ("<td><input type=radio name=\"type\" value=\"new_hst\"></td>\n");
|
echo ("<table border=0>\n");
|
||||||
echo ("<td><b>" . _("New organizational unit") . ":</b></td>\n");
|
// new OU
|
||||||
echo ("<td> </td>\n");
|
echo ("<tr>\n");
|
||||||
echo ("<td><select size=1 name=hostsuff_n>");
|
echo ("<td><input type=radio name=\"type\" value=\"new_hst\"></td>\n");
|
||||||
for ($i = 0; $i < sizeof($hst_units); $i++) {
|
echo ("<td><b>" . _("New organizational unit") . ":</b></td>\n");
|
||||||
echo ("<option>" . $hst_units[$i] . "</option>\n");
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><select size=1 name=hostsuff_n>");
|
||||||
|
for ($i = 0; $i < sizeof($hst_units); $i++) {
|
||||||
|
echo ("<option>" . $hst_units[$i] . "</option>\n");
|
||||||
|
}
|
||||||
|
echo ("</select><td>\n");
|
||||||
|
echo ("<td><input type=text name=newsuff_h></td>\n");
|
||||||
|
echo ("<td><a href=\"help.php?HelpNumber=601\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
||||||
|
echo ("</tr>\n");
|
||||||
|
// delete OU
|
||||||
|
echo ("<tr>\n");
|
||||||
|
echo ("<td><input type=radio name=\"type\" value=\"del_hst\"></td>\n");
|
||||||
|
echo ("<td><b>" . _("Delete organizational unit") . ":</b></td>\n");
|
||||||
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><select size=1 name=hostsuff_d>");
|
||||||
|
for ($i = 0; $i < sizeof($hst_units); $i++) {
|
||||||
|
echo ("<option>" . $hst_units[$i] . "</option>\n");
|
||||||
|
}
|
||||||
|
echo ("</select><td>\n");
|
||||||
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><a href=\"help.php?HelpNumber=602\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
||||||
|
echo ("</tr>\n");
|
||||||
|
echo ("</table>\n");
|
||||||
|
echo ("</fieldset>\n");
|
||||||
|
echo ("<br>\n");
|
||||||
}
|
}
|
||||||
echo ("</select><td>\n");
|
|
||||||
echo ("<td><input type=text name=newsuff_h></td>\n");
|
|
||||||
echo ("<td><a href=\"help.php?HelpNumber=601\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
|
||||||
echo ("</tr>\n");
|
|
||||||
// delete OU
|
|
||||||
echo ("<tr>\n");
|
|
||||||
echo ("<td><input type=radio name=\"type\" value=\"del_hst\"></td>\n");
|
|
||||||
echo ("<td><b>" . _("Delete organizational unit") . ":</b></td>\n");
|
|
||||||
echo ("<td> </td>\n");
|
|
||||||
echo ("<td><select size=1 name=hostsuff_d>");
|
|
||||||
for ($i = 0; $i < sizeof($hst_units); $i++) {
|
|
||||||
echo ("<option>" . $hst_units[$i] . "</option>\n");
|
|
||||||
}
|
|
||||||
echo ("</select><td>\n");
|
|
||||||
echo ("<td> </td>\n");
|
|
||||||
echo ("<td><a href=\"help.php?HelpNumber=602\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
|
||||||
echo ("</tr>\n");
|
|
||||||
echo ("</table>\n");
|
|
||||||
echo ("</fieldset>\n");
|
|
||||||
echo ("<br>\n");
|
|
||||||
|
|
||||||
// domain OUs
|
// domain OUs
|
||||||
echo ("<fieldset><legend><b>" . _("Domains") . "</b></legend>\n");
|
if ($_SESSION["config"]->get_DomainSuffix() != "") {
|
||||||
echo ("<table border=0>\n");
|
// generate lists of possible suffixes
|
||||||
// new OU
|
$dom_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_DomainSuffix());
|
||||||
echo ("<tr>\n");
|
echo ("<fieldset><legend><b>" . _("Domains") . "</b></legend>\n");
|
||||||
echo ("<td><input type=radio name=\"type\" value=\"new_dom\"></td>\n");
|
echo ("<table border=0>\n");
|
||||||
echo ("<td><b>" . _("New organizational unit") . ":</b></td>\n");
|
// new OU
|
||||||
echo ("<td> </td>\n");
|
echo ("<tr>\n");
|
||||||
echo ("<td><select size=1 name=domsuff_n>");
|
echo ("<td><input type=radio name=\"type\" value=\"new_dom\"></td>\n");
|
||||||
for ($i = 0; $i < sizeof($dom_units); $i++) {
|
echo ("<td><b>" . _("New organizational unit") . ":</b></td>\n");
|
||||||
echo ("<option>" . $dom_units[$i] . "</option>\n");
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><select size=1 name=domsuff_n>");
|
||||||
|
for ($i = 0; $i < sizeof($dom_units); $i++) {
|
||||||
|
echo ("<option>" . $dom_units[$i] . "</option>\n");
|
||||||
|
}
|
||||||
|
echo ("</select><td>\n");
|
||||||
|
echo ("<td><input type=text name=newsuff_d></td>\n");
|
||||||
|
echo ("<td><a href=\"help.php?HelpNumber=601\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
||||||
|
echo ("</tr>\n");
|
||||||
|
// delete OU
|
||||||
|
echo ("<tr>\n");
|
||||||
|
echo ("<td><input type=radio name=\"type\" value=\"del_dom\"></td>\n");
|
||||||
|
echo ("<td><b>" . _("Delete organizational unit") . ":</b></td>\n");
|
||||||
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><select size=1 name=domsuff_d>");
|
||||||
|
for ($i = 0; $i < sizeof($dom_units); $i++) {
|
||||||
|
echo ("<option>" . $dom_units[$i] . "</option>\n");
|
||||||
|
}
|
||||||
|
echo ("</select><td>\n");
|
||||||
|
echo ("<td> </td>\n");
|
||||||
|
echo ("<td><a href=\"help.php?HelpNumber=602\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
||||||
|
echo ("</tr>\n");
|
||||||
|
echo ("</table>\n");
|
||||||
|
echo ("</fieldset>\n");
|
||||||
|
echo ("<br>\n");
|
||||||
}
|
}
|
||||||
echo ("</select><td>\n");
|
|
||||||
echo ("<td><input type=text name=newsuff_d></td>\n");
|
|
||||||
echo ("<td><a href=\"help.php?HelpNumber=601\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
|
||||||
echo ("</tr>\n");
|
|
||||||
// delete OU
|
|
||||||
echo ("<tr>\n");
|
|
||||||
echo ("<td><input type=radio name=\"type\" value=\"del_dom\"></td>\n");
|
|
||||||
echo ("<td><b>" . _("Delete organizational unit") . ":</b></td>\n");
|
|
||||||
echo ("<td> </td>\n");
|
|
||||||
echo ("<td><select size=1 name=domsuff_d>");
|
|
||||||
for ($i = 0; $i < sizeof($dom_units); $i++) {
|
|
||||||
echo ("<option>" . $dom_units[$i] . "</option>\n");
|
|
||||||
}
|
|
||||||
echo ("</select><td>\n");
|
|
||||||
echo ("<td> </td>\n");
|
|
||||||
echo ("<td><a href=\"help.php?HelpNumber=602\" target=\"lamhelp\">". _("Help") ."</a></td>\n");
|
|
||||||
echo ("</tr>\n");
|
|
||||||
echo ("</table>\n");
|
|
||||||
echo ("</fieldset>\n");
|
|
||||||
echo ("<br>\n");
|
|
||||||
|
|
||||||
echo ("<input type=\"submit\" name=\"submit\" value=\"" . _("Submit") . "\">");
|
echo ("<input type=\"submit\" name=\"submit\" value=\"" . _("Submit") . "\">");
|
||||||
echo ("</form>\n");
|
echo ("</form>\n");
|
||||||
|
|
Loading…
Reference in New Issue