1<?php
2# MantisBT - A PHP based bugtracking system
3
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.
8#
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.
13#
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/>.
16
17/**
18 * Sign Up Page
19 * @package MantisBT
20 * @copyright Copyright 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
21 * @copyright Copyright 2002  MantisBT Team - mantisbt-dev@lists.sourceforge.net
22 * @link http://www.mantisbt.org
23 *
24 * @uses core.php
25 * @uses config_api.php
26 * @uses constant_inc.php
27 * @uses crypto_api.php
28 * @uses form_api.php
29 * @uses helper_api.php
30 * @uses html_api.php
31 * @uses lang_api.php
32 * @uses print_api.php
33 * @uses utility_api.php
34 */
35
36require_once( 'core.php' );
37require_api( 'config_api.php' );
38require_api( 'constant_inc.php' );
39require_api( 'crypto_api.php' );
40require_api( 'form_api.php' );
41require_api( 'helper_api.php' );
42require_api( 'html_api.php' );
43require_api( 'lang_api.php' );
44require_api( 'print_api.php' );
45require_api( 'utility_api.php' );
46
47require_css( 'login.css' );
48
49require_js( 'login.js' );
50
51# Check for invalid access to signup page
52if( !auth_signup_enabled() || LDAP == config_get_global( 'login_method' ) ) {
53	print_header_redirect( auth_login_page() );
54}
55
56# signup page shouldn't be indexed by search engines
57html_robots_noindex();
58
59layout_login_page_begin();
60
61$t_public_key = crypto_generate_uri_safe_nonce( 64 );
62?>
63
64<div class="col-md-offset-3 col-md-6 col-sm-10 col-sm-offset-1">
65    <div class="login-container">
66	<div class="space-12 hidden-480"></div>
67	<?php layout_login_page_logo() ?>
68	<div class="space-24 hidden-480"></div>
69
70	<div class="position-relative">
71
72		<div class="signup-box visible widget-box no-border" id="login-box">
73			<div class="widget-body">
74				<div class="widget-main">
75					<h4 class="header lighter bigger">
76						<?php print_icon( 'fa-pencil', 'ace-icon' ); ?>
77						<?php echo lang_get( 'signup_title' ) ?>
78					</h4>
79					<div class="space-10"></div>
80
81	<form id="signup-form" method="post" action="signup.php">
82		<fieldset>
83			<?php echo form_security_field( 'signup' ); ?>
84
85			<label for="username" class="block clearfix">
86				<span class="block input-icon input-icon-right">
87					<input id="username" name="username" type="text" placeholder="<?php echo lang_get( 'username' ) ?>"
88						size="32" maxlength="<?php echo DB_FIELD_SIZE_USERNAME;?>" class="form-control autofocus">
89					<?php print_icon( 'fa-user', 'ace-icon' ); ?>
90				</span>
91			</label>
92
93			<label for="email-field" class="block clearfix">
94				<span class="block input-icon input-icon-right">
95					<input id="email-field" name="email" type="text" placeholder="<?php echo lang_get( 'email_label' ) ?>"
96						size="32" maxlength="64" class="form-control">
97					<?php print_icon( 'fa-envelope', 'ace-icon' ); ?>
98				</span>
99			</label>
100
101<?php
102	$t_allow_passwd_change = helper_call_custom_function( 'auth_can_change_password', array() );
103
104	# captcha image requires GD library and related option to ON
105	if( ON == config_get( 'signup_use_captcha' ) && get_gd_version() > 0 && $t_allow_passwd_change ) {
106		$t_securimage_path = 'vendor/dapphp/securimage';
107		$t_securimage_show = $t_securimage_path . '/securimage_show.php';
108		$t_securimage_play = $t_securimage_path . '/securimage_play.swf?'
109			. http_build_query( array(
110				'audio_file' => $t_securimage_path . '/securimage_play.php',
111				'bgColor1=' => '#fff',
112				'bgColor2=' => '#fff',
113				'iconColor=' => '#777',
114				'borderWidth=' => 1,
115				'borderColor=' => '#000',
116			) );
117?>
118
119				<label for="captcha-field" class="block clearfix">
120					<strong><?php echo lang_get( 'signup_captcha_request_label' ); ?></strong>
121				</label>
122				<span id="captcha-input" class="input">
123					<?php print_captcha_input( 'captcha' ); ?>
124
125					<span id="captcha-image" class="captcha-image" style="padding-right:3px;">
126						<img src="<?php echo $t_securimage_show; ?>" alt="visual captcha" />
127						<ul id="captcha-refresh"><li><a href="#"><?php
128							echo lang_get( 'signup_captcha_refresh' );
129						?></a></li></ul>
130					</span>
131
132					<object type="application/x-shockwave-flash" width="19" height="19"
133						data="<?php echo $t_securimage_play; ?>">
134						<param name="movie" value="<?php echo $t_securimage_play; ?>" />
135					</object>
136				</span>
137
138<?php
139			}
140
141			if( !$t_allow_passwd_change ) {
142				echo '<div class="space-10"></div>';
143				echo '<div class="alert alert-danger">';
144				echo lang_get( 'no_password_change' );
145				echo '</div>';
146			}
147?>
148
149			<div class="clearfix"></div>
150			<div class="space-10"></div>
151			<?php echo lang_get( 'signup_info' ); ?>
152			<div class="space-10"></div>
153
154			<input type="submit" class="width-40 pull-right btn btn-success btn-inverse bigger-110" value="<?php echo lang_get( 'signup_button' ) ?>" />
155		</fieldset>
156	</form>
157</div>
158
159	<div class="toolbar center">
160		<a class="back-to-login-link pull-left" href="<?php echo AUTH_PAGE_USERNAME; ?>"><?php echo lang_get( 'login' ); ?></a>
161		<?php
162		# lost password feature disabled or reset password via email disabled
163		if( ( LDAP != config_get_global( 'login_method' ) ) &&
164			( ON == config_get( 'lost_password_feature' ) ) &&
165			( ON == config_get( 'send_reset_password' ) ) &&
166			( ON == config_get( 'enable_email_notification' ) ) ) {
167			?>
168			<a class="back-to-login-link pull-right" href="lost_pwd_page.php"><?php echo lang_get( 'lost_password_link' ); ?></a>
169		<?php
170		}
171		?>
172		<div class="clearfix"></div>
173	</div>
174	</div>
175	</div>
176	</div>
177</div>
178
179<?php
180layout_login_page_end();
181