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/>.
19 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
20 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
21 * @link http://www.mantisbt.org
24 * @uses authentication_api.php
25 * @uses config_api.php
26 * @uses constant_inc.php
30 * @uses helper_api.php
34 * @uses utility_api.php
37 require_once( 'core.php' );
38 require_api( 'authentication_api.php' );
39 require_api( 'config_api.php' );
40 require_api( 'constant_inc.php' );
41 require_api( 'email_api.php' );
42 require_api( 'form_api.php' );
43 require_api( 'gpc_api.php' );
44 require_api( 'helper_api.php' );
45 require_api( 'lang_api.php' );
46 require_api( 'print_api.php' );
47 require_api( 'user_api.php' );
48 require_api( 'utility_api.php' );
50 form_security_validate( 'signup' );
52 $f_username = strip_tags( gpc_get_string( 'username' ) );
53 $f_email = strip_tags( gpc_get_string( 'email' ) );
54 $f_captcha = gpc_get_string( 'captcha', '' );
55 $f_public_key = gpc_get_int( 'public_key', '' );
57 $f_username = trim( $f_username );
58 $f_email = email_append_domain( trim( $f_email ) );
59 $f_captcha = utf8_strtolower( trim( $f_captcha ) );
61 # force logout on the current user if already authenticated
62 if( auth_is_user_authenticated() ) {
66 # Check to see if signup is allowed
67 if ( OFF
== config_get_global( 'allow_signup' ) ) {
68 print_header_redirect( 'login_page.php' );
72 if( ON
== config_get( 'signup_use_captcha' ) && get_gd_version() > 0 &&
73 helper_call_custom_function( 'auth_can_change_password', array() ) ) {
74 # captcha image requires GD library and related option to ON
75 $t_key = utf8_strtolower( utf8_substr( md5( config_get( 'password_confirm_hash_magic_string' ) . $f_public_key ), 1, 5) );
77 if ( $t_key != $f_captcha ) {
78 trigger_error( ERROR_SIGNUP_NOT_MATCHING_CAPTCHA
, ERROR
);
82 email_ensure_not_disposable( $f_email );
84 # notify the selected group a new user has signed-up
85 if( user_signup( $f_username, $f_email ) ) {
86 email_notify_new_account( $f_username, $f_email );
89 form_security_purge( 'signup' );
97 <table
class="width50" cellspacing
="1">
100 <b
><?php
echo lang_get( 'signup_done_title' ) ?
></b
><br
/>
101 <?php
echo "[$f_username - $f_email] " ?
>
107 <?php
echo lang_get( 'password_emailed_msg' ) ?
>
109 <?php
echo lang_get( 'no_reponse_msg') ?
>
115 <?php
print_bracket_link( 'login_page.php', lang_get( 'proceed' ) ); ?
>
119 html_page_bottom1a( __FILE__
);