View Issue Details

IDProjectCategoryView StatusLast Update
0004952mantisbtscriptingpublic2005-04-18 10:38
Reporternauman Assigned Tothraxisp  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version1.0.0a1 
Summary0004952: some issues with script authentication support
Description

auth_logout() should set global $g_cache_current_user_id to null to support scripts authenticating as one user, logging out and authenticating as another user. Currently, the first users is cached and no other user can authenticate.

Should not be clearing cookies with gpc_clear_cookie() in auth_clear_cookies() and helper_clear_pref_cookies() from auth_logout() when authentication is through a script. Otherwise you get messages like this written to console

Cannot modify header information - headers already sent by (output started at C:
\utils\mantis_perforce.php:249) at line 251 in k:\inetpub\mantis\core\gpc_api.php

Following are the mods I made for this. Sorry I don't know how to use patch tools.

function auth_logout() {
global $g_cache_current_user_id;
$g_cache_current_user_id = null;
if (auth_clear_cookies()) {
helper_clear_pref_cookies();
}
return true;
}

function auth_clear_cookies() {
global $g_script_login_cookie;

$cookies_cleared = false;
if ($g_script_login_cookie == null) {
$t_cookie_name = config_get( 'string_cookie' );
$t_cookie_path = config_get( 'cookie_path' );
gpc_clear_cookie( $t_cookie_name, $t_cookie_path );
$cookies_cleared = true;
}
else {
$g_script_login_cookie = null;
}
return $cookies_cleared;
}

TagsNo tags attached.

Relationships

has duplicate 0004634 closed User-Password reset & verify 
related to 0006222 closedgrangeway User-Password reset & verify 
child of 0004937 closedvboctor Mantis 1.0.0a1 Release 

Activities

thraxisp

thraxisp

2005-04-10 10:53

reporter   ~0009780

Patch applied to CVS

core/authentication_api.php -> 1.47