26 require_once(
"../class/config.php");
28 if (!$admin->enabled) {
29 $msg->raise(
"ERROR",
"admin", _(
"This page is restricted to authorized staff"));
30 echo
$msg->msg_html_all();
34 "action" => array (
"post",
"string",
""),
35 "type" => array (
"post",
"string",
""),
36 "del_confirm" => array (
"post",
"string",
""),
40 if($action ==
"add") {
42 if($quota->addtype($type)) {
43 $msg->raise(
"INFO",
"admin", _(
"Account type").
" \"".htmlentities($type).
"\" "._(
"added"));
45 $msg->raise(
"ERROR",
"admin", _(
"Account type").
" \"".htmlentities($type).
"\" "._(
"could not be added"));
47 include(
"adm_defquotas.php");
48 }
else if($action ==
"delete") {
49 if($del_confirm ==
"y"){
51 if($quota->deltype($type)) {
52 $msg->raise(
"INFO",
"admin", _(
"Account type").
" \"".htmlentities($type).
"\" "._(
"deleted"));
54 $msg->raise(
"ERROR",
"admin", _(
"Account type").
" \"".htmlentities($type).
"\" "._(
"could not be deleted"));
57 include(
"adm_defquotas.php");
61 <h3><?php printf(_(
"Deleting quota %s"),$type); ?> : </h3>
63 <form action=
"adm_dodefquotas.php" method=
"post">
65 <input type=
"hidden" name=
"action" value=
"delete" />
66 <input type=
"hidden" name=
"type" value=
"<?php echo $type ?>" />
67 <input type=
"hidden" name=
"del_confirm" value=
"y" />
68 <p
class=
"alert alert-warning"><?php
__(
"WARNING: Confirm the deletion of the quota"); ?></p>
69 <p><?php echo $type; ?></p>
71 <input type=
"submit" class=
"inb ok" name=
"confirm" value=
"<?php __("Yes,
delete this default quota
"); ?>" />
72 <input type=
"button" class=
"inb cancel" name=
"cancel" value=
"<?php __("No, don
't delete this default quota"); ?>" onclick="document.location='adm_defquotas.php
';" />
78 } else if($action == "modify") {
81 foreach($_POST as $key => $val) {
85 list($type, $q) = explode(":", $key, 2);
86 $c[$type][$q] = abs(floatval($val));
89 if($quota->setdefaults($c)) {
90 $msg->raise("INFO", "admin", _("Default quotas successfully changed"));
92 $msg->raise("ERROR", "admin", _("Default quotas could not be set."));
94 include("adm_panel.php");
if(! $admin->enabled) $fields
Change the default quotas.
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...