custom_functions_api.php:
Code: Select all
$my_project_cookie_valid = false;
// get cookies
$my_cookie_name = config_get_global( 'project_cookie' );
$my_project_id = gpc_get_cookie( $my_cookie_name, null );
if( $my_project_id === 0 || !isset( $my_project_id ) || project_exists($my_project_id) != true ) {
$my_project_cookie_valid = false;
} else {
$my_project_cookie_valid = true;
}
if( $my_project_cookie_valid == false) {
$my_bypass_script = array('my_view_page', 'roadmap_page', 'changelog_page', 'view_all_bug_page');
foreach( $my_bypass_script as $value ) {
if( basename($_SERVER['SCRIPT_NAME']) == $value . '.php' ) {
print_header_redirect( 'login_select_proj_page.php' );
}
}
}
I accessing to MantisBT from URL login.php?project_id=5
If not accesing from this URL then...
Idea is: User after click any links on left sidebar redirect to login_select_proj_page.php and must select project. But this my PHP code after select project stayed links on left sidebar to login_select_proj_page.php.
Reproduct: I cleaned cache and cookies. But not solved.
Where is a problem? Thanks