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
This commit is contained in:
mistic100
2011-12-18 21:46:24 +00:00
parent f500499530
commit ca230a6f53
25 changed files with 83 additions and 186 deletions
+5 -12
View File
@@ -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']))