25 require_once(
"../class/config.php");
28 "id" => array (
"request",
"integer", 0),
32 if (!
$id && !$quota->cancreate(
"aws")) {
33 $msg->raise(
'Alert',
"aws", _(
"You cannot add any new statistics, your quota is over."));
36 include_once(
"head.php");
38 <h3><?php
if (!
$id) {
__(
"New Statistics"); }
else {
__(
"Edit Statistics"); } ?></h3>
41 <?php
__(
"Awstats will analyze every logs availables for this domain (since its creation).");?>
45 echo
$msg->msg_html_all();
47 <form method=
"post" action=
"<?php if (!$id) echo "aws_doadd.php
"; else echo "aws_doedit.php
"; ?>" id=
"main" name=
"main">
50 <tr><th><input type=
"hidden" name=
"id" value=
"<?php echo $id ?>" />
51 <label
for=
"hostname"><?php
__(
"Domain name"); ?></label></th><td>
53 <select
class=
"inl" name=
"hostname" id=
"hostname"><?php $aws->select_host_list($hostname); ?></select>
55 <code><?php echo $hostname; ?></code>
58 <tr><th><?php
__(
"Hostaliases"); ?></th><td>
60 $hl=$aws->host_list();
62 $hatab=$aws->get_hostaliases(
$id);
66 echo
"<input type=\"checkbox\" name=\"hostaliases[]\" id=\"ha_$ho\" value=\"$ho\"";
67 if (in_array($ho,@explode(
" ",$hatab[0]))) echo
" checked=\"checked\"";
68 echo
" /><label for=\"ha_$ho\">$ho ($ty)</label><br />\n";
72 <tr><th><?php
__(
"Allowed Users"); ?></th><td>
75 $r=$aws->list_allowed_login(
$id);
81 echo
"<input type=\"checkbox\" name=\"awsusers[]\" class=\"int\" id=\"u_".htmlentities($v[
"login"]).
"\" value=\"".htmlentities($v[
"login"]).
"\" ";
82 if ($v[
"selected"]) echo
" checked=\"checked\"";
83 echo
"><label for=\"u_".htmlentities($v[
"login"]).
"\">".$v[
"login"].
"</label><br />\n";
88 __(
"No users currently defined, you must create login with the 'Manage allowed users' accounts' menu.");
92 <tr
class=
"trbtn"><td colspan=
"2">
93 <input type=
"submit" class=
"inb" name=
"submit" value=
"<?php if (!$id) __("Create those statistics
"); else __("Edit those statistics
"); ?>" />
94 <input type=
"button" class=
"inb" name=
"cancel" value=
"<?php __("Cancel
"); ?>" onclick=
"document.location='aws_list.php'"/>
99 <?php include_once(
"foot.php"); ?>
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
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 ...
if(!isset($is_include)) if(! $key &&! $crt) $id
if(empty($_POST['key'])||empty($_POST['val'])) $key