parent
4337a1c795
commit
80802d631b
|
@ -65,7 +65,10 @@ if ($_POST['new_group'] || $_POST['del_group'] || $_POST['pdf_group'] || $_POST[
|
||||||
for ($i = 0; $i < sizeof($hosts); $i++) {
|
for ($i = 0; $i < sizeof($hosts); $i++) {
|
||||||
$list[$i] = loadgroup($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
|
// PDF for all groups
|
||||||
elseif ($_POST['pdf_all']){
|
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++) {
|
for ($i = 0; $i < sizeof($_SESSION['grp_info']); $i++) {
|
||||||
$list[$i] = loadgroup($_SESSION['grp_info'][$i]['dn']);
|
$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;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -300,7 +306,6 @@ if (sizeof($grp_units) > 1) {
|
||||||
echo ("<p> </p>\n");
|
echo ("<p> </p>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
echo ("<p align=\"left\">\n");
|
|
||||||
echo ("<input type=\"submit\" name=\"new_group\" value=\"" . _("New Group") . "\">\n");
|
echo ("<input type=\"submit\" name=\"new_group\" value=\"" . _("New Group") . "\">\n");
|
||||||
if (sizeof($grp_info) > 0) {
|
if (sizeof($grp_info) > 0) {
|
||||||
echo ("<input type=\"submit\" name=\"del_group\" value=\"" . _("Delete Group(s)") . "\">\n");
|
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 ("<input type=\"submit\" name=\"pdf_all\" value=\"" . _("Create PDF for all groups") . "\">\n");
|
||||||
echo "</fieldset>";
|
echo "</fieldset>";
|
||||||
}
|
}
|
||||||
echo ("</p>\n");
|
|
||||||
|
|
||||||
echo ("</form>\n");
|
echo ("</form>\n");
|
||||||
echo "</body></html>\n";
|
echo "</body></html>\n";
|
||||||
|
|
|
@ -291,7 +291,6 @@ echo ("<p> </p>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// add/delete/PDF buttons
|
// add/delete/PDF buttons
|
||||||
echo ("<p align=\"left\">\n");
|
|
||||||
echo ("<input type=\"submit\" name=\"new_host\" value=\"" . _("New Host") . "\">\n");
|
echo ("<input type=\"submit\" name=\"new_host\" value=\"" . _("New Host") . "\">\n");
|
||||||
if (sizeof($hst_info) > 0) {
|
if (sizeof($hst_info) > 0) {
|
||||||
echo ("<input type=\"submit\" name=\"del_host\" value=\"" . _("Delete Host(s)") . "\">\n");
|
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 ("<input type=\"submit\" name=\"pdf_all\" value=\"" . _("Create PDF for all hosts") . "\">\n");
|
||||||
echo "</fieldset>";
|
echo "</fieldset>";
|
||||||
}
|
}
|
||||||
echo ("</p>\n");
|
|
||||||
|
|
||||||
echo ("</form>\n");
|
echo ("</form>\n");
|
||||||
echo "</body></html>\n";
|
echo "</body></html>\n";
|
||||||
|
|
|
@ -91,9 +91,8 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
|
||||||
$list[$i]->smb_password = "";
|
$list[$i]->smb_password = "";
|
||||||
}
|
}
|
||||||
if (sizeof($list) > 0) {
|
if (sizeof($list) > 0) {
|
||||||
$list = quotas($list);
|
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
|
||||||
if ($list) createUserPDF($list);
|
createUserPDF($list);
|
||||||
else StatusMessage("ERROR", _("Unable to get quota information!"), "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// PDF for all users
|
// PDF for all users
|
||||||
|
@ -105,9 +104,8 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pd
|
||||||
$list[$i]->smb_password = "";
|
$list[$i]->smb_password = "";
|
||||||
}
|
}
|
||||||
if (sizeof($list) > 0) {
|
if (sizeof($list) > 0) {
|
||||||
$list = quotas($list);
|
if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list);
|
||||||
if ($list) createUserPDF($list);
|
createUserPDF($list);
|
||||||
else StatusMessage("ERROR", _("Unable to get quota information!"), "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit;
|
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
|
// save variables to session
|
||||||
$_SESSION['usr_units'] = $usr_units;
|
$_SESSION['usr_units'] = $usr_units;
|
||||||
$_SESSION['usr_suffix'] = $usr_suffix;
|
$_SESSION['usr_suffix'] = $usr_suffix;
|
||||||
|
|
Loading…
Reference in New Issue