Fix setting vault key strength is not saved

This commit is contained in:
brantje 2016-12-29 00:04:37 +01:00
parent c9ad65994c
commit a1f8ace5c1
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
3 changed files with 13 additions and 10 deletions

View file

@ -91,12 +91,12 @@ class InternalController extends ApiController {
*/
public function getSettings() {
$settings = array(
'link_sharing_enabled' => $this->config->getAppValue('passman', 'link_sharing_enabled', 1),
'user_sharing_enabled' => $this->config->getAppValue('passman', 'user_sharing_enabled', 1),
'vault_key_strength' => $this->config->getAppValue('passman', 'vault_key_strength', 3),
'check_version' => $this->config->getAppValue('passman', 'check_version', 1),
'https_check' => $this->config->getAppValue('passman', 'https_check', 1),
'disable_contextmenu' => $this->config->getAppValue('passman', 'disable_contextmenu', 1),
'link_sharing_enabled' => intval($this->config->getAppValue('passman', 'link_sharing_enabled', 1)),
'user_sharing_enabled' => intval($this->config->getAppValue('passman', 'user_sharing_enabled', 1)),
'vault_key_strength' => intval($this->config->getAppValue('passman', 'vault_key_strength', 3)),
'check_version' => intval($this->config->getAppValue('passman', 'check_version', 1)),
'https_check' => intval($this->config->getAppValue('passman', 'https_check', 1)),
'disable_contextmenu' => intval($this->config->getAppValue('passman', 'disable_contextmenu', 1)),
);
return new JSONResponse($settings);
}

View file

@ -117,5 +117,8 @@ $(document).ready(function () {
$('#passman_link_sharing_enabled').change(function () {
settings.setAdminKey('link_sharing_enabled', ($(this).is(":checked")) ? 1 : 0);
});
$('#vault_key_strength').change(function () {
settings.setAdminKey('vault_key_strength', $(this).val());
});
});

View file

@ -85,16 +85,16 @@ if ($checkVersion) {
<p>
<label for="vault_key_strength">Minimum vault key strength:</label>
<select name="vault_key_strength" id="vault_key_strength">
<option value="1" <?php if ($_['vault_key_strength'] === 1) print_unescaped('selected="selected"'); ?>>
<option value="0">
Poor
</option>
<option value="2" <?php if ($_['vault_key_strength'] === 2) print_unescaped('selected="selected"'); ?>>
<option value="2">
Weak
</option>
<option value="3" <?php if ($_['vault_key_strength'] === 3) print_unescaped('selected="selected"'); ?>>
<option value="3">
Good
</option>
<option value="4" <?php if ($_['vault_key_strength'] === 4) print_unescaped('selected="selected"'); ?>>
<option value="4">
Strong
</option>
</select>