2 # MantisBT - A PHP based bugtracking system
4 # MantisBT is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
9 # MantisBT is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
18 * Allows the user to select a project that is visible to him
21 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
22 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
23 * @link http://www.mantisbt.org
26 * @uses authentication_api.php
27 * @uses constant_inc.php
28 * @uses current_user_api.php
33 * @uses string_api.php
36 require_once( 'core.php' );
37 require_api( 'authentication_api.php' );
38 require_api( 'constant_inc.php' );
39 require_api( 'current_user_api.php' );
40 require_api( 'gpc_api.php' );
41 require_api( 'html_api.php' );
42 require_api( 'lang_api.php' );
43 require_api( 'print_api.php' );
44 require_api( 'string_api.php' );
46 auth_ensure_user_authenticated();
48 $f_ref = string_sanitize_url( gpc_get_string( 'ref', '' ) );
50 if ( count( current_user_get_accessible_projects() ) == 1) {
51 $t_project_ids = current_user_get_accessible_projects();
52 $t_project_id = (int) $t_project_ids[0];
53 if ( count( current_user_get_accessible_subprojects( $t_project_id ) ) == 0 ) {
54 $t_ref_urlencoded = string_url( $f_ref );
55 print_header_redirect( "set_project.php?project_id=$t_project_id&ref=$t_ref_urlencoded", true);
56 /* print_header_redirect terminates script execution */
60 html_page_top( lang_get( 'select_project_button' ) );
63 <!-- Project Select Form BEGIN
-->
66 <form method
="post" action
="set_project.php">
67 <?php
# CSRF protection not required here - form does not result in modifications ?>
68 <table
class="width50" cellspacing
="1">
70 <td
class="form-title" colspan
="2">
71 <input type
="hidden" name
="ref" value
="<?php echo string_html_specialchars( $f_ref ) ?>" />
72 <?php
echo lang_get( 'select_project_button' ) ?
>
76 <td
class="category" width
="40%">
77 <?php
echo lang_get( 'choose_project' ) ?
>
80 <select name
="project_id">
81 <?php
print_project_option_list( ALL_PROJECTS
, false, null, true ) ?
>
87 <?php
echo lang_get( 'make_default' ) ?
>
90 <input type
="checkbox" name
="make_default" />
94 <td
class="center" colspan
="2">
95 <input type
="submit" class="button" value
="<?php echo lang_get( 'select_project_button') ?>" />