<commit_before><?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// <NAME> <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
//              http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

include('config.php');
include_once(mnminclude.'html1.php');
include_once(mnminclude.'recaptcha2.php');
include_once(mnminclude.'ban.php');

$globals['ads'] = false;

// Clean return variable
if(!empty($_REQUEST['return'])) {
	$_REQUEST['return'] = clean_input_string($_REQUEST['return']);
}

if ($current_user->user_id > 0) {
	if(!isset($_COOKIE['return_site'])) {
		$_COOKIE['return_site'] = get_server_name();
	}
	header("Location: http://".$_COOKIE['return_site'].get_user_uri($current_user->user_login));
	die;
}

if(isset($_POST["process"])) {
	$globals['secure_page'] = True;
} else {
	setcookie('return_site', get_server_name(), 0, $globals['base_url'], UserAuth::domain());
}

do_header(_("registro"), "post");

echo '<div class="genericform">'."\n";

if(isset($_POST["process"])) {
	switch (intval($_POST["process"])) {
		case 1:
			do_register1();
			break;
		case 2:
			do_register2();
			break;
	}
} else {
	do_register0();
}

echo '</div>' . "\n";
do_footer();
exit;

function do_register0() {
	echo '<div class="recoverpass" style="text-align:center;"><h4><a href="login?op=recover">'._('¿has olvidado la clave?').'</a></h4></div>';

	echo '<div style="margin:0 auto;max-width:500px"><form action="'.get_auth_link().'register" method="post" id="thisform" onSubmit="return check_checkfield(\'acceptlegal\', \''._('no has aceptado las condiciones de uso').'\')">' . "\n";
	echo '<fieldset>' . "\n";
	echo '<legend><span class="sign">' . _("datos del usuario") . '</span></legend>' . "\n";
	echo '<p><label for="name">' . _("nombre de usuario") . ':</label><br />' . "\n";

	echo '<input type="text" name="username" id="name" value="" onkeyup="enablebutton(this.form.checkbutton1, this.form.submit, this)" size="25" tabindex="1"/>' . "\n";
	echo '<span id="checkit"><input type="button" class="button" id="checkbutton1" disabled="disabled" value="'._('verificar').'" onclick="checkfield(\'username\', this.form, this.form.username)"/></span>' . "\n";
	echo '&nbsp;<span id="usernamecheckitvalue"></span></p>' . "\n";

	echo '<p><label for="email">email:</label><br />' . "\n";
	echo '<span class="note">'._('es importante que sea correcto, recibirás un correo para validar la cuenta').'</span> <br />';
	echo '<input type="text" id="email" name="email" value=""  onkeyup="enablebutton(this.form.checkbutton2, this.form.submit, this)" size="25" tabindex="2"/>' . "\n";
		echo '<input type="button" class="button" id="checkbutton2" disabled="disabled" value="'._('verificar').'" onclick="checkfield(\'email\', this.form, this.form.email)"/>' . "\n";
	echo '&nbsp;<span id="emailcheckitvalue"></span></p>' . "\n";

	echo '<p><label for="password">' . _("clave") . ':</label><br />' . "\n";
	echo '<span class="note">'._('al menos ocho caracteres, incluyendo mayúsculas, minúsculas y números').' </span><br />';
	echo '<input type="password" id="password" name="password" size="25" tabindex="3" onkeyup="return securePasswordCheck(this.form.password);"/><span id="password1-warning"></span></p>' . "\n";
	echo '<p><label for="verify">' . _("verificación de clave") . ': </label><br />' . "\n";

	echo '<input type="password" id="verify" name="password2" size="25" tabindex="4" onkeyup="checkEqualFields(this.form.password2, this.form.password)"/></p>' . "\n";

	echo '<p><label><span class="note">'._('has leído y aceptas las ');
	do_legal(_('condiciones de uso'), 'target="_blank"', false);
	echo ' <input type="checkbox" id="acceptlegal" name="acceptlegal" value="accept" tabindex="5"/></span></label></p>' . "\n";

	echo '<p><input type="submit" class="button" disabled="disabled" name="submit" value="'._('crear usuario').'" class="log2" tabindex="6" /></p>' . "\n";
	echo '<input type="hidden" name="process" value="1"/>' . "\n";

	echo '<div style="margin-top: 20px" style="text-align:center">';
	print_oauth_icons($_REQUEST['return']);
	echo '</div>'."\n";

	echo '</fieldset>' . "\n";
	echo '</form></div>' . "\n";


}

function do_register1() {
	global $db, $globals;

	if($_POST["acceptlegal"] !== 'accept' ) {
		register_error(_("no has aceptado las condiciones de uso"));
		return;
	}
	if (!check_user_fields()) return;
	echo '<br style="clear:both" />';<commit_msg>Fix checkbox in register page<commit_after><?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// <NAME> <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
//              http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

include('config.php');
include_once(mnminclude.'html1.php');
include_once(mnminclude.'recaptcha2.php');
include_once(mnminclude.'ban.php');

$globals['ads'] = false;

// Clean return variable
if(!empty($_REQUEST['return'])) {
	$_REQUEST['return'] = clean_input_string($_REQUEST['return']);
}

if ($current_user->user_id > 0) {
	if(!isset($_COOKIE['return_site'])) {
		$_COOKIE['return_site'] = get_server_name();
	}
	header("Location: http://".$_COOKIE['return_site'].get_user_uri($current_user->user_login));
	die;
}

if(isset($_POST["process"])) {
	$globals['secure_page'] = True;
} else {
	setcookie('return_site', get_server_name(), 0, $globals['base_url'], UserAuth::domain());
}

do_header(_("registro"), "post");

echo '<div class="genericform">'."\n";

if(isset($_POST["process"])) {
	switch (intval($_POST["process"])) {
		case 1:
			do_register1();
			break;
		case 2:
			do_register2();
			break;
	}
} else {
	do_register0();
}

echo '</div>' . "\n";
do_footer();
exit;

function do_register0() {
	echo '<div class="recoverpass" style="text-align:center;"><h4><a href="login?op=recover">'._('¿has olvidado la clave?').'</a></h4></div>';

	echo '<div style="margin:0 auto;max-width:500px"><form action="'.get_auth_link().'register" method="post" id="thisform" onSubmit="return check_checkfield(\'acceptlegal\', \''._('no has aceptado las condiciones de uso').'\')">' . "\n";
	echo '<fieldset>' . "\n";
	echo '<legend><span class="sign">' . _("datos del usuario") . '</span></legend>' . "\n";
	echo '<p><label for="name">' . _("nombre de usuario") . ':</label><br />' . "\n";

	echo '<input type="text" name="username" id="name" value="" onkeyup="enablebutton(this.form.checkbutton1, this.form.submit, this)" size="25" tabindex="1"/>' . "\n";
	echo '<span id="checkit"><input type="button" class="button" id="checkbutton1" disabled="disabled" value="'._('verificar').'" onclick="checkfield(\'username\', this.form, this.form.username)"/></span>' . "\n";
	echo '&nbsp;<span id="usernamecheckitvalue"></span></p>' . "\n";

	echo '<p><label for="email">email:</label><br />' . "\n";
	echo '<span class="note">'._('es importante que sea correcto, recibirás un correo para validar la cuenta').'</span> <br />';
	echo '<input type="text" id="email" name="email" value=""  onkeyup="enablebutton(this.form.checkbutton2, this.form.submit, this)" size="25" tabindex="2"/>' . "\n";
		echo '<input type="button" class="button" id="checkbutton2" disabled="disabled" value="'._('verificar').'" onclick="checkfield(\'email\', this.form, this.form.email)"/>' . "\n";
	echo '&nbsp;<span id="emailcheckitvalue"></span></p>' . "\n";

	echo '<p><label for="password">' . _("clave") . ':</label><br />' . "\n";
	echo '<span class="note">'._('al menos ocho caracteres, incluyendo mayúsculas, minúsculas y números').' </span><br />';
	echo '<input type="password" id="password" name="password" size="25" tabindex="3" onkeyup="return securePasswordCheck(this.form.password);"/><span id="password1-warning"></span></p>' . "\n";
	echo '<p><label for="verify">' . _("verificación de clave") . ': </label><br />' . "\n";

	echo '<input type="password" id="verify" name="password2" size="25" tabindex="4" onkeyup="checkEqualFields(this.form.password2, this.form.password)"/></p>' . "\n";

	echo '<p><label><span class="note">'._('has leído y aceptas las ');
	do_legal(_('condiciones de uso'), 'target="_blank"', false);
	echo ' <input style="vertical-align: sub" type="checkbox" id="acceptlegal" name="acceptlegal" value="accept" tabindex="5"/></span></label></p>' . "\n";

	echo '<p><input type="submit" class="button" disabled="disabled" name="submit" value="'._('crear usuario').'" class="log2" tabindex="6" /></p>' . "\n";
	echo '<input type="hidden" name="process" value="1"/>' . "\n";

	echo '<div style="margin-top: 20px" style="text-align:center">';
	print_oauth_icons($_REQUEST['return']);
	echo '</div>'."\n";

	echo '</fieldset>' . "\n";
	echo '</form></div>' . "\n";


}

function do_register1() {
	global $db, $globals;

	if($_POST["acceptlegal"] !== 'accept' ) {
		register_error(_("no has aceptado las condiciones de uso"));
		return;
	}
	if (!check_user_fields()) return;
	echo '<br style="clear:both" />';
{'fraction_non_alphanumeric': 0.23717948717948717, 'fraction_numerical': 0.009995654063450673, 'mean_word_length': 5.482394366197183, 'pattern_counts': {'":': 0, '<': 153, '<?xml version=': 0, '>': 157, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5584590', 'n_tokens_mistral': 3272, 'n_tokens_neox': 3178, 'n_words': 698}