saved group/host lists in session
added redirection page for memberUid links in listgroups.php
This commit is contained in:
parent
2199fddb62
commit
d12c962abc
|
@ -38,6 +38,11 @@ $sort = $_GET['sort'];
|
|||
// copy HTTP-GET variables to HTTP-POST
|
||||
$_POST = $_POST + $_GET;
|
||||
|
||||
$grp_info = $_SESSION['grp_info'];
|
||||
session_register('grp_info');
|
||||
$grp_units = $_SESSION['grp_units'];
|
||||
session_register('grp_units');
|
||||
|
||||
// check if button was pressed and if we have to add/delete a group
|
||||
if ($_POST['new_group'] || $_POST['del_group']){
|
||||
// add new group
|
||||
|
@ -104,42 +109,49 @@ session_register('grp_suffix');
|
|||
$searchfilter = "";
|
||||
for ($k = 0; $k < sizeof($desc_array); $k++) {
|
||||
if ($_POST["filter" . strtolower($attr_array[$k])]) {
|
||||
$searchfilter = $searchfilter . "&filter" . strtolower($attr_array[$k]) . "='".
|
||||
$_POST["filter" . strtolower($attr_array[$k])] . "'";
|
||||
$searchfilter = $searchfilter . "&filter" . strtolower($attr_array[$k]) . "=".
|
||||
$_POST["filter" . strtolower($attr_array[$k])];
|
||||
}
|
||||
}
|
||||
|
||||
// configure search filter
|
||||
// Groups have the attribute "posixGroup"
|
||||
$filter = "(&(objectClass=posixGroup)";
|
||||
for ($k = 0; $k < sizeof($desc_array); $k++) {
|
||||
if (! $_GET['norefresh']) {
|
||||
// configure search filter
|
||||
// Groups have the attribute "posixGroup"
|
||||
$filter = "(&(objectClass=posixGroup)";
|
||||
for ($k = 0; $k < sizeof($desc_array); $k++) {
|
||||
if ($_POST["filter" . strtolower($attr_array[$k])])
|
||||
$filter = $filter . "(" . strtolower($attr_array[$k]) . "=" .
|
||||
$_POST["filter" . strtolower($attr_array[$k])] . ")";
|
||||
else
|
||||
$_POST["filter" . strtolower($attr_array[$k])] = "";
|
||||
}
|
||||
$filter = $filter . ")";
|
||||
$attrs = $attr_array;
|
||||
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||
}
|
||||
$filter = $filter . ")";
|
||||
$attrs = $attr_array;
|
||||
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||
$grp_suffix,
|
||||
$filter, $attrs);
|
||||
if ($sr) {
|
||||
$info = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||
if ($sr) {
|
||||
$grp_info = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||
ldap_free_result($sr);
|
||||
if ($info["count"] == 0) StatusMessage("WARN", "", _("No Groups found!"));
|
||||
if ($grp_info["count"] == 0) StatusMessage("WARN", "", _("No Groups found!"));
|
||||
// delete first array entry which is "count"
|
||||
array_shift($info);
|
||||
array_shift($grp_info);
|
||||
// sort rows by sort column ($sort)
|
||||
usort($info, "cmp_array");
|
||||
usort($grp_info, "cmp_array");
|
||||
}
|
||||
else StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences."), _("No Groups found!"));
|
||||
}
|
||||
else {
|
||||
if (sizeof($grp_info) == 0) StatusMessage("WARN", "", _("No Groups found!"));
|
||||
// sort rows by sort column ($sort)
|
||||
if ($grp_info) usort($grp_info, "cmp_array");
|
||||
}
|
||||
else StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences."), _("No Groups found!"));
|
||||
|
||||
echo ("<form action=\"listgroups.php\" method=\"post\">\n");
|
||||
|
||||
// draw navigation bar if group accounts were found
|
||||
if (sizeof($info) > 0) {
|
||||
draw_navigation_bar(sizeof($info));
|
||||
if (sizeof($grp_info) > 0) {
|
||||
draw_navigation_bar(sizeof($grp_info));
|
||||
echo ("<br>");
|
||||
}
|
||||
|
||||
|
@ -150,10 +162,10 @@ echo "<tr class=\"grouplist-head\"><th width=22 height=34></th><th></th>";
|
|||
for ($k = 0; $k < sizeof($desc_array); $k++) {
|
||||
if (strtolower($attr_array[$k]) == $sort) {
|
||||
echo "<th class=\"grouplist-sort\"><a href=\"listgroups.php?".
|
||||
"sort=" . strtolower($attr_array[$k]) . $searchfilter . "\">" . $desc_array[$k] . "</a></th>";
|
||||
"sort=" . strtolower($attr_array[$k]) . $searchfilter . "&norefresh=y" . "\">" . $desc_array[$k] . "</a></th>";
|
||||
}
|
||||
else echo "<th><a href=\"listgroups.php?".
|
||||
"sort=" . strtolower($attr_array[$k]) . $searchfilter . "\">" . $desc_array[$k] . "</a></th>";
|
||||
"sort=" . strtolower($attr_array[$k]) . $searchfilter . "&norefresh=y" . "\">" . $desc_array[$k] . "</a></th>";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
|
@ -172,41 +184,36 @@ echo "</tr>\n";
|
|||
|
||||
// calculate which rows to show
|
||||
$table_begin = ($page - 1) * $max_pageentrys;
|
||||
if (($page * $max_pageentrys) > sizeof($info)) $table_end = sizeof($info);
|
||||
if (($page * $max_pageentrys) > sizeof($grp_info)) $table_end = sizeof($grp_info);
|
||||
else $table_end = ($page * $max_pageentrys);
|
||||
|
||||
// print group list
|
||||
for ($i = $table_begin; $i < $table_end; $i++) {
|
||||
echo("<tr class=\"grouplist\" onMouseOver=\"group_over(this, '" . $info[$i]["dn"] . "')\"" .
|
||||
" onMouseOut=\"group_out(this, '" . $info[$i]["dn"] . "')\"" .
|
||||
" onClick=\"group_click(this, '" . $info[$i]["dn"] . "')\"" .
|
||||
" onDblClick=\"parent.frames[1].location.href='../account.php?type=group&DN=" . $info[$i]["dn"] . "'\">" .
|
||||
" <td height=22><input onClick=\"group_click(this, '" . $info[$i]["dn"] . "')\" type=\"checkbox\" name=\"" . $info[$i]["dn"] . "\"></td>" .
|
||||
" <td align='center'><a href=\"../account.php?type=group&DN='" . $info[$i]["dn"] . "'\">" . _("Edit") . "</a></td>");
|
||||
echo("<tr class=\"grouplist\" onMouseOver=\"group_over(this, '" . $grp_info[$i]["dn"] . "')\"" .
|
||||
" onMouseOut=\"group_out(this, '" . $grp_info[$i]["dn"] . "')\"" .
|
||||
" onClick=\"group_click(this, '" . $grp_info[$i]["dn"] . "')\"" .
|
||||
" onDblClick=\"parent.frames[1].location.href='../account.php?type=group&DN=" . $grp_info[$i]["dn"] . "'\">" .
|
||||
" <td height=22><input onClick=\"group_click(this, '" . $grp_info[$i]["dn"] . "')\" type=\"checkbox\" name=\"" . $grp_info[$i]["dn"] . "\"></td>" .
|
||||
" <td align='center'><a href=\"../account.php?type=group&DN='" . $grp_info[$i]["dn"] . "'\">" . _("Edit") . "</a></td>");
|
||||
for ($k = 0; $k < sizeof($attr_array); $k++) {
|
||||
echo ("<td>");
|
||||
// print all attribute entries seperated by "; "
|
||||
if (sizeof($info[$i][strtolower($attr_array[$k])]) > 0) {
|
||||
if (sizeof($grp_info[$i][strtolower($attr_array[$k])]) > 0) {
|
||||
// delete first array entry which is "count"
|
||||
array_shift($info[$i][strtolower($attr_array[$k])]);
|
||||
if (! $_GET['norefresh']) array_shift($grp_info[$i][strtolower($attr_array[$k])]);
|
||||
// generate links for group members
|
||||
if (strtolower($attr_array[$k]) == "memberuid") {
|
||||
$linklist = array();
|
||||
for ($d = 0; $d < sizeof($info[$i][strtolower($attr_array[$k])]); $d++) {
|
||||
$user = $info[$i][strtolower($attr_array[$k])][$d]; // user name
|
||||
$dn = $_SESSION["ldap"]->search_username($user); // DN entry
|
||||
for ($d = 0; $d < sizeof($grp_info[$i][strtolower($attr_array[$k])]); $d++) {
|
||||
$user = $grp_info[$i][strtolower($attr_array[$k])][$d]; // user name
|
||||
// if user was found in LDAP make link, otherwise just print name
|
||||
if ($dn) {
|
||||
$linklist[$d] = "<a href=../account.php?type=user&DN='" . $dn . "' >" .
|
||||
$info[$i][strtolower($attr_array[$k])][$d] . "</a>";
|
||||
}
|
||||
else $linklist[$d] = $user;
|
||||
$linklist[$d] = "<a href=userlink.php?user='" . $user . "' >" . $user . "</a>";
|
||||
}
|
||||
echo implode("; ", $linklist);
|
||||
}
|
||||
// print all other attributes
|
||||
else {
|
||||
echo implode("; ", $info[$i][strtolower($attr_array[$k])]);
|
||||
echo implode("; ", $grp_info[$i][strtolower($attr_array[$k])]);
|
||||
}
|
||||
}
|
||||
echo ("</td>");
|
||||
|
@ -217,35 +224,39 @@ echo ("</table>");
|
|||
echo ("<br>");
|
||||
|
||||
// draw navigation bar if group accounts were found
|
||||
if (sizeof($info) > 0) {
|
||||
draw_navigation_bar(sizeof($info));
|
||||
if (sizeof($grp_info) > 0) {
|
||||
draw_navigation_bar(sizeof($grp_info));
|
||||
echo ("<br>\n");
|
||||
}
|
||||
|
||||
// generate list of possible suffixes
|
||||
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||
if (! $_GET['norefresh']) {
|
||||
// generate list of possible suffixes
|
||||
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||
$_SESSION["config"]->get_GroupSuffix(),
|
||||
"objectClass=organizationalunit", array("DN"));
|
||||
if ($sr) {
|
||||
$units = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||
if ($sr) {
|
||||
$grp_units = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||
// delete first array entry which is "count"
|
||||
array_shift($units);
|
||||
array_shift($grp_units);
|
||||
// remove sub arrays
|
||||
for ($i = 0; $i < sizeof($units); $i++) $units[$i] = $units[$i]['dn'];
|
||||
for ($i = 0; $i < sizeof($grp_units); $i++) $grp_units[$i] = $grp_units[$i]['dn'];
|
||||
// add root suffix from config
|
||||
if (!in_array($_SESSION["config"]->get_GroupSuffix(), $units)) array_push($units, $_SESSION["config"]->get_GroupSuffix());
|
||||
if (!in_array($_SESSION["config"]->get_GroupSuffix(), $grp_units)) {
|
||||
array_push($grp_units, $_SESSION["config"]->get_GroupSuffix());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo ("<p align=\"left\">\n");
|
||||
echo ("<input type=\"submit\" name=\"new_group\" value=\"" . _("New Group") . "\">\n");
|
||||
if (sizeof($info) > 0) echo ("<input type=\"submit\" name=\"del_group\" value=\"" . _("Delete Group(s)") . "\">\n");
|
||||
if (sizeof($grp_info) > 0) echo ("<input type=\"submit\" name=\"del_group\" value=\"" . _("Delete Group(s)") . "\">\n");
|
||||
// print combobox with possible sub-DNs
|
||||
if (sizeof($units) > 1) {
|
||||
if (sizeof($grp_units) > 1) {
|
||||
echo (" <b>" . _("Suffix") . ": </b>");
|
||||
echo ("<select size=1 name=\"grp_suffix\">\n");
|
||||
for ($i = 0; $i < sizeof($units); $i++) {
|
||||
if ($grp_suffix == $units[$i]) echo ("<option selected>" . $units[$i] . "</option>\n");
|
||||
else echo("<option>" . $units[$i] . "</option>\n");
|
||||
for ($i = 0; $i < sizeof($grp_units); $i++) {
|
||||
if ($grp_suffix == $grp_units[$i]) echo ("<option selected>" . $grp_units[$i] . "</option>\n");
|
||||
else echo("<option>" . $grp_units[$i] . "</option>\n");
|
||||
}
|
||||
echo ("</select>\n");
|
||||
echo ("<input type=\"submit\" name=\"refresh\" value=\"" . _("Change Suffix") . "\">");
|
||||
|
|
|
@ -38,6 +38,11 @@ $sort = $_GET['sort'];
|
|||
// copy HTTP-GET variables to HTTP-POST
|
||||
$_POST = $_POST + $_GET;
|
||||
|
||||
$hst_info = $_SESSION['hst_info'];
|
||||
session_register('hst_info');
|
||||
$hst_units = $_SESSION['hst_units'];
|
||||
session_register('hst_units');
|
||||
|
||||
// check if button was pressed and if we have to add/delete a host
|
||||
if ($_POST['new_host'] || $_POST['del_host']){
|
||||
// add new host
|
||||
|
@ -104,48 +109,55 @@ session_register('hst_suffix');
|
|||
$searchfilter = "";
|
||||
for ($k = 0; $k < sizeof($desc_array); $k++) {
|
||||
if ($_POST["filter" . strtolower($attr_array[$k])]) {
|
||||
$searchfilter = $searchfilter . "&filter" . strtolower($attr_array[$k]) . "='".
|
||||
$_POST["filter" . strtolower($attr_array[$k])] . "'";
|
||||
$searchfilter = $searchfilter . "&filter" . strtolower($attr_array[$k]) . "=".
|
||||
$_POST["filter" . strtolower($attr_array[$k])];
|
||||
}
|
||||
}
|
||||
|
||||
// configure search filter
|
||||
if ($_SESSION['config']->get_samba3() == "yes") {
|
||||
if (! $_GET['norefresh']) {
|
||||
// configure search filter
|
||||
if ($_SESSION['config']->get_samba3() == "yes") {
|
||||
// Samba hosts have the attribute "sambaSamAccount" and end with "$"
|
||||
$filter = "(&(objectClass=sambaSamAccount) (uid=*$)";
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
// Samba hosts have the attribute "sambaAccount" and end with "$"
|
||||
$filter = "(&(objectClass=sambaAccount) (uid=*$)";
|
||||
}
|
||||
for ($k = 0; $k < sizeof($desc_array); $k++) {
|
||||
}
|
||||
for ($k = 0; $k < sizeof($desc_array); $k++) {
|
||||
if ($_POST["filter" . strtolower($attr_array[$k])])
|
||||
$filter = $filter . "(" . strtolower($attr_array[$k]) . "=" .
|
||||
$_POST["filter" . strtolower($attr_array[$k])] . ")";
|
||||
else
|
||||
$_POST["filter" . strtolower($attr_array[$k])] = "";
|
||||
}
|
||||
$filter = $filter . ")";
|
||||
$attrs = $attr_array;
|
||||
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||
}
|
||||
$filter = $filter . ")";
|
||||
$attrs = $attr_array;
|
||||
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||
$hst_suffix,
|
||||
$filter, $attrs);
|
||||
if ($sr) {
|
||||
$info = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||
if ($sr) {
|
||||
$hst_info = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||
ldap_free_result($sr);
|
||||
if ($info["count"] == 0) StatusMessage("WARN", "", _("No Samba Hosts found!"));
|
||||
if ($hst_info["count"] == 0) StatusMessage("WARN", "", _("No Samba Hosts found!"));
|
||||
// delete first array entry which is "count"
|
||||
array_shift($info);
|
||||
array_shift($hst_info);
|
||||
// sort rows by sort column ($sort)
|
||||
usort($info, "cmp_array");
|
||||
usort($hst_info, "cmp_array");
|
||||
}
|
||||
else StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences."), _("No Samba Hosts found!"));
|
||||
}
|
||||
else {
|
||||
if (sizeof($hst_info) == 0) StatusMessage("WARN", "", _("No Hosts found!"));
|
||||
// sort rows by sort column ($sort)
|
||||
if ($hst_info) usort($hst_info, "cmp_array");
|
||||
}
|
||||
else StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences."), _("No Samba Hosts found!"));
|
||||
|
||||
echo ("<form action=\"listhosts.php\" method=\"post\">\n");
|
||||
|
||||
// draw navigation bar if host accounts were found
|
||||
if (sizeof($info) > 0) {
|
||||
draw_navigation_bar(sizeof($info));
|
||||
if (sizeof($hst_info) > 0) {
|
||||
draw_navigation_bar(sizeof($hst_info));
|
||||
echo ("<br>\n");
|
||||
}
|
||||
|
||||
|
@ -156,10 +168,10 @@ echo "<tr class=\"hostlist-head\"><th width=22 height=34></th><th></th>";
|
|||
for ($k = 0; $k < sizeof($desc_array); $k++) {
|
||||
if (strtolower($attr_array[$k]) == $sort) {
|
||||
echo "<th class=\"hostlist-sort\"><a href=\"listhosts.php?".
|
||||
"sort=" . strtolower($attr_array[$k]) . $searchfilter . "\">" . $desc_array[$k] . "</a></th>";
|
||||
"sort=" . strtolower($attr_array[$k]) . $searchfilter . "&norefresh=y" . "\">" . $desc_array[$k] . "</a></th>";
|
||||
}
|
||||
else echo "<th><a href=\"listhosts.php?".
|
||||
"sort=" . strtolower($attr_array[$k]) . $searchfilter . "\">" . $desc_array[$k] . "</a></th>";
|
||||
"sort=" . strtolower($attr_array[$k]) . $searchfilter . "&norefresh=y" . "\">" . $desc_array[$k] . "</a></th>";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
|
@ -178,24 +190,24 @@ echo "</tr>\n";
|
|||
|
||||
// calculate which rows to show
|
||||
$table_begin = ($page - 1) * $max_pageentrys;
|
||||
if (($page * $max_pageentrys) > sizeof($info)) $table_end = sizeof($info);
|
||||
if (($page * $max_pageentrys) > sizeof($hst_info)) $table_end = sizeof($hst_info);
|
||||
else $table_end = ($page * $max_pageentrys);
|
||||
|
||||
// print host list
|
||||
for ($i = $table_begin; $i < $table_end; $i++) {
|
||||
echo("<tr class=\"hostlist\" onMouseOver=\"host_over(this, '" . $info[$i]["dn"] . "')\"" .
|
||||
" onMouseOut=\"host_out(this, '" . $info[$i]["dn"] . "')\"" .
|
||||
" onClick=\"host_click(this, '" . $info[$i]["dn"] . "')\"" .
|
||||
" onDblClick=\"parent.frames[1].location.href='../account.php?type=host&DN=" . $info[$i]["dn"] . "'\">" .
|
||||
" <td height=22><input onClick=\"host_click(this, '" . $info[$i]["dn"] . "')\" type=\"checkbox\" name=\"" . $info[$i]["dn"] . "\"></td>" .
|
||||
" <td align='center'><a href=\"../account.php?type=host&DN='" . $info[$i]["dn"] . "'\">" . _("Edit") . "</a></td>");
|
||||
echo("<tr class=\"hostlist\" onMouseOver=\"host_over(this, '" . $hst_info[$i]["dn"] . "')\"" .
|
||||
" onMouseOut=\"host_out(this, '" . $hst_info[$i]["dn"] . "')\"" .
|
||||
" onClick=\"host_click(this, '" . $hst_info[$i]["dn"] . "')\"" .
|
||||
" onDblClick=\"parent.frames[1].location.href='../account.php?type=host&DN=" . $hst_info[$i]["dn"] . "'\">" .
|
||||
" <td height=22><input onClick=\"host_click(this, '" . $hst_info[$i]["dn"] . "')\" type=\"checkbox\" name=\"" . $hst_info[$i]["dn"] . "\"></td>" .
|
||||
" <td align='center'><a href=\"../account.php?type=host&DN='" . $hst_info[$i]["dn"] . "'\">" . _("Edit") . "</a></td>");
|
||||
for ($k = 0; $k < sizeof($attr_array); $k++) {
|
||||
echo ("<td>");
|
||||
// print all attribute entries seperated by "; "
|
||||
if (sizeof($info[$i][strtolower($attr_array[$k])]) > 0) {
|
||||
if (sizeof($hst_info[$i][strtolower($attr_array[$k])]) > 0) {
|
||||
// delete first array entry which is "count"
|
||||
array_shift($info[$i][strtolower($attr_array[$k])]);
|
||||
echo implode("; ", $info[$i][strtolower($attr_array[$k])]);
|
||||
if (! $_GET['norefresh']) array_shift($hst_info[$i][strtolower($attr_array[$k])]);
|
||||
echo implode("; ", $hst_info[$i][strtolower($attr_array[$k])]);
|
||||
}
|
||||
echo ("</td>");
|
||||
}
|
||||
|
@ -206,35 +218,39 @@ echo ("</table>");
|
|||
echo ("<br>");
|
||||
|
||||
// draw navigation bar if host accounts were found
|
||||
if (sizeof($info) > 0) {
|
||||
draw_navigation_bar(sizeof($info));
|
||||
if (sizeof($hst_info) > 0) {
|
||||
draw_navigation_bar(sizeof($hst_info));
|
||||
echo ("<br>\n");
|
||||
}
|
||||
|
||||
// generate list of possible suffixes
|
||||
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||
if (! $_GET['norefresh']) {
|
||||
// generate list of possible suffixes
|
||||
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||
$_SESSION["config"]->get_HostSuffix(),
|
||||
"objectClass=organizationalunit", array("DN"));
|
||||
if ($sr) {
|
||||
$units = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||
if ($sr) {
|
||||
$hst_units = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||
// delete first array entry which is "count"
|
||||
array_shift($units);
|
||||
array_shift($hst_units);
|
||||
// remove sub arrays
|
||||
for ($i = 0; $i < sizeof($units); $i++) $units[$i] = $units[$i]['dn'];
|
||||
for ($i = 0; $i < sizeof($hst_units); $i++) $hst_units[$i] = $hst_units[$i]['dn'];
|
||||
// add root suffix from config
|
||||
if (!in_array($_SESSION["config"]->get_HostSuffix(), $units)) array_push($units, $_SESSION["config"]->get_HostSuffix());
|
||||
if (!in_array($_SESSION["config"]->get_HostSuffix(), $hst_units)) {
|
||||
array_push($hst_units, $_SESSION["config"]->get_HostSuffix());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo ("<p align=\"left\">\n");
|
||||
echo ("<input type=\"submit\" name=\"new_host\" value=\"" . _("New Host") . "\">\n");
|
||||
if (sizeof($info) > 0) echo ("<input type=\"submit\" name=\"del_host\" value=\"" . _("Delete Host(s)") . "\">\n");
|
||||
if (sizeof($hst_info) > 0) echo ("<input type=\"submit\" name=\"del_host\" value=\"" . _("Delete Host(s)") . "\">\n");
|
||||
// print combobox with possible sub-DNs
|
||||
if (sizeof($units) > 1) {
|
||||
if (sizeof($hst_units) > 1) {
|
||||
echo (" <b>" . _("Suffix") . ": </b>");
|
||||
echo ("<select size=1 name=\"hst_suffix\">\n");
|
||||
for ($i = 0; $i < sizeof($units); $i++) {
|
||||
if ($hst_suffix == $units[$i]) echo ("<option selected>" . $units[$i] . "</option>\n");
|
||||
else echo("<option>" . $units[$i] . "</option>\n");
|
||||
for ($i = 0; $i < sizeof($hst_units); $i++) {
|
||||
if ($hst_suffix == $hst_units[$i]) echo ("<option selected>" . $hst_units[$i] . "</option>\n");
|
||||
else echo("<option>" . $hst_units[$i] . "</option>\n");
|
||||
}
|
||||
echo ("</select>\n");
|
||||
echo ("<input type=\"submit\" name=\"refresh\" value=\"" . _("Change Suffix") . "\">");
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
/*
|
||||
$Id$
|
||||
|
||||
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
|
||||
Copyright (C) 2003 Roland Gruber
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more detaexils.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
This page will redirect to account.php if the given user is valid.
|
||||
It is called from listgroups.php via the memberUID links.
|
||||
|
||||
*/
|
||||
include_once ("../../lib/ldap.inc");
|
||||
include_once ("../../lib/status.inc");
|
||||
|
||||
// start session
|
||||
session_save_path("../../sess");
|
||||
@session_start();
|
||||
|
||||
setlanguage();
|
||||
|
||||
// get user name
|
||||
$user = $_GET['user'];
|
||||
$user = str_replace("\'", '',$user);
|
||||
|
||||
// get DN of user
|
||||
$dn = $_SESSION['ldap']->search_username($user);
|
||||
|
||||
if ($dn) {
|
||||
// redirect to account.php
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../account.php?type=user&DN='$dn'\">");
|
||||
|
||||
}
|
||||
else {
|
||||
// print error message if user was not found
|
||||
echo ("<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>\n");
|
||||
echo ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
|
||||
echo "<html><head><title>userlink</title>\n";
|
||||
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
|
||||
echo "</head><body>\n";
|
||||
echo StatusMessage("ERROR", "", _("This user was not found or is invalid!") . " " . $user);
|
||||
echo ("</body></html>\n");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue