@ -32,6 +32,7 @@ function guest_register()
$enable_dect = config('enable_dect');
$enable_dect = config('enable_dect');
$enable_planned_arrival = config('enable_planned_arrival');
$enable_planned_arrival = config('enable_planned_arrival');
$min_password_length = config('min_password_length');
$min_password_length = config('min_password_length');
$enable_password = config('enable_password');
$enable_pronoun = config('enable_pronoun');
$enable_pronoun = config('enable_pronoun');
$config = config();
$config = config();
$request = request();
$request = request();
@ -146,12 +147,12 @@ function guest_register()
}
}
}
}
if ($request->has('password') & & strlen($request->postData('password')) >= $min_password_length) {
if ($enable_password & & $ request->has('password') & & strlen($request->postData('password')) >= $min_password_length) {
if ($request->postData('password') != $request->postData('password2')) {
if ($request->postData('password') != $request->postData('password2')) {
$valid = false;
$valid = false;
$msg .= error(__('Your passwords don\'t match.'), true);
$msg .= error(__('Your passwords don\'t match.'), true);
}
}
} else {
} else if ($enable_password) {
$valid = false;
$valid = false;
$msg .= error(sprintf(
$msg .= error(sprintf(
__('Your password is too short (please use at least %s characters).'),
__('Your password is too short (please use at least %s characters).'),
@ -272,7 +273,9 @@ function guest_register()
// Assign user-group and set password
// Assign user-group and set password
DB::insert('INSERT INTO `UserGroups` (`uid`, `group_id`) VALUES (?, -20)', [$user->id]);
DB::insert('INSERT INTO `UserGroups` (`uid`, `group_id`) VALUES (?, -20)', [$user->id]);
if ($enable_password) {
auth()->setPassword($user, $request->postData('password'));
auth()->setPassword($user, $request->postData('password'));
}
// Assign angel-types
// Assign angel-types
$user_angel_types_info = [];
$user_angel_types_info = [];
@ -422,9 +425,9 @@ function guest_register()
]),
]),
div('row', [
div('row', [
div('col', [
$enable_password ? div('col', [
form_password('password', __('Password') . ' ' . entry_required())
form_password('password', __('Password') . ' ' . entry_required())
]),
]) : '' ,
$enable_planned_arrival ? div('col', [
$enable_planned_arrival ? div('col', [
form_date(
form_date(
@ -436,9 +439,9 @@ function guest_register()
]),
]),
div('row', [
div('row', [
div('col', [
$enable_password ? div('col', [
form_password('password2', __('Confirm password') . ' ' . entry_required())
form_password('password2', __('Confirm password') . ' ' . entry_required())
]),
]) : '' ,
div('col', [
div('col', [
$enable_tshirt_size ? form_select('tshirt_size',
$enable_tshirt_size ? form_select('tshirt_size',