2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
$Id: adm_quotaedit.php,v 1.4 2004/10/24 20:09:21 anonymous Exp $
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
AlternC - Web Hosting System
|
|
|
|
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: Show the form to edit the user's quota
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
require_once("../class/config.php");
|
2009-09-08 05:29:38 +00:00
|
|
|
include_once("head.php");
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
|
|
if (!$admin->enabled) {
|
|
|
|
__("This page is restricted to authorized staff");
|
2009-09-08 05:29:38 +00:00
|
|
|
include_once("foot.php");
|
2006-04-26 12:28:53 +00:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2009-09-08 05:29:38 +00:00
|
|
|
$fields = array (
|
|
|
|
"uid" => array ("request", "integer", 0),
|
|
|
|
);
|
|
|
|
getFields($fields);
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
if (!$us=$admin->get($uid)) {
|
|
|
|
$error=$err->errstr();
|
|
|
|
}
|
|
|
|
|
|
|
|
$mem->su($uid);
|
|
|
|
if (!$r=$quota->getquota()) {
|
|
|
|
$error=$err->errstr();
|
|
|
|
}
|
|
|
|
$mem->unsu();
|
2009-09-08 05:29:38 +00:00
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
|
|
|
<h3><?php __("Editing the quotas of a member"); ?></h3>
|
2010-06-02 22:20:39 +00:00
|
|
|
<hr id="topbar"/>
|
|
|
|
<br />
|
2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
2012-08-20 14:27:49 +00:00
|
|
|
if (isset($error) && $error) {
|
2013-10-18 09:59:03 +00:00
|
|
|
echo "<p class=\"alert alert-danger\">$error</p>";
|
2009-09-08 05:29:38 +00:00
|
|
|
include_once("foot.php");
|
2006-04-26 12:28:53 +00:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<form method="post" action="adm_quotadoedit.php">
|
2010-04-29 10:43:32 +00:00
|
|
|
<table class="tedit">
|
2006-04-26 12:28:53 +00:00
|
|
|
<tr><th><input type="hidden" name="uid" value="<?php echo $uid ?>" />
|
|
|
|
<?php __("Username"); ?></th><td colspan="3"><code><big><?php echo $us["login"]; ?></big></code> </td></tr>
|
2010-04-29 10:43:32 +00:00
|
|
|
<tr><th><?php __("Quota"); ?></th><th style="text-align: right"><?php __("Total"); ?></th><th><?php __("Used"); ?></th></tr>
|
2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
|
|
|
$ql=$quota->qlist();
|
|
|
|
reset($ql);
|
|
|
|
while (list($key,$val)=each($ql)) {
|
2012-08-23 14:25:04 +00:00
|
|
|
if (!isset($r[$key])) continue;
|
2006-04-26 12:28:53 +00:00
|
|
|
echo "<tr>";
|
|
|
|
echo "<td>";
|
2009-09-08 05:29:38 +00:00
|
|
|
if ($r[$key]["t"]==$r[$key]["u"] && $r[$key]["u"]) echo "<span style=\"color: red;\">";
|
2012-08-26 11:13:44 +00:00
|
|
|
echo "<label for=\"q_$key\">" . $val . "</label>";
|
2009-09-08 05:29:38 +00:00
|
|
|
if ($r[$key]["t"]==$r[$key]["u"] && $r[$key]["u"]) echo "</span>";
|
|
|
|
echo "</td>";
|
2010-09-01 18:53:08 +00:00
|
|
|
echo "<td align=\"center\"><input type=\"text\" class=\"int\" style=\"text-align: right\" size=\"10\" maxlength=\"20\" value=\"".$r[$key]["t"]."\" name=\"q_".$key."\" id=\"q_".$key."\" /></td>";
|
2006-04-26 12:28:53 +00:00
|
|
|
echo "<td align=\"right\"><code><label for=\"q_$key\">".$r[$key]["u"]."</label></code> </td>";
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
?>
|
2010-04-29 10:43:32 +00:00
|
|
|
<tr class="trbtn"><td colspan="3">
|
|
|
|
<input class="inb" type="submit" name="submit" value="<?php __("Edit the quotas"); ?>" />
|
|
|
|
<input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'" />
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
</td></tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
2009-09-08 05:29:38 +00:00
|
|
|
<?php include_once("foot.php"); ?>
|