2006-04-26 12:28:53 +00:00
|
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
$Id: adm_dodefquotas.php,v 1.3 2006/01/24 05:03:30 joe Exp $
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
AlternC - Web Hosting System
|
|
|
|
|
Copyright (C) 2006 Le r<EFBFBD>seau Koumbit Inc.
|
|
|
|
|
http://koumbit.org/
|
|
|
|
|
Copyright (C) 2002 by the AlternC Development Team.
|
|
|
|
|
http://alternc.org/
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
Based on:
|
|
|
|
|
Valentin Lacambre's web hosting softwares: http://altern.org/
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
LICENSE
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License (GPL)
|
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
Original Author of file: Benjamin Sonntag
|
|
|
|
|
Purpose of file: Manage the default quotas
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
require_once("../class/config.php");
|
|
|
|
|
|
|
|
|
|
if (!$admin->enabled) {
|
|
|
|
|
__("This page is restricted to authorized staff");
|
|
|
|
|
exit();
|
|
|
|
|
}
|
2012-08-22 09:46:56 +00:00
|
|
|
|
$fields = array (
|
|
|
|
|
"action" => array ("post", "string", ""),
|
|
|
|
|
"type" => array ("post", "string", ""),
|
|
|
|
|
"del_confirm" => array ("post", "string", ""),
|
|
|
|
|
);
|
|
|
|
|
getFields($fields);
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
2012-08-22 09:46:56 +00:00
|
|
|
|
if($action == "add") {
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
|
|
|
|
if($quota->addtype($type)) {
|
2012-08-22 09:46:56 +00:00
|
|
|
|
$error=_("Account type"). " \"".htmlentities($type)."\" "._("added");
|
2006-04-26 12:28:53 +00:00
|
|
|
|
} else {
|
2012-08-22 09:46:56 +00:00
|
|
|
|
$error=_("Account type"). " \"".htmlentities($type)."\" "._("could not be added");
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
|
|
|
|
include("adm_defquotas.php");
|
2012-08-22 09:46:56 +00:00
|
|
|
|
} else if($action == "delete") {
|
|
|
|
|
if($del_confirm == "y"){
|
|
|
|
|
if(!empty($type)) {
|
|
|
|
|
if($quota->deltype($type)) {
|
|
|
|
|
$error=_("Account type"). " \"".htmlentities($type)."\" "._("deleted");
|
2006-06-29 08:52:20 +00:00
|
|
|
|
} else {
|
2012-08-22 09:46:56 +00:00
|
|
|
|
$error=_("Account type"). " \"".htmlentities($type)."\" "._("could not be deleted");
|
2006-06-29 08:52:20 +00:00
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
2006-06-29 08:52:20 +00:00
|
|
|
|
include("adm_defquotas.php");
|
|
|
|
|
}else{
|
|
|
|
|
include("head.php");
|
|
|
|
|
?>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
2012-08-22 09:46:56 +00:00
|
|
|
|
<h3><?php printf(_("Deleting quota %s"),$type); ?> : </h3>
|
2006-06-29 08:52:20 +00:00
|
|
|
|
|
|
|
|
|
<form action="adm_dodefquotas.php" method="post">
|
|
|
|
|
<input type="hidden" name="action" value="delete" />
|
2012-08-22 09:46:56 +00:00
|
|
|
|
<input type="hidden" name="type" value="<?php echo $type ?>" />
|
2006-06-29 08:52:20 +00:00
|
|
|
|
<input type="hidden" name="del_confirm" value="y" />
|
2013-02-08 14:09:40 +00:00
|
|
|
|
<p class="error"><?php __("WARNING: Confirm the deletion of the quota"); ?></p>
|
2012-08-22 09:55:34 +00:00
|
|
|
|
<p><?php echo $type; ?></p>
|
2006-06-29 08:52:20 +00:00
|
|
|
|
<blockquote>
|
|
|
|
|
<input type="submit" class="inb" name="confirm" value="<?php __("Yes"); ?>" />
|
|
|
|
|
<input type="button" class="inb" name="cancel" value="<?php __("No"); ?>" onclick="document.location='adm_defquotas.php';" />
|
|
|
|
|
</blockquote>
|
|
|
|
|
</form>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
<?php
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
2012-08-22 09:46:56 +00:00
|
|
|
|
} else if($action == "modify") {
|
2006-04-26 12:28:53 +00:00
|
|
|
|
reset($_POST);
|
|
|
|
|
$c=array();
|
|
|
|
|
foreach($_POST as $key => $val) {
|
|
|
|
|
if($key == "action")
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
list($type, $q) = explode(":", $key, 2);
|
2008-04-30 02:42:12 +00:00
|
|
|
|
$c[$type][$q] = abs(floatval($val));
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($quota->setdefaults($c)) {
|
|
|
|
|
$error=_("Default quotas successfully changed");
|
|
|
|
|
} else {
|
|
|
|
|
$error=_("Default quotas could not be set.");
|
|
|
|
|
}
|
|
|
|
|
include("adm_panel.php");
|
|
|
|
|
}
|
2006-06-29 08:52:20 +00:00
|
|
|
|
?>
|