aboutsummaryrefslogtreecommitdiffstats
path: root/register.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2011-12-18 21:46:24 +0000
committermistic100 <mistic@piwigo.org>2011-12-18 21:46:24 +0000
commitca230a6f53e3a102faf5cb3633465ee8fc326663 (patch)
tree9613ef04023af2927ed452c370af4814fb866fc5 /register.php
parentf5004995306cb603d63724c98af2d657c3c4a64b (diff)
feature:2538 Make a unified messages management
use only $page['infos'] and $page['errors'] vars and and necessary template to all main pages git-svn-id: http://piwigo.org/svn/trunk@12764 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'register.php')
-rw-r--r--register.php17
1 files changed, 5 insertions, 12 deletions
diff --git a/register.php b/register.php
index 63199e8f1..b5cdfb61c 100644
--- a/register.php
+++ b/register.php
@@ -37,28 +37,27 @@ if (!$conf['allow_user_registration'])
page_forbidden('User registration closed');
}
-$errors = array();
if (isset($_POST['submit']))
{
if (!verify_ephemeral_key(@$_POST['key']))
{
set_status_header(403);
- array_push($errors, 'Invalid/expired form key');
+ array_push($page['errors'], 'Invalid/expired form key');
}
if ($_POST['password'] != $_POST['password_conf'])
{
- array_push($errors, l10n('please enter your password again'));
+ array_push($page['errors'], l10n('please enter your password again'));
}
- $errors =
+ $page['errors'] =
register_user($_POST['login'],
$_POST['password'],
$_POST['mail_address'],
true,
- $errors);
+ $page['errors']);
- if (count($errors) == 0)
+ if (count($page['errors']) == 0)
{
$user_id = get_userid($_POST['login']);
log_user($user_id, false);
@@ -91,12 +90,6 @@ $template->assign(array(
'obligatory_user_mail_address' => $conf['obligatory_user_mail_address'],
));
-//-------------------------------------------------------------- errors display
-if (count($errors) != 0)
-{
- $template->assign('errors', $errors);
-}
-
// include menubar
$themeconf = $template->get_template_vars('themeconf');
if (!isset($themeconf['hide_menu_on']) OR !in_array('theRegisterPage', $themeconf['hide_menu_on']))