Alternc  latest
Alternc logiel libre pour l'hébergement
aws_list.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  AlternC - Web Hosting System
5  Copyright (C) 2000-2012 by the AlternC Development Team.
6  https://alternc.org/
7  ----------------------------------------------------------------------
8  LICENSE
9 
10  This program is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License (GPL)
12  as published by the Free Software Foundation; either version 2
13  of the License, or (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  To read the license please visit http://www.gnu.org/copyleft/gpl.html
21  ----------------------------------------------------------------------
22  Purpose of file: List awstats statistics and manage them.
23  ----------------------------------------------------------------------
24 */
25 require_once("../class/config.php");
26 include_once("head.php");
27 
28 $nosta=false;
29 if (!$r=$aws->get_list()) {
30  $msg->raise('Info', "aws", _("No statistics currently defined"));
31  $nosta=true;
32 }
33 
34 $create=true;
35 if (!$quota->cancreate("aws")) {
36  $msg->raise('Info', "aws", _("Your stat quota is over..."));
37  $create=false;
38 }
39 ?>
40 
41 <h3><?php __("Statistics List"); ?></h3>
42 <hr id="topbar"/>
43 <br />
44 <?php
45 echo $msg->msg_html_all("<li>", true, true);
46 ?>
47 <p>
48 <?php
49 //echo "<pre>";print_r($mem);echo "</pre>";
50 ?>
51 
52 <span class="ina"><a href="aws_users.php"><?php __("Manage allowed users' accounts"); ?></a></span><br /><br />
53 
54 <?php
55 if ($create) { ?>
56  <span class="ina"><a href="aws_add.php"><?php __("Create new Statistics"); ?></a></span><br />
57 <?php } // cancreate ?>
58 </p>
59 
60 <?php if (!$nosta) { ?>
61 
62 <form method="post" action="aws_del.php">
63 <?php csrf_get(); ?>
64 <table cellspacing="0" cellpadding="4">
65  <tr><th colspan="2"><?php __("Action"); ?></th><th><?php __("Domain name"); ?></th><th><?php __("Allowed Users"); ?></th><th><?php __("View the statistics"); ?></th></tr>
66 <?php
67 reset($r);
68 $col=1;
69 while (list($key,$val)=each($r)) {
70  $col=3-$col;
71 ?>
72  <tr class="lst<?php echo $col; ?>">
73  <td><input type="checkbox" class="inc" id="del_<?php echo $val["id"]; ?>" name="del_<?php echo $val["id"]; ?>" value="<?php echo $val["id"]; ?>" /></td>
74  <td><div class="ina"><a href="aws_edit.php?id=<?php echo $val["id"] ?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" title="<?php __("Edit"); ?>" /><?php __("Edit"); ?></a></div></td>
75  <td class='retour-auto'><label for="del_<?php echo $val["id"]; ?>" ><?php echo $val["hostname"] ?></label></td>
76  <td><?php echo $val["users"] ?></td>
77  <td><div class="ina"><a href="/cgi-bin/awstats.pl?config=<?php echo $val["hostname"]; ?>" target="_blank" ><img src="images/stat.png" alt="<?php __("View the statistics"); ?>" /><?php __("View the statistics"); ?></a></div></td>
78  </tr>
79 <?php } // while ?>
80 
81 <tr><td colspan="5"><input type="submit" class="inb" name="submit" onClick='return confirm("<?php __("Are you sure you want to delete the selected statistics?");?>");' value="<?php __("Delete the checked Statistics"); ?>" /></td></tr>
82 </table>
83 </form>
84 <?php
85 } // if !nosta
86 
87 include_once("foot.php");
88 ?>
$msg
Definition: bootstrap.php:75
$r
Definition: aws_add.php:75
$nosta
Definition: aws_list.php:28
if(! $r=$aws->get_list()) $create
Definition: aws_list.php:34
__($str)
Definition: functions.php:404
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
$val
Definition: tempovars.php:15
if(empty($_POST['key'])||empty($_POST['val'])) $key
Definition: tempovars.php:14