-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add weight option #30
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,14 @@ public function buildForm(array $form, FormStateInterface $form_state) { | |
'#default_value' => $config->get('enabled'), | ||
'#description' => t('Enable TFA for account authentication.'), | ||
); | ||
|
||
// Option to set tfa tab in userprofile | ||
$form['weight'] = array( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code formatting issues, please run PHPCS on this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename all uses of "weight" to "tab_weight" |
||
'#type' => 'weight', | ||
'#title' => $this->t('Weight of the tfa tab'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit, 'Weight of TFA tab' instead of 'Weight of tfa tab' |
||
'#default_value' => $config->get('weight'), | ||
'#delta' => 30, | ||
); | ||
|
||
//@TODO Figure out why we allow multiple validation plugins? | ||
if (count($validate_plugins)) { | ||
|
@@ -285,6 +293,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { | |
|
||
$this->config('tfa.settings') | ||
->set('enabled', $form_state->getValue('tfa_enabled')) | ||
->set('weight', $form_state->getValue('weight')) | ||
->set('setup_plugins', array_filter($form_state->getValue('tfa_setup'))) | ||
->set('send_plugins', array_filter($form_state->getValue('tfa_send'))) | ||
->set('login_plugins', array_filter($form_state->getValue('tfa_login'))) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please annotate this as
tab_weight
, weight is too ambiguous here