diff --git a/app/controllers/registration.php b/app/controllers/registration.php index de86683677841a51e85d715023e21c64b138a90c..378918bbabed9e5f5700d0f84e1d7bb6a35fb148 100644 --- a/app/controllers/registration.php +++ b/app/controllers/registration.php @@ -16,7 +16,9 @@ class RegistrationController extends AuthenticatedController public function index_action() { $new_user = new User(); - + $new_user->perms = 'user'; + $new_user->auth_plugin = 'standard'; + $new_user->preferred_language = $_SESSION['_language'] ?? Config::get()->DEFAULT_LANGUAGE; $this->registrationform = Form::fromSORM( $new_user, [ @@ -26,6 +28,7 @@ class RegistrationController extends AuthenticatedController 'label' => _('Benutzername'), 'required' => true, 'maxlength' => '63', + 'attributes' => ['autocomplete' => 'off'], 'validate' => function ($value, $input) { if (!preg_match(Config::get()->USERNAME_REGULAR_EXPRESSION, $value)) { return Config::get()->getMetadata('USERNAME_REGULAR_EXPRESSION')['comment'] ?: @@ -46,6 +49,7 @@ class RegistrationController extends AuthenticatedController 'required' => true, 'maxlength' => '31', 'minlength' => '8', + 'attributes' => ['autocomplete' => 'new-password'], 'mapper' => function($value) { $hasher = UserManagement::getPwdHasher(); return $hasher->HashPassword($value); @@ -57,6 +61,7 @@ class RegistrationController extends AuthenticatedController 'required' => true, 'maxlength' => '31', 'minlength' => '8', + 'attributes' => ['autocomplete' => 'new-password'], ':pattern' => "password.replace(/[.*+?^\${}()|[\\]\\\\]/g, '\\\\$&')", //mask special chars 'data-validation_requirement' => _('Passwörter stimmen nicht überein.'), 'store' => function() {} @@ -64,23 +69,28 @@ class RegistrationController extends AuthenticatedController 'title_front' => [ 'label' => _('Titel'), 'type' => 'datalist', + 'attributes' => ['autocomplete' => 'honorific-prefix'], 'options' => $GLOBALS['TITLE_FRONT_TEMPLATE'] ], 'title_rear' => [ 'label' => _('Titel nachgestellt'), 'type' => 'datalist', + 'attributes' => ['autocomplete' => 'honorific-suffix'], 'options' => $GLOBALS['TITLE_REAR_TEMPLATE'], ], 'vorname' => [ 'label' => _('Vorname'), + 'attributes' => ['autocomplete' => 'given-name'], 'required' => true ], 'nachname' => [ 'label' => _('Nachname'), + 'attributes' => ['autocomplete' => 'family-name'], 'required' => true ], 'geschlecht' => [ 'name' => 'geschlecht', + 'value' => 0, 'label' => _('Geschlecht'), 'type' => 'radio', 'orientation' => 'horizontal', @@ -94,6 +104,7 @@ class RegistrationController extends AuthenticatedController 'email' => [ 'label' => _('E-Mail'), 'required' => true, + 'attributes' => ['autocomplete' => 'email'], 'validate' => function ($value, $input) { $user = User::findOneByEmail($value); $context = $input->getContextObject(); diff --git a/templates/forms/datalist_input.php b/templates/forms/datalist_input.php index 7958c332875ee1d8cb667ea00135c4790d14f7e9..bf18732f208f2d3d27199d1cc78f4bfc27f3a149 100644 --- a/templates/forms/datalist_input.php +++ b/templates/forms/datalist_input.php @@ -6,10 +6,15 @@ <? if ($this->required) : ?> <span class="asterisk" title="<?= _('Dies ist ein Pflichtfeld') ?>" aria-hidden="true">*</span> <? endif ?> - - <input type="text" list="<?= $this->title ?>" id="" v-model="<?= htmlReady($this->name) ?>" <?= $this->required ? 'required aria-required="true"' : '' ?> /> - - <datalist class="" id="<?= $this->title ?>" <?= $attributes ?>> + <input type="text" + list="<?= htmlReady($this->title) ?>" + v-model="<?= htmlReady($this->name) ?>" + name="<?= htmlReady($this->name) ?>" + value="<?= htmlReady($this->value) ?>" + id="<?= htmlReady($id) ?>" + <?= $this->required ? 'required aria-required="true"' : '' ?> + <?= $attributes ?>> + <datalist class="" id="<?= htmlReady($this->title) ?>"> <? foreach ($options as $key => $option) : ?> <option value="<?= htmlReady($option) ?>"<?= ($option == $value ? " selected" : "") ?>> </option> diff --git a/templates/forms/radio_input.php b/templates/forms/radio_input.php index 37170c99e4960a7781ec0778b3fa140e542229d9..da110d1f83098ba9a671761f10b14acfbba2fe5a 100644 --- a/templates/forms/radio_input.php +++ b/templates/forms/radio_input.php @@ -1,5 +1,5 @@ <div class="formpart"> - <section <?= $this->orientation == 'horizontal' ? 'class="hgroup"' : '' ?> for="<?= $id ?>"> + <section <?= $this->orientation == 'horizontal' ? 'class="hgroup"' : '' ?> id="<?= htmlReady($id) ?>"> <span class="textlabel"> <?= htmlReady($this->title) ?> </span> @@ -7,6 +7,7 @@ <? foreach ($options as $key => $option) : ?> <label class="" <?= $attributes ?>> <input type="radio" + name="<?= htmlReady($this->name) ?>" v-model="<?= htmlReady($this->name) ?>" value="<?= htmlReady($key) ?>" <?= $key == $value ? 'checked' : '' ?>> <?= htmlReady($option) ?>