Alternc  latest
Alternc logiel libre pour l'hébergement
adm_quotaedit.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Show the form used to update users' quotas
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 include_once("head.php");
28 
29 if (!$admin->enabled) {
30  $msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
31  echo $msg->msg_html_all();
32  include_once("foot.php");
33  exit();
34 }
35 
36 $fields = array (
37  "uid" => array ("request", "integer", 0),
38 );
40 
41 $us=$admin->get($uid);
42 
43 $mem->su($uid);
44 $r=$quota->getquota();
45 $mem->unsu();
46 
47 ?>
48 <h3><?php __("Editing the quotas of a member"); ?></h3>
49 <hr id="topbar"/>
50 <br />
51 <?php
52 echo $msg->msg_html_all();
53 ?>
54 <form method="post" action="adm_quotadoedit.php">
55  <?php csrf_get(); ?>
56 <table class="tedit">
57 <tr><th><input type="hidden" name="uid" value="<?php ehe($uid); ?>" />
58 <?php __("Username"); ?></th><td colspan="3"><code><big><?php ehe($us["login"]); ?></big></code>&nbsp;</td></tr>
59 <tr><th><?php __("Quota"); ?></th><th style="text-align: right"><?php __("Total"); ?></th><th><?php __("Used"); ?></th></tr>
60 <?php
61 $ql=$quota->qlist();
62 reset($ql);
63 while (list($key,$val)=each($ql)) {
64  if (!isset($r[$key])) continue;
65  echo "<tr>";
66  echo "<td>";
67  if ($r[$key]["t"]==$r[$key]["u"] && $r[$key]["u"]) echo "<span style=\"color: red;\">";
68  echo "<label for=\"q_$key\">" . $val . "</label>";
69  if ($r[$key]["t"]==$r[$key]["u"] && $r[$key]["u"]) echo "</span>";
70  echo "</td>";
71  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>";
72  echo "<td align=\"right\"><code><label for=\"q_$key\">".$r[$key]["u"]."</label></code>&nbsp;</td>";
73  echo "</tr>";
74 }
75 ?>
76 <tr class="trbtn"><td colspan="3">
77  <input class="inb ok" type="submit" name="submit" value="<?php __("Edit the quotas"); ?>" />
78  <input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'" />
79 
80 </td></tr>
81 </table>
82 </form>
83 <?php include_once("foot.php"); ?>
exit
Definition: adm_doadd.php:70
if(! $admin->enabled) $fields
Show the form used to update users' quotas.
$mem
Definition: bootstrap.php:71
$msg
Definition: bootstrap.php:75
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
Definition: functions.php:647
__($str)
Definition: functions.php:404
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
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 ...
Definition: functions.php:1159
$uid
$val
Definition: tempovars.php:15
if(empty($_POST['key'])||empty($_POST['val'])) $key
Definition: tempovars.php:14