Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
adm_defquotas.php
Go to the documentation of this file.
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 $fields = array (
39  "synchronise" => array ("get", "integer", "0"),
40 );
42 
43 include_once ("head.php");
44 
45 ?>
46 <h3><?php __("Change the default quotas"); ?></h3>
47 <hr id="topbar"/>
48 <br />
49 <?php
50 if ($synchronise==true) {
51  $quota->synchronise_user_profile();
52  echo "<p class=\"alert alert-info\">";__("User's quotas synchronised");echo "</p>";
53 }
54 
55 $quota->create_missing_quota_profile();
56 
57 if (isset($error) && $error) {
58  echo "<p class=\"alert alert-danger\">$error</p>";
59 }
60 ?>
61 <form method="post" action="adm_dodefquotas.php">
62 <p>
63 <input type="hidden" name="action" value="add" />
64 <input type="text" name="type" class="int" />
65 <input type="submit" class="inb" value="<?php __("Add account type"); ?>" />
66 </p>
67 </form>
68 
69 <?php
70 ?>
71 <form method="post" action="adm_dodefquotas.php">
72 <table border="0" cellpadding="4" cellspacing="0">
73 <tr class="lst">
74 <td>
75 <input type="hidden" name="action" value="delete" />
76 <select name="type" id="type" class="inl">
77 <?php
78 foreach($quota->listtype() as $type) {
79  if ($type=="default") continue;
80  echo "<option value=\"$type\">$type</option>\n";
81 }
82 ?></select>
83 </td><td><input type="submit" class="inb" value="<?php __("Delete account type"); ?>" /></td>
84 </tr>
85 </table>
86 </form>
87 <p>
88 <?php __("Here is the list of the quotas on the server for the new accounts. If you want to change them, enter new values"); ?>
89 </p>
90 <span class="inb"><a href="adm_defquotas.php?synchronise=1"><?php __("Synchronise user's quota (only to upper value)"); ?></a></span>
91 
92 <form method="post" action="adm_dodefquotas.php">
93 <div>
94 <input type="hidden" name="action" value="modify" />
95 <?php
96 $qarray=$quota->qlist();
97 $qlist=$quota->getdefaults();
98 reset($qlist);
99 foreach($qlist as $type => $q) {
100 ?>
101 <div class="info-toggle">
102 <h4 class="toggle-next"><?php echo _("Accounts of type"). " \"$type\"" ?>▼</h4>
103 <div class="info-hide" id="div-quot-<?php echo md5($type);?>">
104 <table border="0" cellpadding="4" cellspacing="0" class='tlist'>
105 <tr><th><?php __("Quotas") ?></th><th><?php __("Default Value"); ?></th></tr>
106 <?php
107 foreach($q as $name => $value) {
108  if (!isset($qarray[$name])) continue;
109  $key = $type . ":" . $name;
110 ?>
111 
112 <tr class="lst">
113 <td><label for="<?php echo $key; ?>"><?php echo $qarray[$name] ; ?></label></td>
114 <td><input type="text" class="int" size="16" maxlength="16" name="<?php echo $key; ?>" id="<?php echo $key;?>" value="<?php ehe($value); ?>" /></td></tr>
115 
116 <?php
117  } //foreach
118 ?>
119 </table>
120 <br/>
121 </div>
122 <script type="text/javascript">
123  $("#div-quot-<?php echo md5($type);?>").toggle();
124 </script>
125 </div>
126 <?php
127 }
128 ?>
129 <br/>
130 <input type="submit" class="inb ok" value="<?php __("Edit the default quotas"); ?>" />
131 </div>
132 </form>
133 <script type="text/javascript">
134 $(function(){
135  $(".toggle-next").on("click",function(){
136  var next = $(this).next();
137  next.toggle();
138  })
139 });
140 </script>
141 <?php include_once("foot.php"); ?>