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 * This page allows users to add a new profile which is POSTed to
19 * account_prof_add.php
21 * Users can also manage their profiles
24 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
25 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
26 * @link http://www.mantisbt.org
29 * @uses access_api.php
30 * @uses authentication_api.php
31 * @uses config_api.php
32 * @uses constant_inc.php
33 * @uses current_user_api.php
38 * @uses profile_api.php
41 require_once( 'core.php' );
42 require_api( 'access_api.php' );
43 require_api( 'authentication_api.php' );
44 require_api( 'config_api.php' );
45 require_api( 'constant_inc.php' );
46 require_api( 'current_user_api.php' );
47 require_api( 'form_api.php' );
48 require_api( 'html_api.php' );
49 require_api( 'lang_api.php' );
50 require_api( 'print_api.php' );
51 require_api( 'profile_api.php' );
53 if ( isset( $g_global_profiles ) ) {
54 $g_global_profiles = true;
56 $g_global_profiles = false;
59 auth_ensure_user_authenticated();
61 current_user_ensure_unprotected();
63 if ( $g_global_profiles ) {
64 access_ensure_global_level( config_get( 'manage_global_profile_threshold' ) );
66 access_ensure_global_level( config_get( 'add_profile_threshold' ) );
69 html_page_top( lang_get( 'manage_profiles_link' ) );
71 if ( $g_global_profiles ) {
72 print_manage_menu( 'manage_prof_menu_page.php' );
75 if ( $g_global_profiles ) {
76 $t_user_id = ALL_USERS
;
78 $t_user_id = auth_get_current_user_id();
81 # Add Profile Form BEGIN
85 <form method
="post" action
="account_prof_update.php">
86 <?php
echo form_security_field( 'profile_update' )?
>
87 <input type
="hidden" name
="action" value
="add" />
88 <table
class="width75" cellspacing
="1">
90 <td
class="form-title">
91 <input type
="hidden" name
="user_id" value
="<?php echo $t_user_id ?>" />
92 <?php
echo lang_get( 'add_profile_title' ) ?
>
96 if ( !$g_global_profiles ) {
97 print_account_menu( 'account_prof_menu_page.php' );
103 <td
class="category" width
="25%">
104 <span
class="required">*</span
><?php
echo lang_get( 'platform' ) ?
>
107 <input type
="text" name
="platform" size
="32" maxlength
="32" />
111 <td
class="category">
112 <span
class="required">*</span
><?php
echo lang_get( 'operating_system' ) ?
>
115 <input type
="text" name
="os" size
="32" maxlength
="32" />
119 <td
class="category">
120 <span
class="required">*</span
><?php
echo lang_get( 'os_version' ) ?
>
123 <input type
="text" name
="os_build" size
="16" maxlength
="16" />
127 <td
class="category">
128 <?php
echo lang_get( 'additional_description' ) ?
>
131 <textarea name
="description" cols
="60" rows
="8"></textarea
>
136 <span
class="required"> * <?php
echo lang_get( 'required' ) ?
></span
>
139 <input type
="submit" class="button" value
="<?php echo lang_get( 'add_profile_button' ) ?>" />
146 # Add Profile Form END
147 # Edit or Delete Profile Form BEGIN
149 $t_profiles = profile_get_all_for_user( $t_user_id );
154 <form method
="post" action
="account_prof_update.php">
155 <?php
echo form_security_field( 'profile_update' )?
>
156 <table
class="width75" cellspacing
="1">
158 <td
class="form-title" colspan
="2">
159 <?php
echo lang_get( 'edit_or_delete_profiles_title' ) ?
>
163 <td
class="center" colspan
="2">
164 <input type
="radio" name
="action" value
="edit" checked
="checked" /> <?php
echo lang_get( 'edit_profile' ) ?
>
166 if ( !$g_global_profiles ) {
168 <input type
="radio" name
="action" value
="make_default" /> <?php
echo lang_get( 'make_default' ) ?
>
172 <input type
="radio" name
="action" value
="delete" /> <?php
echo lang_get( 'delete_profile' ) ?
>
176 <td
class="category" width
="25%">
177 <?php
echo lang_get( 'select_profile' ) ?
>
180 <select name
="profile_id">
181 <?php
print_profile_option_list( $t_user_id, '', $t_profiles ) ?
>
186 <td
class="center" colspan
="2">
187 <input type
="submit" class="button" value
="<?php echo lang_get( 'submit_button' ) ?>" />
194 } # Edit or Delete Profile Form END