fixed checkbox names so they fit to $info from session

This commit is contained in:
Roland Gruber 2005-04-15 11:28:24 +00:00
parent a0607974bf
commit de019cd773
3 changed files with 33 additions and 27 deletions

View File

@ -108,6 +108,8 @@ if ($refresh) {
ldap_free_result($sr); ldap_free_result($sr);
// delete first array entry which is "count" // delete first array entry which is "count"
unset($info['count']); unset($info['count']);
// save position in original $info
for ($i = 0; $i < sizeof($info); $i++) $info[$i]['LAM_ID'] = $i;
// save results // save results
$_SESSION[$scope . 'info'] = $info; $_SESSION[$scope . 'info'] = $info;
} }
@ -158,19 +160,19 @@ else $table_end = ($page * $max_page_entries);
if (sizeof($info) > 0) { if (sizeof($info) > 0) {
// print group list // print group list
for ($i = $table_begin; $i < $table_end; $i++) { for ($i = $table_begin; $i < $table_end; $i++) {
echo("<tr class=\"grouplist\" onMouseOver=\"list_over(this, '" . $i . "', '" . $scope . "')\"" . echo("<tr class=\"grouplist\" onMouseOver=\"list_over(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"\n" .
" onMouseOut=\"list_out(this, '" . $i . "', '" . $scope . "')\"" . " onMouseOut=\"list_out(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"\n" .
" onClick=\"list_click(this, '" . $i . "', '" . $scope . "')\"" . " onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"\n" .
" onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=group&amp;DN=" . $info[$i]['dn'] . "'\">"); " onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=group&amp;DN=" . $info[$i]['dn'] . "'\">\n");
if (isset($_GET['selectall'])) { if (isset($_GET['selectall'])) {
echo " <td height=22 align=\"center\"><input onClick=\"list_click(this, '" . $i . "', '" . $scope . "')\" type=\"checkbox\"" . echo " <td height=22 align=\"center\"><input onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\" type=\"checkbox\"" .
" name=\"" . $i . "\" checked></td>"; " name=\"" . $info[$i]['LAM_ID'] . "\" checked></td>\n";
} }
else { else {
echo " <td height=22 align=\"center\"><input onClick=\"list_click(this, '" . $i . "', '" . $scope . "')\" type=\"checkbox\"" . echo " <td height=22 align=\"center\"><input onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\" type=\"checkbox\"" .
" name=\"" . $i . "\"></td>"; " name=\"" . $info[$i]['LAM_ID'] . "\"></td>\n";
} }
echo (" <td align='center'><a href=\"../account/edit.php?type=group&amp;DN='" . $info[$i]['dn'] . "'\">" . _("Edit") . "</a></td>"); echo (" <td align='center'><a href=\"../account/edit.php?type=group&amp;DN='" . $info[$i]['dn'] . "'\">" . _("Edit") . "</a></td>\n");
for ($k = 0; $k < sizeof($attr_array); $k++) { for ($k = 0; $k < sizeof($attr_array); $k++) {
echo ("<td>"); echo ("<td>");
// print all attribute entries seperated by "; " // print all attribute entries seperated by "; "
@ -201,7 +203,7 @@ if (sizeof($info) > 0) {
else echo $info[$i][strtolower($attr_array[$k])]; else echo $info[$i][strtolower($attr_array[$k])];
} }
} }
echo ("</td>"); echo ("</td>\n");
} }
echo("</tr>\n"); echo("</tr>\n");
} }

View File

@ -108,6 +108,8 @@ if ($refresh) {
ldap_free_result($sr); ldap_free_result($sr);
// delete first array entry which is "count" // delete first array entry which is "count"
unset($info['count']); unset($info['count']);
// save position in original $info
for ($i = 0; $i < sizeof($info); $i++) $info[$i]['LAM_ID'] = $i;
// save results // save results
$_SESSION[$scope . 'info'] = $info; $_SESSION[$scope . 'info'] = $info;
} }
@ -158,19 +160,19 @@ else $table_end = ($page * $max_page_entries);
if (sizeof($info) > 0) { if (sizeof($info) > 0) {
// print host list // print host list
for ($i = $table_begin; $i < $table_end; $i++) { for ($i = $table_begin; $i < $table_end; $i++) {
echo("<tr class=\"hostlist\" onMouseOver=\"list_over(this, '" . $i . "', '" . $scope . "')\"" . echo("<tr class=\"hostlist\" onMouseOver=\"list_over(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"\n" .
" onMouseOut=\"list_out(this, '" . $i . "', '" . $scope . "')\"" . " onMouseOut=\"list_out(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"\n" .
" onClick=\"list_click(this, '" . $i . "', '" . $scope . "')\"" . " onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"\n" .
" onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=host&amp;DN=" . $info[$i]['dn'] . "'\">"); " onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=host&amp;DN=" . $info[$i]['dn'] . "'\">\n");
if (isset($_GET['selectall'])) { if (isset($_GET['selectall'])) {
echo " <td height=22 align=\"center\"><input onClick=\"list_click(this, '" . $i . "', '" . $scope . "')\"" . echo " <td height=22 align=\"center\"><input onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"" .
" type=\"checkbox\" checked name=\"" . $i . "\"></td>"; " type=\"checkbox\" checked name=\"" . $info[$i]['LAM_ID'] . "\"></td>\n";
} }
else { else {
echo " <td height=22 align=\"center\"><input onClick=\"list_click(this, '" . $i . "', '" . $scope . "')\"" . echo " <td height=22 align=\"center\"><input onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"" .
" type=\"checkbox\" name=\"" . $i . "\"></td>"; " type=\"checkbox\" name=\"" . $info[$i]['LAM_ID'] . "\"></td>\n";
} }
echo (" <td align='center'><a href=\"../account/edit.php?type=host&amp;DN='" . $info[$i]['dn'] . "'\">" . _("Edit") . "</a></td>"); echo (" <td align='center'><a href=\"../account/edit.php?type=host&amp;DN='" . $info[$i]['dn'] . "'\">" . _("Edit") . "</a></td>\n");
for ($k = 0; $k < sizeof($attr_array); $k++) { for ($k = 0; $k < sizeof($attr_array); $k++) {
echo ("<td>"); echo ("<td>");
// print all attribute entries seperated by "; " // print all attribute entries seperated by "; "
@ -184,7 +186,7 @@ if (sizeof($info) > 0) {
} }
else echo $info[$i][strtolower($attr_array[$k])]; else echo $info[$i][strtolower($attr_array[$k])];
} }
echo ("</td>"); echo ("</td>\n");
} }
echo("</tr>\n"); echo("</tr>\n");
} }

View File

@ -135,6 +135,8 @@ if ($refresh) {
ldap_free_result ($sr); ldap_free_result ($sr);
// delete first array entry which is "count" // delete first array entry which is "count"
unset($info['count']); unset($info['count']);
// save position in original $info
for ($i = 0; $i < sizeof($info); $i++) $info[$i]['LAM_ID'] = $i;
// save results // save results
$_SESSION[$scope . 'info'] = $info; $_SESSION[$scope . 'info'] = $info;
} }
@ -202,18 +204,18 @@ if (sizeof($info) != 0) {
} }
// print user list // print user list
for ($i = $table_begin; $i < $table_end; $i++) { for ($i = $table_begin; $i < $table_end; $i++) {
echo("<tr class=\"userlist\"\nonMouseOver=\"list_over(this, '" . $i . "', '" . $scope . "')\"\n" . echo("<tr class=\"userlist\"\nonMouseOver=\"list_over(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"\n" .
"onMouseOut=\"list_out(this, '" . $i . "', '" . $scope . "')\"\n" . "onMouseOut=\"list_out(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"\n" .
"onClick=\"list_click(this, '" . $i . "', '" . $scope . "')\"\n" . "onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\"\n" .
"onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=user&amp;DN=" . $info[$i]['dn'] . "'\">\n"); "onDblClick=\"parent.frames[1].location.href='../account/edit.php?type=user&amp;DN=" . $info[$i]['dn'] . "'\">\n");
// checkboxes if selectall = "yes" // checkboxes if selectall = "yes"
if (isset($_GET['selectall'])) { if (isset($_GET['selectall'])) {
echo "<td height=22 align=\"center\">\n<input onClick=\"list_click(this, '" . $i . "', '" . $scope . "')\" type=\"checkbox\" name=\"" . echo "<td height=22 align=\"center\">\n<input onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\" type=\"checkbox\" name=\"" .
$i . "\" checked>\n</td>\n"; $info[$i]['LAM_ID'] . "\" checked>\n</td>\n";
} }
else { else {
echo "<td height=22 align=\"center\">\n<input onClick=\"list_click(this, '" . $i . "', '" . $scope . "')\" type=\"checkbox\" name=\"" . echo "<td height=22 align=\"center\">\n<input onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $scope . "')\" type=\"checkbox\" name=\"" .
$i . "\">\n</td>\n"; $info[$i]['LAM_ID'] . "\">\n</td>\n";
} }
echo ("<td align='center'>\n<a href=\"../account/edit.php?type=user&amp;DN='" . $info[$i]['dn'] . "'\">" . echo ("<td align='center'>\n<a href=\"../account/edit.php?type=user&amp;DN='" . $info[$i]['dn'] . "'\">" .
_("Edit") . "</a>\n</td>\n"); _("Edit") . "</a>\n</td>\n");