2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
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
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
*/
|
2017-10-12 15:54:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Administrator page to manage default quotas for users
|
|
|
|
*
|
|
|
|
* @copyright AlternC-Team 2000-2017 https://alternc.com/
|
|
|
|
*/
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
require_once("../class/config.php");
|
|
|
|
|
|
|
|
if (!$admin->enabled) {
|
2017-10-06 16:04:36 +00:00
|
|
|
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
|
2017-08-15 15:03:56 +00:00
|
|
|
echo $msg->msg_html_all();
|
2006-04-26 12:28:53 +00:00
|
|
|
exit();
|
|
|
|
}
|
2012-10-16 09:21:00 +00:00
|
|
|
$fields = array (
|
|
|
|
"synchronise" => array ("get", "integer", "0"),
|
|
|
|
);
|
|
|
|
getFields($fields);
|
2006-04-26 12:28:53 +00:00
|
|
|
|
2009-09-08 05:29:38 +00:00
|
|
|
include_once ("head.php");
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
|
|
|
<h3><?php __("Change the default quotas"); ?></h3>
|
2010-06-02 22:42:03 +00:00
|
|
|
<hr id="topbar"/>
|
|
|
|
<br />
|
2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
2012-10-16 09:21:00 +00:00
|
|
|
if ($synchronise==true) {
|
|
|
|
$quota->synchronise_user_profile();
|
2013-10-18 09:59:03 +00:00
|
|
|
echo "<p class=\"alert alert-info\">";__("User's quotas synchronised");echo "</p>";
|
2012-10-16 09:21:00 +00:00
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
2012-10-16 15:12:54 +00:00
|
|
|
$quota->create_missing_quota_profile();
|
|
|
|
|
2017-08-15 15:03:56 +00:00
|
|
|
echo $msg->msg_html_all();
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
2009-09-08 05:29:38 +00:00
|
|
|
<form method="post" action="adm_dodefquotas.php">
|
2016-05-20 12:21:47 +00:00
|
|
|
<?php csrf_get(); ?>
|
2009-09-08 05:29:38 +00:00
|
|
|
<p>
|
|
|
|
<input type="hidden" name="action" value="add" />
|
|
|
|
<input type="text" name="type" class="int" />
|
2006-04-26 12:28:53 +00:00
|
|
|
<input type="submit" class="inb" value="<?php __("Add account type"); ?>" />
|
2009-09-08 05:29:38 +00:00
|
|
|
</p>
|
|
|
|
</form>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
2012-06-20 09:56:25 +00:00
|
|
|
<?php
|
|
|
|
?>
|
2009-09-08 05:29:38 +00:00
|
|
|
<form method="post" action="adm_dodefquotas.php">
|
2016-05-20 12:21:47 +00:00
|
|
|
<?php csrf_get(); ?>
|
2012-06-20 09:56:25 +00:00
|
|
|
<table border="0" cellpadding="4" cellspacing="0">
|
2013-05-23 16:18:56 +00:00
|
|
|
<tr class="lst">
|
2012-06-20 09:56:25 +00:00
|
|
|
<td>
|
2013-04-23 23:32:55 +00:00
|
|
|
<input type="hidden" name="action" value="delete" />
|
2006-05-03 15:43:36 +00:00
|
|
|
<select name="type" id="type" class="inl">
|
2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
2012-08-22 09:46:56 +00:00
|
|
|
foreach($quota->listtype() as $type) {
|
|
|
|
if ($type=="default") continue;
|
2012-06-20 09:56:25 +00:00
|
|
|
echo "<option value=\"$type\">$type</option>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
|
|
|
?></select>
|
2012-06-20 09:56:25 +00:00
|
|
|
</td><td><input type="submit" class="inb" value="<?php __("Delete account type"); ?>" /></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2009-09-08 05:29:38 +00:00
|
|
|
</form>
|
2006-04-26 12:28:53 +00:00
|
|
|
<p>
|
|
|
|
<?php __("Here is the list of the quotas on the server for the new accounts. If you want to change them, enter new values"); ?>
|
|
|
|
</p>
|
2012-10-16 11:58:36 +00:00
|
|
|
<span class="inb"><a href="adm_defquotas.php?synchronise=1"><?php __("Synchronise user's quota (only to upper value)"); ?></a></span>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
|
|
<form method="post" action="adm_dodefquotas.php">
|
2016-05-20 12:21:47 +00:00
|
|
|
<?php csrf_get(); ?>
|
2009-09-08 05:29:38 +00:00
|
|
|
<div>
|
|
|
|
<input type="hidden" name="action" value="modify" />
|
2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
2009-09-08 05:29:38 +00:00
|
|
|
$qarray=$quota->qlist();
|
2006-04-26 12:28:53 +00:00
|
|
|
$qlist=$quota->getdefaults();
|
|
|
|
reset($qlist);
|
2009-09-08 05:29:38 +00:00
|
|
|
foreach($qlist as $type => $q) {
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
2013-12-11 14:53:24 +00:00
|
|
|
<div class="info-toggle">
|
|
|
|
<h4 class="toggle-next"><?php echo _("Accounts of type"). " \"$type\"" ?>▼</h4>
|
|
|
|
<div class="info-hide" id="div-quot-<?php echo md5($type);?>">
|
2013-02-04 08:42:06 +00:00
|
|
|
<table border="0" cellpadding="4" cellspacing="0" class='tlist'>
|
2006-04-26 12:28:53 +00:00
|
|
|
<tr><th><?php __("Quotas") ?></th><th><?php __("Default Value"); ?></th></tr>
|
|
|
|
<?php
|
2009-09-08 05:29:38 +00:00
|
|
|
foreach($q as $name => $value) {
|
2012-08-29 13:18:27 +00:00
|
|
|
if (!isset($qarray[$name])) continue;
|
2009-09-08 05:29:38 +00:00
|
|
|
$key = $type . ":" . $name;
|
2007-04-19 08:27:47 +00:00
|
|
|
?>
|
2009-09-08 05:29:38 +00:00
|
|
|
|
2013-05-23 16:18:56 +00:00
|
|
|
<tr class="lst">
|
2012-08-29 13:18:27 +00:00
|
|
|
<td><label for="<?php echo $key; ?>"><?php echo $qarray[$name] ; ?></label></td>
|
2016-05-22 18:14:26 +00:00
|
|
|
<td><input type="text" class="int" size="16" maxlength="16" name="<?php ehe($key); ?>" id="<?php ehe($key); ?>" value="<?php ehe($value); ?>" /></td></tr>
|
2012-06-19 15:26:48 +00:00
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
2013-12-11 14:53:24 +00:00
|
|
|
} //foreach
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
|
|
|
</table>
|
2013-12-11 14:53:24 +00:00
|
|
|
<br/>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$("#div-quot-<?php echo md5($type);?>").toggle();
|
|
|
|
</script>
|
2009-09-08 05:29:38 +00:00
|
|
|
</div>
|
2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2013-02-04 08:42:06 +00:00
|
|
|
<br/>
|
2013-10-18 13:40:34 +00:00
|
|
|
<input type="submit" class="inb ok" value="<?php __("Edit the default quotas"); ?>" />
|
2009-09-08 05:29:38 +00:00
|
|
|
</div>
|
2006-04-26 12:28:53 +00:00
|
|
|
</form>
|
2013-12-11 14:53:24 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function(){
|
|
|
|
$(".toggle-next").on("click",function(){
|
|
|
|
var next = $(this).next();
|
|
|
|
next.toggle();
|
|
|
|
})
|
|
|
|
});
|
|
|
|
</script>
|
2009-09-08 05:29:38 +00:00
|
|
|
<?php include_once("foot.php"); ?>
|