| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
require_once("../class/config.php"); |
|---|
| 33 |
|
|---|
| 34 |
if (!$admin->enabled) { |
|---|
| 35 |
__("This page is restricted to authorized staff"); |
|---|
| 36 |
exit(); |
|---|
| 37 |
} |
|---|
| 38 |
|
|---|
| 39 |
if($_POST["action"] == "add") { |
|---|
| 40 |
$type = $_POST['type']; |
|---|
| 41 |
|
|---|
| 42 |
if($quota->addtype($type)) { |
|---|
| 43 |
$error=_("Account type"). " \"$type\" "._("added"); |
|---|
| 44 |
} else { |
|---|
| 45 |
$error=_("Account type"). " \"$type\" "._("could not be added"); |
|---|
| 46 |
} |
|---|
| 47 |
include("adm_defquotas.php"); |
|---|
| 48 |
} else if($_POST["action"] == "delete") { |
|---|
| 49 |
if($_POST["del_confirm"] == "y"){ |
|---|
| 50 |
if($_POST['type']) { |
|---|
| 51 |
if($quota->deltype($_POST['type'])) { |
|---|
| 52 |
$error=_("Account type"). " \"$type\" "._("deleted"); |
|---|
| 53 |
} else { |
|---|
| 54 |
$error=_("Account type"). " \"$type\" "._("could not be deleted"); |
|---|
| 55 |
} |
|---|
| 56 |
} |
|---|
| 57 |
include("adm_defquotas.php"); |
|---|
| 58 |
}else{ |
|---|
| 59 |
include("head.php"); |
|---|
| 60 |
?> |
|---|
| 61 |
</head> |
|---|
| 62 |
<body> |
|---|
| 63 |
<h3><?php printf(_("Deleting quota %s"),$_POST["type"]); ?> : </h3> |
|---|
| 64 |
|
|---|
| 65 |
<form action="adm_dodefquotas.php" method="post"> |
|---|
| 66 |
<input type="hidden" name="action" value="delete" /> |
|---|
| 67 |
<input type="hidden" name="type" value="<?php echo $_POST["type"] ?>" /> |
|---|
| 68 |
<input type="hidden" name="del_confirm" value="y" /> |
|---|
| 69 |
<p class="error"><?php __("WARNING : Confirm the deletion of the quota"); ?></p> |
|---|
| 70 |
<p><?php echo $_POST["type"]; ?></p> |
|---|
| 71 |
<blockquote> |
|---|
| 72 |
<input type="submit" class="inb" name="confirm" value="<?php __("Yes"); ?>" /> |
|---|
| 73 |
<input type="button" class="inb" name="cancel" value="<?php __("No"); ?>" onclick="document.location='adm_defquotas.php';" /> |
|---|
| 74 |
</blockquote> |
|---|
| 75 |
</form> |
|---|
| 76 |
</body> |
|---|
| 77 |
</html> |
|---|
| 78 |
<?php |
|---|
| 79 |
} |
|---|
| 80 |
} else if($_POST["action"] == "modify") { |
|---|
| 81 |
reset($_POST); |
|---|
| 82 |
$c=array(); |
|---|
| 83 |
foreach($_POST as $key => $val) { |
|---|
| 84 |
if($key == "action") |
|---|
| 85 |
continue; |
|---|
| 86 |
|
|---|
| 87 |
list($type, $q) = explode(":", $key, 2); |
|---|
| 88 |
$c[$type][$q] = abs(intval($val)); |
|---|
| 89 |
} |
|---|
| 90 |
|
|---|
| 91 |
if($quota->setdefaults($c)) { |
|---|
| 92 |
$error=_("Default quotas successfully changed"); |
|---|
| 93 |
} else { |
|---|
| 94 |
$error=_("Default quotas could not be set."); |
|---|
| 95 |
} |
|---|
| 96 |
include("adm_panel.php"); |
|---|
| 97 |
} |
|---|
| 98 |
?> |
|---|
| 99 |
|
|---|