fixed problem with spaces in DN
This commit is contained in:
parent
91ba8e753a
commit
dc2a192a8a
|
@ -239,7 +239,10 @@ function listDoPost($scope) {
|
|||
elseif ($_POST['del']){
|
||||
// search for checkboxes
|
||||
$accounts = array_keys($_POST, "on");
|
||||
$_SESSION['delete_dn'] = $accounts;
|
||||
$_SESSION['delete_dn'] = array();
|
||||
for ($i = 0; $i < sizeof($accounts); $i++) {
|
||||
$_SESSION['delete_dn'][] = $_SESSION[$scope . 'info'][$accounts[$i]]['dn'];
|
||||
}
|
||||
if (sizeof($accounts) > 0) {
|
||||
metaRefresh("../delete.php?type=" . $scope);
|
||||
exit;
|
||||
|
@ -254,7 +257,7 @@ function listDoPost($scope) {
|
|||
// load accounts from LDAP
|
||||
for ($i = 0; $i < sizeof($accounts); $i++) {
|
||||
$_SESSION["accountPDF-$i"] = new accountContainer($scope, "accountPDF-$i");
|
||||
$_SESSION["accountPDF-$i"]->load_account($accounts[$i]);
|
||||
$_SESSION["accountPDF-$i"]->load_account($_SESSION[$scope . 'info'][$accounts[$i]]['dn']);
|
||||
$list[$i] = $_SESSION["accountPDF-$i"];
|
||||
}
|
||||
if (sizeof($list) > 0) {
|
||||
|
|
|
@ -139,7 +139,10 @@ $filter = listBuildFilter($_POST, $attr_array);
|
|||
$info = listFilterAccounts($info, $filter);
|
||||
if (sizeof($info) == 0) StatusMessage("WARN", "", _("No groups found!"));
|
||||
// sort rows by sort column ($sort)
|
||||
if ($info) $info = listSort($sort, $attr_array, $info);
|
||||
if ($info) {
|
||||
$info = listSort($sort, $attr_array, $info);
|
||||
$_SESSION[$scope . 'info'] = $info;
|
||||
}
|
||||
|
||||
// build filter URL
|
||||
$searchFilter = array();
|
||||
|
@ -173,19 +176,19 @@ else $table_end = ($page * $max_page_entries);
|
|||
if (sizeof($info) > 0) {
|
||||
// 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/edit.php?type=group&DN=" . $info[$i]["dn"] . "'\">");
|
||||
echo("<tr class=\"grouplist\" onMouseOver=\"group_over(this, '" . $i . "')\"" .
|
||||
" onMouseOut=\"group_out(this, '" . $i . "')\"" .
|
||||
" onClick=\"group_click(this, '" . $i . "')\"" .
|
||||
" onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=group&DN=" . $i . "'\">");
|
||||
if ($_GET['selectall'] == "yes") {
|
||||
echo " <td height=22 align=\"center\"><input onClick=\"group_click(this, '" . $info[$i]["dn"] . "')\" type=\"checkbox\"" .
|
||||
" name=\"" . $info[$i]["dn"] . "\" checked></td>";
|
||||
echo " <td height=22 align=\"center\"><input onClick=\"group_click(this, '" . $i . "')\" type=\"checkbox\"" .
|
||||
" name=\"" . $i . "\" checked></td>";
|
||||
}
|
||||
else {
|
||||
echo " <td height=22 align=\"center\"><input onClick=\"group_click(this, '" . $info[$i]["dn"] . "')\" type=\"checkbox\"" .
|
||||
" name=\"" . $info[$i]["dn"] . "\"></td>";
|
||||
echo " <td height=22 align=\"center\"><input onClick=\"group_click(this, '" . $i . "')\" type=\"checkbox\"" .
|
||||
" name=\"" . $i . "\"></td>";
|
||||
}
|
||||
echo (" <td align='center'><a href=\"../account/edit.php?type=group&DN='" . $info[$i]["dn"] . "'\">" . _("Edit") . "</a></td>");
|
||||
echo (" <td align='center'><a href=\"../account/edit.php?type=group&DN='" . $i . "'\">" . _("Edit") . "</a></td>");
|
||||
for ($k = 0; $k < sizeof($attr_array); $k++) {
|
||||
echo ("<td>");
|
||||
// print all attribute entries seperated by "; "
|
||||
|
|
|
@ -139,7 +139,10 @@ $filter = listBuildFilter($_POST, $attr_array);
|
|||
$info = listFilterAccounts($info, $filter);
|
||||
if (sizeof($info) == 0) StatusMessage("WARN", "", _("No hosts found!"));
|
||||
// sort rows by sort column ($sort)
|
||||
if ($info) $info = listSort($sort, $attr_array, $info);
|
||||
if ($info) {
|
||||
$info = listSort($sort, $attr_array, $info);
|
||||
$_SESSION[$scope . 'info'] = $info;
|
||||
}
|
||||
|
||||
// build filter URL
|
||||
$searchFilter = array();
|
||||
|
@ -173,19 +176,19 @@ else $table_end = ($page * $max_page_entries);
|
|||
if (sizeof($info) > 0) {
|
||||
// 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/edit.php?type=host&DN=" . $info[$i]["dn"] . "'\">");
|
||||
echo("<tr class=\"hostlist\" onMouseOver=\"host_over(this, '" . $i . "')\"" .
|
||||
" onMouseOut=\"host_out(this, '" . $i . "')\"" .
|
||||
" onClick=\"host_click(this, '" . $i . "')\"" .
|
||||
" onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=host&DN=" . $i . "'\">");
|
||||
if ($_GET['selectall'] == "yes") {
|
||||
echo " <td height=22 align=\"center\"><input onClick=\"host_click(this, '" . $info[$i]["dn"] . "')\"" .
|
||||
" type=\"checkbox\" checked name=\"" . $info[$i]["dn"] . "\"></td>";
|
||||
echo " <td height=22 align=\"center\"><input onClick=\"host_click(this, '" . $i . "')\"" .
|
||||
" type=\"checkbox\" checked name=\"" . $i . "\"></td>";
|
||||
}
|
||||
else {
|
||||
echo " <td height=22 align=\"center\"><input onClick=\"host_click(this, '" . $info[$i]["dn"] . "')\"" .
|
||||
" type=\"checkbox\" name=\"" . $info[$i]["dn"] . "\"></td>";
|
||||
echo " <td height=22 align=\"center\"><input onClick=\"host_click(this, '" . $i . "')\"" .
|
||||
" type=\"checkbox\" name=\"" . $i . "\"></td>";
|
||||
}
|
||||
echo (" <td align='center'><a href=\"../account/edit.php?type=host&DN='" . $info[$i]["dn"] . "'\">" . _("Edit") . "</a></td>");
|
||||
echo (" <td align='center'><a href=\"../account/edit.php?type=host&DN='" . $i . "'\">" . _("Edit") . "</a></td>");
|
||||
for ($k = 0; $k < sizeof($attr_array); $k++) {
|
||||
echo ("<td>");
|
||||
// print all attribute entries seperated by "; "
|
||||
|
|
|
@ -169,7 +169,10 @@ $filter = listBuildFilter($_POST, $attr_array);
|
|||
$info = listFilterAccounts($info, $filter);
|
||||
if (sizeof($info) == 0) StatusMessage("WARN", "", _("No users found!"));
|
||||
// sort rows by sort column ($sort)
|
||||
if ($info) $info = listSort($sort, $attr_array, $info);
|
||||
if ($info) {
|
||||
$info = listSort($sort, $attr_array, $info);
|
||||
$_SESSION[$scope . 'info'] = $info;
|
||||
}
|
||||
|
||||
// build filter URL
|
||||
$searchFilter = array();
|
||||
|
@ -216,24 +219,25 @@ if ($user_count != 0) {
|
|||
// resort if needed
|
||||
if ($sort == "gidnumber") {
|
||||
$info = listSort($sort, $attr_array, $info);
|
||||
$_SESSION[$scope . 'info'] = $info;
|
||||
}
|
||||
}
|
||||
// print user list
|
||||
for ($i = $table_begin; $i < $table_end; $i++) { // ignore last entry in array which is "count"
|
||||
echo("<tr class=\"userlist\"\nonMouseOver=\"user_over(this, '" . $info[$i]["dn"] . "')\"\n" .
|
||||
"onMouseOut=\"user_out(this, '" . $info[$i]["dn"] . "')\"\n" .
|
||||
"onClick=\"user_click(this, '" . $info[$i]["dn"] . "')\"\n" .
|
||||
"onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=user&DN=" . $info[$i]["dn"] . "'\">\n");
|
||||
for ($i = $table_begin; $i < $table_end; $i++) {
|
||||
echo("<tr class=\"userlist\"\nonMouseOver=\"user_over(this, '" . $i . "')\"\n" .
|
||||
"onMouseOut=\"user_out(this, '" . $i . "')\"\n" .
|
||||
"onClick=\"user_click(this, '" . $i . "')\"\n" .
|
||||
"onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=user&DN=" . $i . "'\">\n");
|
||||
// checkboxes if selectall = "yes"
|
||||
if ($_GET['selectall'] == "yes") {
|
||||
echo "<td height=22 align=\"center\">\n<input onClick=\"user_click(this, '" . $info[$i]["dn"] . "')\" type=\"checkbox\" name=\"" .
|
||||
$info[$i]["dn"] . "\" checked>\n</td>\n";
|
||||
echo "<td height=22 align=\"center\">\n<input onClick=\"user_click(this, '" . $i . "')\" type=\"checkbox\" name=\"" .
|
||||
$i . "\" checked>\n</td>\n";
|
||||
}
|
||||
else {
|
||||
echo "<td height=22 align=\"center\">\n<input onClick=\"user_click(this, '" . $info[$i]["dn"] . "')\" type=\"checkbox\" name=\"" .
|
||||
$info[$i]["dn"] . "\">\n</td>\n";
|
||||
echo "<td height=22 align=\"center\">\n<input onClick=\"user_click(this, '" . $i . "')\" type=\"checkbox\" name=\"" .
|
||||
$i . "\">\n</td>\n";
|
||||
}
|
||||
echo ("<td align='center'>\n<a href=\"../account/edit.php?type=user&DN='" . $info[$i]["dn"] . "'\">" .
|
||||
echo ("<td align='center'>\n<a href=\"../account/edit.php?type=user&DN='" . $i . "'\">" .
|
||||
_("Edit") . "</a>\n</td>\n");
|
||||
for ($k = 0; $k < sizeof($attr_array); $k++) {
|
||||
echo ("<td>\n");
|
||||
|
|
Loading…
Reference in New Issue