root/alternc/trunk/bureau/admin/adm_defquotas.php

Revision 1801, 3.3 kB (checked in by franck, 2 years ago)

Utilise la liste des quotas dispo sur le serveurs et non ceux du compte, evite les problemes de mise a jour

Line 
1 <?php
2 /*
3  $Id: adm_defquotas.php,v 1.4 2006/01/24 05:03:30 joe Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2006 Le rĂ©seau Koumbit Inc.
7  http://koumbit.org/
8  Copyright (C) 2002 by the AlternC Development Team.
9  http://alternc.org/
10  ----------------------------------------------------------------------
11  Based on:
12  Valentin Lacambre's web hosting softwares: http://altern.org/
13  ----------------------------------------------------------------------
14  LICENSE
15
16  This program is free software; you can redistribute it and/or
17  modify it under the terms of the GNU General Public License (GPL)
18  as published by the Free Software Foundation; either version 2
19  of the License, or (at your option) any later version.
20
21  This program is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  GNU General Public License for more details.
25
26  To read the license please visit http://www.gnu.org/copyleft/gpl.html
27  ----------------------------------------------------------------------
28  Original Author of file: Benjamin Sonntag
29  Purpose of file: Manage the default quotas
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 include("head.php");
40 ?>
41 </head>
42 <body>
43 <h3><?php __("Change the default quotas"); ?></h3>
44 <?php
45     if ($error) {
46       echo "<p class=\"error\">$error</p>";
47     }
48
49 ?>
50 <p><form method="post" action="adm_dodefquotas.php">
51 <input type="hidden" name="action" value="add">
52 <input type="text" name="type" class="int"></td>
53 <input type="submit" class="inb" value="<?php __("Add account type"); ?>" />
54 </form></p>
55
56 <p><form method="post" action="adm_dodefquotas.php">
57 <input type="hidden" name="action" value="delete">
58 <select name="type" id="type" class="inl">
59 <?php
60 $db->query("SELECT distinct(type) FROM defquotas WHERE TYPE != 'default' ORDER by type");
61 while($db->next_record()) {
62   $type = $db->f("type");
63   echo "<option value=\"$type\">$type</option>";
64 }
65 ?></select>
66 <input type="submit" class="inb" value="<?php __("Delete account type"); ?>" />
67 </form></p>
68
69 <p>
70 <?php __("Here is the list of the quotas on the server for the new accounts. If you want to change them, enter new values"); ?>
71 </p>
72
73 <form method="post" action="adm_dodefquotas.php">
74 <input type="hidden" name="action" value="modify">
75 <?php
76 $col=1;
77 $qlist=$quota->getdefaults();
78 $aqlist = $quota->qlist();
79 reset($qlist);
80 foreach($qlist as $qname => $q)
81 {
82
83 ?>
84 <h4><?php echo _("Accounts of type"). " \"" . $qname . "\"" ?></h4>
85 <table border="0" cellpadding="4" cellspacing="0">
86 <tr><th><?php __("Quotas") ?></th><th><?php __("Default Value"); ?></th></tr>
87 <?php
88
89     foreach($aqlist as $aqtype => $aqname)
90     {
91         $key = $qname . ":" . $aqtype;
92         $col=3-$col;
93
94 ?>
95 <tr class="lst<?php echo $col; ?>">
96 <td><label for="<?php echo $key; ?>"><?php echo $aqname; ?></label></td>
97 <td><input type="text" class="int" size="16" maxlength="16" name="<?php echo $key; ?>" id="<?php echo $key; ?>" value="<?php echo $q[$aqtype]; ?>" /></td></tr>
98 <?php
99
100     }
101
102 ?>
103 </table>
104 <?php
105
106 }
107
108 ?>
109 <input type="submit" class="inb" value="<?php __("Edit the default quotas"); ?>" />
110 </form>
111
112 </body>
113 </html>
114
Note: See TracBrowser for help on using the browser.