added quota to PDF,

fixed HTML errors
This commit is contained in:
Roland Gruber 2003-11-08 20:26:28 +00:00
parent 4337a1c795
commit 80802d631b
3 changed files with 12 additions and 30 deletions

View File

@ -65,7 +65,10 @@ if ($_POST['new_group'] || $_POST['del_group'] || $_POST['pdf_group'] || $_POST[
for ($i = 0; $i < sizeof($hosts); $i++) {
$list[$i] = loadgroup($hosts[$i]);
}
if (sizeof($list) > 0) createGroupPDF($list);
if (sizeof($list) > 0) {
createGroupPDF($list);
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
}
}
// PDF for all groups
elseif ($_POST['pdf_all']){
@ -73,7 +76,10 @@ if ($_POST['new_group'] || $_POST['del_group'] || $_POST['pdf_group'] || $_POST[
for ($i = 0; $i < sizeof($_SESSION['grp_info']); $i++) {
$list[$i] = loadgroup($_SESSION['grp_info'][$i]['dn']);
}
if (sizeof($list) > 0) createGroupPDF($list);
if (sizeof($list) > 0) {
createGroupPDF($list);
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
}
}
exit;
}
@ -300,7 +306,6 @@ if (sizeof($grp_units) > 1) {
echo ("<p>&nbsp;</p>\n");
}
echo ("<p align=\"left\">\n");
echo ("<input type=\"submit\" name=\"new_group\" value=\"" . _("New Group") . "\">\n");
if (sizeof($grp_info) > 0) {
echo ("<input type=\"submit\" name=\"del_group\" value=\"" . _("Delete Group(s)") . "\">\n");
@ -311,7 +316,6 @@ if (sizeof($grp_info) > 0) {
echo ("<input type=\"submit\" name=\"pdf_all\" value=\"" . _("Create PDF for all groups") . "\">\n");
echo "</fieldset>";
}
echo ("</p>\n");
echo ("</form>\n");
echo "</body></html>\n";

View File

@ -291,7 +291,6 @@ echo ("<p>&nbsp;</p>\n");
}
// add/delete/PDF buttons
echo ("<p align=\"left\">\n");
echo ("<input type=\"submit\" name=\"new_host\" value=\"" . _("New Host") . "\">\n");
if (sizeof($hst_info) > 0) {
echo ("<input type=\"submit\" name=\"del_host\" value=\"" . _("Delete Host(s)") . "\">\n");
@ -302,7 +301,6 @@ if (sizeof($hst_info) > 0) {
echo ("<input type=\"submit\" name=\"pdf_all\" value=\"" . _("Create PDF for all hosts") . "\">\n");
echo "</fieldset>";
}
echo ("</p>\n");
echo ("</form>\n");
echo "</body></html>\n";

View File

@ -91,9 +91,8 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
$list[$i]->smb_password = "";
}
if (sizeof($list) > 0) {
$list = quotas($list);
if ($list) createUserPDF($list);
else StatusMessage("ERROR", _("Unable to get quota information!"), "");
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
createUserPDF($list);
}
}
// PDF for all users
@ -105,9 +104,8 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
$list[$i]->smb_password = "";
}
if (sizeof($list) > 0) {
$list = quotas($list);
if ($list) createUserPDF($list);
else StatusMessage("ERROR", _("Unable to get quota information!"), "");
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
createUserPDF($list);
}
}
exit;
@ -443,24 +441,6 @@ function cmp_array($a, $b) {
}
}
// takes an array of account and fill the accounts with quota information
function quotas($list) {
if (! is_array($list)) return false;
for ($i = 0; $i < sizeof($list); $i++) {
$usernames[] = $list[$i]->general_username;
}
$data = getquotas("user", $usernames);
if (sizeof($data) != sizeof($list)) {
return false;
}
for ($i = 0; $i < sizeof($data); $i++) {
$ret[$i] = $list[$i];
$ret[$i]->quota = $data[$i]->quota;
}
return $ret;
}
// save variables to session
$_SESSION['usr_units'] = $usr_units;
$_SESSION['usr_suffix'] = $usr_suffix;