Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / login_select_proj_page.php
blob394e9bf3e68c246a86d8ff2045e1f723c519eb67
1 <?php
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/>.
17 /**
18 * Allows the user to select a project that is visible to him
20 * @package MantisBT
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
25 * @uses core.php
26 * @uses authentication_api.php
27 * @uses constant_inc.php
28 * @uses current_user_api.php
29 * @uses gpc_api.php
30 * @uses html_api.php
31 * @uses lang_api.php
32 * @uses print_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 -->
64 <br />
65 <div align="center">
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">
69 <tr>
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' ) ?>
73 </td>
74 </tr>
75 <tr class="row-1">
76 <td class="category" width="40%">
77 <?php echo lang_get( 'choose_project' ) ?>
78 </td>
79 <td width="60%">
80 <select name="project_id">
81 <?php print_project_option_list( ALL_PROJECTS, false, null, true ) ?>
82 </select>
83 </td>
84 </tr>
85 <tr class="row-2">
86 <td class="category">
87 <?php echo lang_get( 'make_default' ) ?>
88 </td>
89 <td>
90 <input type="checkbox" name="make_default" />
91 </td>
92 </tr>
93 <tr>
94 <td class="center" colspan="2">
95 <input type="submit" class="button" value="<?php echo lang_get( 'select_project_button') ?>" />
96 </td>
97 </tr>
98 </table>
99 </form>
100 </div>
102 <?php
103 html_page_bottom();