I have the following bit of code:
Code: Select all
if ( !$userdata['session_logged_in'] )
{
message_die(GENERAL_MESSAGE, $lang['Not_authorized']);
redirect(append_sid("index.$phpEx"));
}
Code: Select all
if ( !$userdata['session_logged_in'] )
{
message_die(GENERAL_MESSAGE, $lang['Not_authorized']);
redirect(append_sid("index.$phpEx"));
}
Code: Select all
$template->assign_vars(array{
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx?") . '">')
));
Code: Select all
if ( !$userdata['session_logged_in'] )
{
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx?") . '">'));
message_die(GENERAL_MESSAGE, $lang['Not_authorized']);
}
Ah.. I had an extra close-paren.worker201 wrote: Am I reading this right? content="3;url=X" - that's a strange construction. I'll have to look that one up.
Code: Select all
if ( !$userdata['session_logged_in'] )
{
redirect(append_sid("login.$phpEx", true));
}
Perhaps sending them to the login screen would make more sense. But your code does not tell them why they have been sent to the login screen. Sending the potential user to a message screen which tells them that they must be registered and logged in to use the feature in question is more user friendly. Bumping them from there to the login screen is probably the best compromise.3Di wrote:What's the purpose to redirect the not-logged-in users to the index page instead to clearly let them know they have to register in order to do 'blah' ?