From ca230a6f53e3a102faf5cb3633465ee8fc326663 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sun, 18 Dec 2011 21:46:24 +0000 Subject: 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 --- register.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'register.php') 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'])) -- cgit v1.2.3