Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / view_user_page.php
blob002dfbcc6433d373ba5ea460d35cac30b4f77ed4
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 * @package MantisBT
19 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
20 * @link http://www.mantisbt.org
22 * @uses core.php
23 * @uses access_api.php
24 * @uses authentication_api.php
25 * @uses config_api.php
26 * @uses constant_inc.php
27 * @uses error_api.php
28 * @uses gpc_api.php
29 * @uses helper_api.php
30 * @uses html_api.php
31 * @uses lang_api.php
32 * @uses print_api.php
33 * @uses string_api.php
34 * @uses user_api.php
35 * @uses utility_api.php
38 require_once( 'core.php' );
39 require_api( 'access_api.php' );
40 require_api( 'authentication_api.php' );
41 require_api( 'config_api.php' );
42 require_api( 'constant_inc.php' );
43 require_api( 'error_api.php' );
44 require_api( 'gpc_api.php' );
45 require_api( 'helper_api.php' );
46 require_api( 'html_api.php' );
47 require_api( 'lang_api.php' );
48 require_api( 'print_api.php' );
49 require_api( 'string_api.php' );
50 require_api( 'user_api.php' );
51 require_api( 'utility_api.php' );
53 auth_ensure_user_authenticated();
55 $t_can_manage = access_has_global_level( config_get( 'manage_user_threshold' ) );
56 $t_can_see_realname = access_has_project_level( config_get( 'show_user_realname_threshold' ) );
57 $t_can_see_email = access_has_project_level( config_get( 'show_user_email_threshold' ) );
59 # extracts the user information for the currently logged in user
60 # and prefixes it with u_
61 $f_user_id = gpc_get_int( 'id', auth_get_current_user_id() );
62 $row = user_get_row( $f_user_id );
64 extract( $row, EXTR_PREFIX_ALL, 'u' );
66 # In case we're using LDAP to get the email address... this will pull out
67 # that version instead of the one in the DB
68 $u_email = user_get_email( $u_id );
69 $u_realname = user_get_realname( $u_id );
71 html_page_top();
74 <br />
75 <div align="center">
76 <table class="width75" cellspacing="1">
77 <tr>
78 <td class="form-title">
79 <?php echo lang_get( 'view_account_title' ) ?>
80 </td>
81 </tr>
82 <tr <?php echo helper_alternate_class() ?>>
83 <td class="category" width="25%">
84 <?php echo lang_get( 'username' ) ?>
85 </td>
86 <td width="75%">
87 <?php echo string_display_line( $u_username ) ?>
88 </td>
89 </tr>
90 <tr <?php echo helper_alternate_class() ?>>
91 <td class="category">
92 <?php echo lang_get( 'email' ) ?>
93 </td>
94 <td>
95 <?php
96 if ( ! ( $t_can_manage || $t_can_see_email ) ) {
97 print error_string(ERROR_ACCESS_DENIED);
98 } else {
99 if ( !is_blank( $u_email ) ) {
100 print_email_link( $u_email, $u_email );
101 } else {
102 echo " - ";
106 </td>
107 </tr>
108 <tr <?php echo helper_alternate_class() ?> valign="top">
109 <td class="category">
110 <?php echo lang_get( 'realname' ) ?>
111 </td>
112 <td>
113 <?php
114 if ( ! ( $t_can_manage || $t_can_see_realname ) ) {
115 print error_string(ERROR_ACCESS_DENIED);
116 } else {
117 echo string_display_line( $u_realname );
120 </td>
121 </tr>
122 <?php if ( $t_can_manage ) { ?>
123 <tr>
124 <td colspan="2" class="center">
125 <?php print_bracket_link( 'manage_user_edit_page.php?user_id=' . $f_user_id, lang_get( 'manage_user' ) ); ?>
126 </td>
127 </tr>
128 <?php } ?>
129 </table>
130 </div>
132 <br />
134 <?php
135 html_page_bottom();