mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-09 02:03:18 +02:00
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:
+3
-11
@@ -31,15 +31,13 @@ include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
|
||||
check_status(ACCESS_FREE);
|
||||
|
||||
//-------------------------------------------------------------- identification
|
||||
$errors = array();
|
||||
|
||||
$redirect_to = '';
|
||||
if ( !empty($_GET['redirect']) )
|
||||
{
|
||||
$redirect_to = urldecode($_GET['redirect']);
|
||||
if ( is_a_guest() )
|
||||
{
|
||||
array_push($errors, l10n('You are not authorized to access the requested page'));
|
||||
array_push($page['errors'], l10n('You are not authorized to access the requested page'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +46,7 @@ if (isset($_POST['login']))
|
||||
if (!isset($_COOKIE[session_name()]))
|
||||
{
|
||||
array_push(
|
||||
$errors,
|
||||
$page['errors'],
|
||||
l10n('Cookies are blocked or not supported by your browser. You must enable cookies to connect.')
|
||||
);
|
||||
}
|
||||
@@ -68,7 +66,7 @@ if (isset($_POST['login']))
|
||||
}
|
||||
else
|
||||
{
|
||||
array_push( $errors, l10n('Invalid password!') );
|
||||
array_push($page['errors'], l10n('Invalid password!') );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,12 +94,6 @@ if ($conf['allow_user_registration'])
|
||||
$template->assign('U_REGISTER', get_root_url().'register.php' );
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- errors display
|
||||
if ( sizeof( $errors ) != 0 )
|
||||
{
|
||||
$template->assign('errors', $errors);
|
||||
}
|
||||
|
||||
// include menubar
|
||||
$themeconf = $template->get_template_vars('themeconf');
|
||||
if (!isset($themeconf['hide_menu_on']) OR !in_array('theIdentificationPage', $themeconf['hide_menu_on']))
|
||||
|
||||
Reference in New Issue
Block a user