.
/**
* Login page POSTs results to login.php
* Check to see if the user is already logged in
*
* @package MantisBT
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright (C) 2002 - 2013 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
/**
* MantisBT Core API's
*/
require_once( 'core.php' );
$f_error = gpc_get_bool( 'error' );
$f_cookie_error = gpc_get_bool( 'cookie_error' );
$f_return = string_sanitize_url( gpc_get_string( 'return', '' ) );
$f_username = gpc_get_string( 'username', '' );
$f_perm_login = gpc_get_bool( 'perm_login', false );
$f_secure_session = gpc_get_bool( 'secure_session', false );
$f_secure_session_cookie = gpc_get_cookie( config_get_global( 'cookie_prefix' ) . '_secure_session', null );
$t_session_validation = ( ON == config_get_global( 'session_validation' ) );
// If user is already authenticated and not anonymous
if( auth_is_user_authenticated() && !current_user_is_anonymous() ) {
// If return URL is specified redirect to it; otherwise use default page
if( !is_blank( $f_return ) ) {
print_header_redirect( $f_return, false, false, true );
}
else {
print_header_redirect( config_get( 'default_home_page' ) );
}
}
# Check for automatic logon methods where we want the logon to just be handled by login.php
if ( auth_automatic_logon_bypass_form() ) {
$t_uri = "login.php";
if ( ON == config_get( 'allow_anonymous_login' ) ) {
$t_uri = "login_anon.php";
}
if ( !is_blank( $f_return ) ) {
$t_uri .= "?return=" . string_url( $f_return );
}
print_header_redirect( $t_uri );
exit;
}
# Login page shouldn't be indexed by search engines
html_robots_noindex();
html_page_top1();
html_page_top2a();
echo '