Skip to content

Commit

Permalink
Fixed issue #18136: Core plugin PasswordRequirement shows duplicate s…
Browse files Browse the repository at this point in the history
…etting fields (#2452)
  • Loading branch information
Shnoulle committed Jul 1, 2022
1 parent ccc2ec9 commit a23193b
Showing 1 changed file with 29 additions and 1 deletion.
Expand Up @@ -16,6 +16,14 @@ class PasswordRequirement extends \LimeSurvey\PluginManager\PluginBase
public $allowedPublicMethods = array();

protected $settings = [
'adminPart' => array(
'content' => 'Password requirements for administration login',
'type' => 'info',
'class' => "h3",
'controlOptions' => array(
'class' => "col-md-offset-4 col-md-6"
),
),
'needsNumber' => array(
'label' => 'Require at least one digit',
'type' => 'checkbox',
Expand All @@ -36,6 +44,15 @@ class PasswordRequirement extends \LimeSurvey\PluginManager\PluginBase
'type' => 'int',
'default' => 12,
),
'surveyPart' => array(
'content' => 'Password requirements for “Save and return later” feature',
'type' => 'info',
'class' => "h3",
'controlOptions' => array(
'class' => "col-md-offset-4 col-md-6"
),
'type' => 'info',
),
'surveySaveActive' => array(
'type' => 'boolean',
'label' => 'Check password when saving survey',
Expand Down Expand Up @@ -177,7 +194,18 @@ public function createRandomPassword()
*/
public function getPluginSettings($getValues = true)
{
$settings = parent::getPluginSettings();
$settings = parent::getPluginSettings($getValues);
$settings['adminPart']['content'] = $this->gT("Password requirements for administration login");
$settings['needsNumber']['label'] = $this->gT("Require at least one digit");
$settings['needsUppercase']['label'] = $this->gT("Require at least one uppercase character");
$settings['needsNonAlphanumeric']['label'] = $this->gT("Require at least one special character");
$settings['minimumSize']['label'] = $this->gT("Minimum password length");
$settings['surveyPart']['content'] = $this->gT("Password requirements for “Save and return later” feature");
$settings['surveySaveActive']['label'] = $this->gT("Check password when use “Save and return later” feature");
$settings['surveySaveNeedsNumber']['label'] = $this->gT("Require at least one digit");
$settings['surveySaveNeedsUppercase']['label'] = $this->gT("Require at least one uppercase character");
$settings['surveySaveNeedsNonAlphanumeric']['label'] = $this->gT("Require at least one special character");
$settings['surveySaveMinimumSize']['label'] = $this->gT("Minimum password length");
return $settings;
}

Expand Down

0 comments on commit a23193b

Please sign in to comment.