|
|
@ -49,27 +49,27 @@ function guest_register() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['submit'])) {
|
|
|
|
if (isset($_REQUEST['submit'])) {
|
|
|
|
$ok = true;
|
|
|
|
$valid = true;
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['nick']) && strlen(User_validate_Nick($_REQUEST['nick'])) > 1) {
|
|
|
|
if (isset($_REQUEST['nick']) && strlen(User_validate_Nick($_REQUEST['nick'])) > 1) {
|
|
|
|
$nick = User_validate_Nick($_REQUEST['nick']);
|
|
|
|
$nick = User_validate_Nick($_REQUEST['nick']);
|
|
|
|
if (sql_num_query("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "' LIMIT 1") > 0) {
|
|
|
|
if (sql_num_query("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "' LIMIT 1") > 0) {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
$msg .= error(sprintf(_("Your nick "%s" already exists."), $nick), true);
|
|
|
|
$msg .= error(sprintf(_("Your nick "%s" already exists."), $nick), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
$msg .= error(sprintf(_("Your nick "%s" is too short (min. 2 characters)."), User_validate_Nick($_REQUEST['nick'])), true);
|
|
|
|
$msg .= error(sprintf(_("Your nick "%s" is too short (min. 2 characters)."), User_validate_Nick($_REQUEST['nick'])), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) {
|
|
|
|
if (isset($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) {
|
|
|
|
$mail = strip_request_item('mail');
|
|
|
|
$mail = strip_request_item('mail');
|
|
|
|
if (! check_email($mail)) {
|
|
|
|
if (! check_email($mail)) {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
$msg .= error(_("E-mail address is not correct."), true);
|
|
|
|
$msg .= error(_("E-mail address is not correct."), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
$msg .= error(_("Please enter your e-mail."), true);
|
|
|
|
$msg .= error(_("Please enter your e-mail."), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -80,7 +80,7 @@ function guest_register() {
|
|
|
|
if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) {
|
|
|
|
if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) {
|
|
|
|
$jabber = strip_request_item('jabber');
|
|
|
|
$jabber = strip_request_item('jabber');
|
|
|
|
if (! check_email($jabber)) {
|
|
|
|
if (! check_email($jabber)) {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
$msg .= error(_("Please check your jabber account information."), true);
|
|
|
|
$msg .= error(_("Please check your jabber account information."), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -89,25 +89,25 @@ function guest_register() {
|
|
|
|
if (isset($_REQUEST['tshirt_size']) && isset($tshirt_sizes[$_REQUEST['tshirt_size']]) && $_REQUEST['tshirt_size'] != '') {
|
|
|
|
if (isset($_REQUEST['tshirt_size']) && isset($tshirt_sizes[$_REQUEST['tshirt_size']]) && $_REQUEST['tshirt_size'] != '') {
|
|
|
|
$tshirt_size = $_REQUEST['tshirt_size'];
|
|
|
|
$tshirt_size = $_REQUEST['tshirt_size'];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
$msg .= error(_("Please select your shirt size."), true);
|
|
|
|
$msg .= error(_("Please select your shirt size."), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['password']) && strlen($_REQUEST['password']) >= MIN_PASSWORD_LENGTH) {
|
|
|
|
if (isset($_REQUEST['password']) && strlen($_REQUEST['password']) >= MIN_PASSWORD_LENGTH) {
|
|
|
|
if ($_REQUEST['password'] != $_REQUEST['password2']) {
|
|
|
|
if ($_REQUEST['password'] != $_REQUEST['password2']) {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
$msg .= error(_("Your passwords don't match."), true);
|
|
|
|
$msg .= error(_("Your passwords don't match."), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
$msg .= error(sprintf(_("Your password is too short (please use at least %s characters)."), MIN_PASSWORD_LENGTH), true);
|
|
|
|
$msg .= error(sprintf(_("Your password is too short (please use at least %s characters)."), MIN_PASSWORD_LENGTH), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['planned_arrival_date']) && DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))) {
|
|
|
|
if (isset($_REQUEST['planned_arrival_date']) && DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))) {
|
|
|
|
$planned_arrival_date = DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))->getTimestamp();
|
|
|
|
$planned_arrival_date = DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))->getTimestamp();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
$msg .= error(_("Please enter your planned date of arrival."), true);
|
|
|
|
$msg .= error(_("Please enter your planned date of arrival."), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -144,7 +144,7 @@ function guest_register() {
|
|
|
|
$comment = strip_request_item_nl('comment');
|
|
|
|
$comment = strip_request_item_nl('comment');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($ok) {
|
|
|
|
if ($valid) {
|
|
|
|
sql_query("
|
|
|
|
sql_query("
|
|
|
|
INSERT INTO `User` SET
|
|
|
|
INSERT INTO `User` SET
|
|
|
|
`color`='" . sql_escape($default_theme) . "',
|
|
|
|
`color`='" . sql_escape($default_theme) . "',
|
|
|
@ -284,7 +284,7 @@ function guest_login() {
|
|
|
|
unset($_SESSION['uid']);
|
|
|
|
unset($_SESSION['uid']);
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['submit'])) {
|
|
|
|
if (isset($_REQUEST['submit'])) {
|
|
|
|
$ok = true;
|
|
|
|
$valid = true;
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['nick']) && strlen(User_validate_Nick($_REQUEST['nick'])) > 0) {
|
|
|
|
if (isset($_REQUEST['nick']) && strlen(User_validate_Nick($_REQUEST['nick'])) > 0) {
|
|
|
|
$nick = User_validate_Nick($_REQUEST['nick']);
|
|
|
|
$nick = User_validate_Nick($_REQUEST['nick']);
|
|
|
@ -293,23 +293,23 @@ function guest_login() {
|
|
|
|
$login_user = $login_user[0];
|
|
|
|
$login_user = $login_user[0];
|
|
|
|
if (isset($_REQUEST['password'])) {
|
|
|
|
if (isset($_REQUEST['password'])) {
|
|
|
|
if (! verify_password($_REQUEST['password'], $login_user['Passwort'], $login_user['UID'])) {
|
|
|
|
if (! verify_password($_REQUEST['password'], $login_user['Passwort'], $login_user['UID'])) {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
error(_("Your password is incorrect. Please try it again."));
|
|
|
|
error(_("Your password is incorrect. Please try it again."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
error(_("Please enter a password."));
|
|
|
|
error(_("Please enter a password."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
error(_("No user was found with that Nickname. Please try again. If you are still having problems, ask an Dispatcher."));
|
|
|
|
error(_("No user was found with that Nickname. Please try again. If you are still having problems, ask an Dispatcher."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$ok = false;
|
|
|
|
$valid = false;
|
|
|
|
error(_("Please enter a nickname."));
|
|
|
|
error(_("Please enter a nickname."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($ok) {
|
|
|
|
if ($valid) {
|
|
|
|
$_SESSION['uid'] = $login_user['UID'];
|
|
|
|
$_SESSION['uid'] = $login_user['UID'];
|
|
|
|
$_SESSION['locale'] = $login_user['Sprache'];
|
|
|
|
$_SESSION['locale'] = $login_user['Sprache'];
|
|
|
|
|
|
|
|
|
|
|
|