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 - 2011 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
27 * @uses crypto_api.php
31 * @uses helper_api.php
35 * @uses utility_api.php
41 require_once( 'core.php' );
42 require_api( 'authentication_api.php' );
43 require_api( 'config_api.php' );
44 require_api( 'constant_inc.php' );
45 require_api( 'crypto_api.php' );
46 require_api( 'email_api.php' );
47 require_api( 'form_api.php' );
48 require_api( 'gpc_api.php' );
49 require_api( 'helper_api.php' );
50 require_api( 'lang_api.php' );
51 require_api( 'print_api.php' );
52 require_api( 'user_api.php' );
53 require_api( 'utility_api.php' );
55 form_security_validate( 'signup' );
57 $f_username = strip_tags( gpc_get_string( 'username' ) );
58 $f_email = strip_tags( gpc_get_string( 'email' ) );
59 $f_captcha = gpc_get_string( 'captcha', '' );
60 $f_public_key = gpc_get_string( 'public_key', '' );
62 $f_username = trim( $f_username );
63 $f_email = email_append_domain( trim( $f_email ) );
64 $f_captcha = utf8_strtolower( trim( $f_captcha ) );
66 # force logout on the current user if already authenticated
67 if( auth_is_user_authenticated() ) {
71 # Check to see if signup is allowed
72 if ( OFF
== config_get_global( 'allow_signup' ) ) {
73 print_header_redirect( 'login_page.php' );
77 if( ON
== config_get( 'signup_use_captcha' ) && get_gd_version() > 0 &&
78 helper_call_custom_function( 'auth_can_change_password', array() ) ) {
79 # captcha image requires GD library and related option to ON
80 $t_private_key = substr( hash( 'whirlpool', 'captcha' . config_get_global( 'crypto_master_salt' ) . $f_public_key, false ), 0, 5 );
82 if ( $t_private_key != $f_captcha ) {
83 trigger_error( ERROR_SIGNUP_NOT_MATCHING_CAPTCHA
, ERROR
);
87 email_ensure_not_disposable( $f_email );
89 # notify the selected group a new user has signed-up
90 if( user_signup( $f_username, $f_email ) ) {
91 email_notify_new_account( $f_username, $f_email );
94 form_security_purge( 'signup' );
102 <table
class="width50" cellspacing
="1">
105 <strong
><?php
echo lang_get( 'signup_done_title' ) ?
></strong
><br
/>
106 <?php
echo "[$f_username - $f_email] " ?
>
112 <?php
echo lang_get( 'password_emailed_msg' ) ?
>
114 <?php
echo lang_get( 'no_reponse_msg') ?
>
120 <?php
print_bracket_link( 'login_page.php', lang_get( 'proceed' ) ); ?
>
124 html_page_bottom1a( __FILE__
);