/
bug_monitor.php
40 lines (33 loc) · 1.31 KB
/
bug_monitor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 Mantis Team - mantisbt-dev@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
# --------------------------------------------------------
# $Id: bug_monitor.php,v 1.16 2002-10-23 04:54:44 jfitzell Exp $
# --------------------------------------------------------
?>
<?php
# This file turns monitoring on or off for a bug for the current user
?>
<?php require_once( 'core.php' ) ?>
<?php login_cookie_check() ?>
<?php
$f_bug_id = gpc_get_int( 'f_bug_id' );
$f_action = gpc_get_string( 'f_action' );
project_access_check( $f_bug_id );
bug_ensure_exists( $f_bug_id );
$t_view_state = bug_get_field( $f_bug_id, 'view_state' );
$t_threshold = config_get( 'monitor_bug_threshold' );
if ( PRIVATE == $t_view_state ) {
$t_threshold = max( config_get( 'private_bug_threshold' ) , $t_threshold );
}
check_access( $t_threshold );
if ( 'delete' == $f_action ) {
bug_unmonitor( $f_bug_id, auth_get_current_user_id() );
} else { # should be 'add' but we have to account for other values
bug_monitor( $f_bug_id, auth_get_current_user_id() );
}
print_header_redirect_view( $f_bug_id );
?>