no longer link to delete/PDF page if nothing selected

This commit is contained in:
Roland Gruber 2004-02-03 16:44:47 +00:00
parent 82130148de
commit 6ca7362406
8 changed files with 70 additions and 26 deletions

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber Copyright (C) 2003 - 2004 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -53,9 +53,11 @@ if ($_POST['new_domain'] || $_POST['del_domain']){
// search for checkboxes // search for checkboxes
$domains = array_keys($_POST, "on"); $domains = array_keys($_POST, "on");
$domainstr = implode(";", $domains); $domainstr = implode(";", $domains);
metaRefresh("../domain.php?action=delete&DN='$domainstr'"); if ($domainstr) {
metaRefresh("../domain.php?action=delete&DN='$domainstr'");
exit;
} }
exit; }
} }
echo $_SESSION['header']; echo $_SESSION['header'];

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber Copyright (C) 2003 - 2004 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -48,13 +48,17 @@ if ($_POST['new_group'] || $_POST['del_group'] || $_POST['pdf_group'] || $_POST[
// add new group // add new group
if ($_POST['new_group']){ if ($_POST['new_group']){
metaRefresh("../account/groupedit.php"); metaRefresh("../account/groupedit.php");
exit;
} }
// delete group(s) // delete group(s)
elseif ($_POST['del_group']){ elseif ($_POST['del_group']){
// search for checkboxes // search for checkboxes
$groups = array_keys($_POST, "on"); $groups = array_keys($_POST, "on");
$_SESSION['delete_dn'] = $groups; $_SESSION['delete_dn'] = $groups;
metaRefresh("../delete.php?type=group"); if (sizeof($groups) > 0) {
metaRefresh("../delete.php?type=group");
exit;
}
} }
// PDF for selected groups // PDF for selected groups
elseif ($_POST['pdf_group']){ elseif ($_POST['pdf_group']){
@ -68,6 +72,7 @@ if ($_POST['new_group'] || $_POST['del_group'] || $_POST['pdf_group'] || $_POST[
if (sizeof($list) > 0) { if (sizeof($list) > 0) {
createGroupPDF($list); createGroupPDF($list);
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
exit;
} }
} }
// PDF for all groups // PDF for all groups
@ -79,9 +84,9 @@ if ($_POST['new_group'] || $_POST['del_group'] || $_POST['pdf_group'] || $_POST[
if (sizeof($list) > 0) { if (sizeof($list) > 0) {
createGroupPDF($list); createGroupPDF($list);
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
exit;
} }
} }
exit;
} }
echo $_SESSION['header']; echo $_SESSION['header'];

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber Copyright (C) 2003 - 2004 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -48,14 +48,18 @@ if ($_POST['new_host'] || $_POST['del_host'] || $_POST['pdf_host'] || $_POST['pd
// add new host // add new host
if ($_POST['new_host']){ if ($_POST['new_host']){
metaRefresh("../account/hostedit.php"); metaRefresh("../account/hostedit.php");
exit;
} }
// delete host(s) // delete host(s)
elseif ($_POST['del_host']){ elseif ($_POST['del_host']){
// search for checkboxes // search for checkboxes
$hosts = array_keys($_POST, "on"); $hosts = array_keys($_POST, "on");
$_SESSION['delete_dn'] = $hosts; $_SESSION['delete_dn'] = $hosts;
metaRefresh("../delete.php?type=host"); if (sizeof($hosts) > 0) {
metaRefresh("../delete.php?type=host");
exit;
} }
}
// PDF for selected hosts // PDF for selected hosts
elseif ($_POST['pdf_host']){ elseif ($_POST['pdf_host']){
// search for checkboxes // search for checkboxes
@ -65,7 +69,10 @@ if ($_POST['new_host'] || $_POST['del_host'] || $_POST['pdf_host'] || $_POST['pd
for ($i = 0; $i < sizeof($hosts); $i++) { for ($i = 0; $i < sizeof($hosts); $i++) {
$list[$i] = loadhost($hosts[$i]); $list[$i] = loadhost($hosts[$i]);
} }
if (sizeof($list) > 0) createHostPDF($list); if (sizeof($list) > 0) {
createHostPDF($list);
exit;
}
} }
// PDF for all hosts // PDF for all hosts
elseif ($_POST['pdf_all']){ elseif ($_POST['pdf_all']){
@ -73,9 +80,11 @@ if ($_POST['new_host'] || $_POST['del_host'] || $_POST['pdf_host'] || $_POST['pd
for ($i = 0; $i < sizeof($_SESSION['hst_info']); $i++) { for ($i = 0; $i < sizeof($_SESSION['hst_info']); $i++) {
$list[$i] = loadhost($_SESSION['hst_info'][$i]['dn']); $list[$i] = loadhost($_SESSION['hst_info'][$i]['dn']);
} }
if (sizeof($list) > 0) createHostPDF($list); if (sizeof($list) > 0) {
createHostPDF($list);
exit;
}
} }
exit;
} }
echo $_SESSION['header']; echo $_SESSION['header'];

View File

@ -4,6 +4,7 @@ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber, Leonhard Walchshäusl Copyright (C) 2003 Roland Gruber, Leonhard Walchshäusl
Copyright (C) 2004 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -67,6 +68,7 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
// add new user // add new user
if ($_POST['new_user']){ if ($_POST['new_user']){
metaRefresh("../account/useredit.php?type=user"); metaRefresh("../account/useredit.php?type=user");
exit;
} }
// delete user(s) // delete user(s)
elseif ($_POST['del_user']){ elseif ($_POST['del_user']){
@ -75,7 +77,10 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
if (eregi("^uid=.*$", $entry)) $users[] = $entry; if (eregi("^uid=.*$", $entry)) $users[] = $entry;
} }
$_SESSION['delete_dn'] = $users; $_SESSION['delete_dn'] = $users;
metaRefresh("../delete.php?type=user"); if (sizeof($users) > 0) {
metaRefresh("../delete.php?type=user");
exit;
}
} }
// PDF for selected users // PDF for selected users
elseif ($_POST['pdf_user']){ elseif ($_POST['pdf_user']){
@ -93,6 +98,7 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
if (sizeof($list) > 0) { if (sizeof($list) > 0) {
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
createUserPDF($list); createUserPDF($list);
exit;
} }
} }
// PDF for all users // PDF for all users
@ -106,9 +112,9 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
if (sizeof($list) > 0) { if (sizeof($list) > 0) {
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
createUserPDF($list); createUserPDF($list);
exit;
} }
} }
exit;
} }
echo $_SESSION['header']; echo $_SESSION['header'];

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber Copyright (C) 2003 - 2004 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -53,9 +53,11 @@ if ($_POST['new_domain'] || $_POST['del_domain']){
// search for checkboxes // search for checkboxes
$domains = array_keys($_POST, "on"); $domains = array_keys($_POST, "on");
$domainstr = implode(";", $domains); $domainstr = implode(";", $domains);
metaRefresh("../domain.php?action=delete&amp;DN='$domainstr'"); if ($domainstr) {
metaRefresh("../domain.php?action=delete&amp;DN='$domainstr'");
exit;
} }
exit; }
} }
echo $_SESSION['header']; echo $_SESSION['header'];

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber Copyright (C) 2003 - 2004 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -48,13 +48,17 @@ if ($_POST['new_group'] || $_POST['del_group'] || $_POST['pdf_group'] || $_POST[
// add new group // add new group
if ($_POST['new_group']){ if ($_POST['new_group']){
metaRefresh("../account/groupedit.php"); metaRefresh("../account/groupedit.php");
exit;
} }
// delete group(s) // delete group(s)
elseif ($_POST['del_group']){ elseif ($_POST['del_group']){
// search for checkboxes // search for checkboxes
$groups = array_keys($_POST, "on"); $groups = array_keys($_POST, "on");
$_SESSION['delete_dn'] = $groups; $_SESSION['delete_dn'] = $groups;
metaRefresh("../delete.php?type=group"); if (sizeof($groups) > 0) {
metaRefresh("../delete.php?type=group");
exit;
}
} }
// PDF for selected groups // PDF for selected groups
elseif ($_POST['pdf_group']){ elseif ($_POST['pdf_group']){
@ -68,6 +72,7 @@ if ($_POST['new_group'] || $_POST['del_group'] || $_POST['pdf_group'] || $_POST[
if (sizeof($list) > 0) { if (sizeof($list) > 0) {
createGroupPDF($list); createGroupPDF($list);
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
exit;
} }
} }
// PDF for all groups // PDF for all groups
@ -79,9 +84,9 @@ if ($_POST['new_group'] || $_POST['del_group'] || $_POST['pdf_group'] || $_POST[
if (sizeof($list) > 0) { if (sizeof($list) > 0) {
createGroupPDF($list); createGroupPDF($list);
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
exit;
} }
} }
exit;
} }
echo $_SESSION['header']; echo $_SESSION['header'];

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber Copyright (C) 2003 - 2004 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -48,14 +48,18 @@ if ($_POST['new_host'] || $_POST['del_host'] || $_POST['pdf_host'] || $_POST['pd
// add new host // add new host
if ($_POST['new_host']){ if ($_POST['new_host']){
metaRefresh("../account/hostedit.php"); metaRefresh("../account/hostedit.php");
exit;
} }
// delete host(s) // delete host(s)
elseif ($_POST['del_host']){ elseif ($_POST['del_host']){
// search for checkboxes // search for checkboxes
$hosts = array_keys($_POST, "on"); $hosts = array_keys($_POST, "on");
$_SESSION['delete_dn'] = $hosts; $_SESSION['delete_dn'] = $hosts;
metaRefresh("../delete.php?type=host"); if (sizeof($hosts) > 0) {
metaRefresh("../delete.php?type=host");
exit;
} }
}
// PDF for selected hosts // PDF for selected hosts
elseif ($_POST['pdf_host']){ elseif ($_POST['pdf_host']){
// search for checkboxes // search for checkboxes
@ -65,7 +69,10 @@ if ($_POST['new_host'] || $_POST['del_host'] || $_POST['pdf_host'] || $_POST['pd
for ($i = 0; $i < sizeof($hosts); $i++) { for ($i = 0; $i < sizeof($hosts); $i++) {
$list[$i] = loadhost($hosts[$i]); $list[$i] = loadhost($hosts[$i]);
} }
if (sizeof($list) > 0) createHostPDF($list); if (sizeof($list) > 0) {
createHostPDF($list);
exit;
}
} }
// PDF for all hosts // PDF for all hosts
elseif ($_POST['pdf_all']){ elseif ($_POST['pdf_all']){
@ -73,9 +80,11 @@ if ($_POST['new_host'] || $_POST['del_host'] || $_POST['pdf_host'] || $_POST['pd
for ($i = 0; $i < sizeof($_SESSION['hst_info']); $i++) { for ($i = 0; $i < sizeof($_SESSION['hst_info']); $i++) {
$list[$i] = loadhost($_SESSION['hst_info'][$i]['dn']); $list[$i] = loadhost($_SESSION['hst_info'][$i]['dn']);
} }
if (sizeof($list) > 0) createHostPDF($list); if (sizeof($list) > 0) {
createHostPDF($list);
exit;
}
} }
exit;
} }
echo $_SESSION['header']; echo $_SESSION['header'];

View File

@ -4,6 +4,7 @@ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber, Leonhard Walchshäusl Copyright (C) 2003 Roland Gruber, Leonhard Walchshäusl
Copyright (C) 2004 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -67,6 +68,7 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
// add new user // add new user
if ($_POST['new_user']){ if ($_POST['new_user']){
metaRefresh("../account/useredit.php?type=user"); metaRefresh("../account/useredit.php?type=user");
exit;
} }
// delete user(s) // delete user(s)
elseif ($_POST['del_user']){ elseif ($_POST['del_user']){
@ -75,7 +77,10 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
if (eregi("^uid=.*$", $entry)) $users[] = $entry; if (eregi("^uid=.*$", $entry)) $users[] = $entry;
} }
$_SESSION['delete_dn'] = $users; $_SESSION['delete_dn'] = $users;
metaRefresh("../delete.php?type=user"); if (sizeof($users) > 0) {
metaRefresh("../delete.php?type=user");
exit;
}
} }
// PDF for selected users // PDF for selected users
elseif ($_POST['pdf_user']){ elseif ($_POST['pdf_user']){
@ -93,6 +98,7 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
if (sizeof($list) > 0) { if (sizeof($list) > 0) {
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
createUserPDF($list); createUserPDF($list);
exit;
} }
} }
// PDF for all users // PDF for all users
@ -106,9 +112,9 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
if (sizeof($list) > 0) { if (sizeof($list) > 0) {
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
createUserPDF($list); createUserPDF($list);
exit;
} }
} }
exit;
} }
echo $_SESSION['header']; echo $_SESSION['header'];