Issue 0000682: Error on user registration

On register page when the 2 passwords are not the same, an error occurs but user is also created.

=> Just error must be raised.

git-svn-id: http://piwigo.org/svn/trunk@1985 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rub 2007-04-27 05:22:17 +00:00
parent ccc17f2f7f
commit a0295117fe
2 changed files with 3 additions and 7 deletions

View file

@ -44,11 +44,10 @@ function validate_mail_address( $mail_address )
}
}
function register_user($login, $password, $mail_address)
function register_user($login, $password, $mail_address, $errors = array())
{
global $lang, $conf;
$errors = array();
if ($login == '')
{
array_push($errors, $lang['reg_err_login1']);

View file

@ -4,7 +4,6 @@
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | branch : BSF (Best So Far)
// | file : $Id$
// | last update : $Date$
// | last modifier : $Author$
@ -50,12 +49,10 @@ if (isset($_POST['submit']))
}
$errors =
array_merge(
$errors,
register_user($_POST['login'],
$_POST['password'],
$_POST['mail_address'])
);
$_POST['mail_address'],
$errors);
if (count($errors) == 0)
{