From 572137fccde149b6eb6ede7369a7460fcb19bee5 Mon Sep 17 00:00:00 2001 From: Axel ROGER Date: Tue, 6 Nov 2012 16:46:15 +0000 Subject: [PATCH] Fixes #1357 --- awstats/bureau/admin/aws_add.php | 14 +++----------- awstats/bureau/admin/aws_doadd.php | 3 +-- awstats/bureau/admin/aws_useradd.php | 22 ++++++++++++++-------- awstats/bureau/admin/aws_users.php | 1 + 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/awstats/bureau/admin/aws_add.php b/awstats/bureau/admin/aws_add.php index a4bb81d0..273d09f2 100644 --- a/awstats/bureau/admin/aws_add.php +++ b/awstats/bureau/admin/aws_add.php @@ -38,6 +38,9 @@ include_once("head.php");



+ +
+
$error

"; @@ -87,17 +90,6 @@ foreach($r as $v) { } ?> - - diff --git a/awstats/bureau/admin/aws_doadd.php b/awstats/bureau/admin/aws_doadd.php index 90d86399..e3a4777f 100644 --- a/awstats/bureau/admin/aws_doadd.php +++ b/awstats/bureau/admin/aws_doadd.php @@ -28,12 +28,11 @@ $fields = array ( "hostname" => array ("post", "string", ""), "awsusers" => array ("post", "array", ""), "hostaliases" => array ("post", "array", ""), - "public" => array ("post", "integer", "") ); getFields($fields); if ($aws->check_host_available($hostname)) { - $r=$aws->add_stats($hostname,$awsusers,$hostaliases,$public); + $r=$aws->add_stats($hostname,$awsusers,$hostaliases,1); if (!$r) { $error=$err->errstr(); include("aws_add.php"); diff --git a/awstats/bureau/admin/aws_useradd.php b/awstats/bureau/admin/aws_useradd.php index 5ad0c385..497f1bff 100644 --- a/awstats/bureau/admin/aws_useradd.php +++ b/awstats/bureau/admin/aws_useradd.php @@ -25,17 +25,23 @@ require_once("../class/config.php"); $fields = array ( - "prefixe" => array ("request", "string", ""), - "login" => array ("request", "string", ""), - "pass" => array ("request", "string", ""), + "prefixe" => array ("request", "string", ""), + "login" => array ("request", "string", ""), + "pass" => array ("request", "string", ""), + "passconf" => array ("request", "string", "") ); getFields($fields); -$r=$aws->add_login($prefixe.(($login)?"_":"").$login,$pass); -if (!$r) { - $error=$err->errstr(); -} else { - $error=_("The Awstat account has been successfully created"); +if ($pass != $passconf) { + $error = _("Passwords do not match"); +}else{ + $r=$aws->add_login($prefixe.(($login)?"_":"").$login,$pass); + + if (!$r) { + $error=$err->errstr(); + } else { + $error=_("The Awstat account has been successfully created"); + } } include("aws_users.php"); diff --git a/awstats/bureau/admin/aws_users.php b/awstats/bureau/admin/aws_users.php index 9c0a9ef5..2684145e 100644 --- a/awstats/bureau/admin/aws_users.php +++ b/awstats/bureau/admin/aws_users.php @@ -48,6 +48,7 @@ if (!$r=$aws->list_login()) {  _  + " /> " onclick="document.location='aws_list.php'"/>