Alternc  latest
Alternc logiel libre pour l'hébergement
aws_users.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 accounts of the user.
23  ----------------------------------------------------------------------
24 */
25 require_once("../class/config.php");
26 include_once("head.php");
27 
28 ?>
29 <h3><?php __("Awstats allowed user list"); ?></h3>
30 <hr id="topbar"/>
31 <br />
32 <?php
33 $nologin=false;
34 if (!$r=$aws->list_login()) {
35  $nologin=true;
36 }
37 
38 echo $msg->msg_html_all();
39 
40 $c=$admin->listPasswordPolicies();
41 $passwd_classcount = $c['aws']['classcount'];
42 
43  if ($quota->cancreate("aws")) { ?>
44 <p><span class="ina"><a href="aws_add.php"><?php __("Create new Statistics"); ?></a></span></p>
45 <?php } ?>
46 
47 <form method="post" action="aws_useradd.php" name="main">
48 <?php csrf_get(); ?>
49 <table class="tedit">
50 <tr><th>
51 <label for="login"><?php __("Username"); ?></label></th><td>
52  <select class="inl" name="prefixe"><?php $aws->select_prefix_list($prefixe); ?></select>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="login" id="login" value="" size="20" maxlength="64" />
53 </td></tr>
54 <tr><th><label for="pass"><?php __("Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf",$passwd_classcount); ?></td></tr>
55 <tr><th><label for="passconf"><?php __("Confirm password"); ?></label></th><td><input type="password" class="int" name="passconf" id="passconf" value="" size="20" maxlength="64" /></td></tr>
56 <tr class="trbtn"><td colspan="2">
57  <input type="submit" class="inb" name="submit" value="<?php __("Create this new Awstats user"); ?>" />
58  <input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='aws_list.php'"/>
59 
60 </td></tr>
61 </table>
62 </form>
63 <br />
64 
65 <?php
66 if (!$nologin) {
67 ?>
68 
69 
70 <form method="post" action="aws_userdel.php" name="main2" id="main2">
71 <?php csrf_get(); ?>
72 <table class="tlist">
73  <tr><th colspan="2"><?php __("Action"); ?></th><th><?php __("Username"); ?></th></tr>
74 <?php
75 $col=1;
76 foreach ($r as $val) {
77  $col=3-$col;
78 ?>
79  <tr class="lst<?php echo $col; ?>">
80  <td align="center"><input type="checkbox" class="inc" id="del_<?php echo $val; ?>" name="del_<?php echo $val; ?>" value="<?php echo $val; ?>" /></td>
81  <td><span class="ina"><a href="aws_pass.php?login=<?php echo $val ?>"><?php __("Change password"); ?></a></span></td>
82  <td><label for="del_<?php echo $val; ?>"><?php echo $val ?></label></td>
83  </tr>
84 <?php
85  }
86 ?>
87 <tr><td colspan="5"><input type="submit" name="submit" class="inb" onClick='return confirm("<?php __("Are you sure you want to delete the selected accounts?");?>");' value="<?php __("Delete checked accounts"); ?>" /></td></tr>
88 </table>
89 </form>
90 
91 
92 <?php
93  }
94 ?>
95 <script type="text/javascript">
96 document.forms['main'].login.focus();
97 document.forms['main'].setAttribute('autocomplete', 'off');
98 </script>
99 
100 <?php include_once("foot.php"); ?>
$msg
Definition: bootstrap.php:75
$r
Definition: aws_add.php:75
$nologin
Definition: aws_users.php:33
$c
Definition: aws_users.php:40
$passwd_classcount
Definition: aws_users.php:41
const DEFAULT_PASS_SIZE
Define constants from vars of /etc/alternc/local.sh The you can't choose where is the AlternC Panel.
Definition: config.php:81
display_div_generate_password($pass_size=DEFAULT_PASS_SIZE, $fields_to_fill1="", $fields_to_fill2="", $classcount=3)
Show a button to set a random password for a password field.
Definition: functions.php:922
__($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