Skip to content

Commit

Permalink
Modified setcookie() to use paths.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@832 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Apr 2, 2002
1 parent 92fb306 commit 47ed488
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -24,6 +24,7 @@ Mantis
* Modified bug_update_advanced to allow for more fields to be updated.
* Modified email subject links to match standard Mantis email format.
* Modified view bug pages to show bug status via color.
* Modified setcookie() to use paths.
* Added Hungarian translation.
* Added g_bug_link_tag to let users customize how to create bug links.
* Added a "jump to bugnotes" quicklink at the top of the view bug pages.
Expand Down
16 changes: 16 additions & 0 deletions doc/configuration.html
Expand Up @@ -1434,6 +1434,22 @@ <h2>Content</h2>
<b>Cookies</b>
</td>
</tr>
<tr>
<td width="20%" bgcolor="#ddddff">
$g_cookie_path
</td>
<td width="80%" bgcolor="#ffffff">
set this to something more restrictive if needed. Also see the <a href="http://www.php.net/manual/en/function.setcookie.php">Manual</a>
</td>
</tr>
<tr>
<td width="20%" bgcolor="#ddddff">
$g_cookie_domain
</td>
<td width="80%" bgcolor="#ffffff">
Unused
</td>
</tr>
<tr>
<td width="20%" bgcolor="#ddddff">
$g_cookie_prefix
Expand Down
8 changes: 4 additions & 4 deletions login.php
Expand Up @@ -54,15 +54,15 @@

if ( ( isset( $f_perm_login ) )&&( "on" == $f_perm_login ) ) {
# set permanent cookie (1 year)
setcookie( $g_string_cookie, $u_cookie_string, time()+$g_cookie_time_length );
setcookie( $g_string_cookie, $u_cookie_string, time()+$g_cookie_time_length, $g_cookie_path );
if ( $t_project_id > -1 ) {
setcookie( $g_project_cookie, $t_project_id, time()+$g_cookie_time_length );
setcookie( $g_project_cookie, $t_project_id, time()+$g_cookie_time_length, $g_cookie_path );
}
} else {
# set temp cookie, cookie dies after browser closes
setcookie( $g_string_cookie, $u_cookie_string );
setcookie( $g_string_cookie, $u_cookie_string, 0, $g_cookie_path );
if ( $t_project_id > -1 ) {
setcookie( $g_project_cookie, $t_project_id, time()+$g_cookie_time_length+$g_cookie_time_length );
setcookie( $g_project_cookie, $t_project_id, time()+$g_cookie_time_length+$g_cookie_time_length, $g_cookie_path );
}
}

Expand Down
2 changes: 1 addition & 1 deletion manage_page.php
Expand Up @@ -31,7 +31,7 @@
}

$t_manage_string = $f_hide.":".$f_sort.":".$f_dir;
setcookie( $g_manage_cookie, $t_manage_string, time()+$g_cookie_time_length );
setcookie( $g_manage_cookie, $t_manage_string, time()+$g_cookie_time_length, $g_cookie_path );
} else if ( !empty( $g_manage_cookie_val ) ) {
$t_manage_arr = explode( ":", $g_manage_cookie_val );
$f_hide = $t_manage_arr[0];
Expand Down
8 changes: 4 additions & 4 deletions print_all_bug_page.php
Expand Up @@ -13,7 +13,7 @@
if ( empty( $g_view_all_cookie_val ) ) {
$t_settings_string = "v1#any#any#any#".$g_default_limit_view."#".
$g_default_show_changed."#0#any#any#last_updated#DESC";
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length );
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length, $g_cookie_path );
print_header_redirect( $g_print_all_bug_page."?f=2" );
}

Expand All @@ -22,7 +22,7 @@
if ( $t_setting_arr[0] != "v1" ) {
$t_settings_string = "v1#any#any#any#".$g_default_limit_view."#".
$g_default_show_changed."#0#any#any#last_updated#DESC";
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length );
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length, $g_cookie_path );
print_header_redirect( $g_print_all_bug_page."?f=1" );
}

Expand Down Expand Up @@ -53,7 +53,7 @@
$f_assign_id."#".
$f_sort."#".
$f_dir;
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length );
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length, $g_cookie_path );
} else if ( 2 == $f_save ) {
# We came here via clicking a sort link
# Load pre-existing preferences
Expand Down Expand Up @@ -86,7 +86,7 @@
$f_sort."#".
$f_dir;

setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length );
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length, $g_cookie_path );
}
} else {
# Load preferences
Expand Down
2 changes: 1 addition & 1 deletion set_project.php
Expand Up @@ -29,7 +29,7 @@
}

# Add item
setcookie( $g_project_cookie, $f_project_id, time()+$g_cookie_time_length );
setcookie( $g_project_cookie, $f_project_id, time()+$g_cookie_time_length, $g_cookie_path );

# redirect to 'same page' when switching projects.
# view_all_* pages, and summary
Expand Down
8 changes: 4 additions & 4 deletions view_all_bug_page.php
Expand Up @@ -20,7 +20,7 @@
$t_settings_string = "v1#any#any#any#".$g_default_limit_view."#".
$g_default_show_changed."#".$g_hide_closed_default.
"#any#any#last_updated#DESC";
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length );
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length, $g_cookie_path );
print_header_redirect( $g_view_all_bug_page."?f=2" );
}

Expand All @@ -30,7 +30,7 @@
$t_settings_string = "v1#any#any#any#".$g_default_limit_view."#".
$g_default_show_changed."#".$g_hide_closed_default.
"#any#any#last_updated#DESC";
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length );
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length, $g_cookie_path );
print_header_redirect( $g_view_all_bug_page."?f=1" );
}

Expand Down Expand Up @@ -69,7 +69,7 @@
$f_assign_id."#".
$f_sort."#".
$f_dir;
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length );
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length, $g_cookie_path );
} else if ( 2 == $f_save ) {
# We came here via clicking a sort link
# Load pre-existing preferences
Expand Down Expand Up @@ -102,7 +102,7 @@
$f_sort."#".
$f_dir;

setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length );
setcookie( $g_view_all_cookie, $t_settings_string, time()+$g_cookie_time_length, $g_cookie_path );
}
} else {
# Load preferences
Expand Down

0 comments on commit 47ed488

Please sign in to comment.