mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-24 01:32:25 +01:00
Fix error in Register controller which prevented language setting
This commit is contained in:
parent
e60e30619d
commit
e95b953891
@ -30,7 +30,7 @@ class Register extends AbstractController
|
||||
case 'POST':
|
||||
$data = new DataGetter(HTTPRequest::postData());
|
||||
|
||||
if (!$data->has(array('username', 'fullname', 'password', 'email'))) {
|
||||
if (!$data->has(array('username', 'fullname', 'password', 'language', 'email'))) {
|
||||
$this->notify($this->label('users.user.cannot-create.var-missing'), 'error');
|
||||
$this->redirectToPanel();
|
||||
}
|
||||
@ -40,6 +40,7 @@ class Register extends AbstractController
|
||||
'fullname' => $data->get('fullname'),
|
||||
'hash' => Password::hash($data->get('password')),
|
||||
'email' => $data->get('email'),
|
||||
'language' => $data->get('language'),
|
||||
'role' => 'admin'
|
||||
);
|
||||
|
||||
|
@ -24,9 +24,19 @@
|
||||
<input id="username" type="text" required name="username" pattern="^[a-zA-Z0-9_-]{3,20}$" title="<?= ucfirst($this->label('users.new-user.username-suggestion')) ?>" maxlength="20" autocomplete="false">
|
||||
<label class="label-required" for="password"><?= $this->label('user.password') ?>:</label>
|
||||
<span class="label-suggestion">(<?= $this->label('users.new-user.password-suggestion') ?>)</span>
|
||||
<input id="password" type="password" required name="password" pattern="^.{8,}$" title="<?= ucfirst($this->label('users.new-user.password-suggestion')) ?>" autocomplete="false">
|
||||
<input id="password" type="password" required name="password" pattern="^.{8,}$" title="<?= ucfirst($this->label('users.new-user.password-suggestion')) ?>" autocomplete="new-password">
|
||||
<label class="label-required" for="email"><?= $this->label('user.email') ?>:</label>
|
||||
<input id="email" type="email" required name="email">
|
||||
<label class="label-required" for="email"><?= $this->label('user.language') ?>:</label>
|
||||
<select id="language" name="language">
|
||||
<?php
|
||||
foreach ($this->languages() as $key => $value):
|
||||
?>
|
||||
<option value="<?= $key ?>"<?php if ($key === $this->language()): ?> selected<?php endif; ?>><?= $value ?></option>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</select>
|
||||
<input type="hidden" name="csrf-token" value="<?= $csrfToken ?>">
|
||||
<div class="separator"></div>
|
||||
<button class="button-accent" type="submit"><?= $this->label('modal.action.continue') ?></button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user