Move user_reset_password and user_reset_password_token_limit settings to database - refs #7794

1.10.x
Yannick Warnier 11 years ago
parent ea94df0669
commit a740f7ff03
  1. 43
      app/Migrations/Schema/V110/Version20150813143000.php
  2. 4
      main/auth/lostPassword.php
  3. 2
      main/auth/reset.php
  4. 4
      main/install/configuration.dist.php
  5. 11
      main/install/data.sql

@ -70,6 +70,42 @@ class Version20150813143000 extends AbstractMigrationChamilo
1 => ['value' => 'false', 'text' => 'No']
]
);
$this->addSettingCurrent(
'user_reset_password',
null,
'radio',
'Security',
'false',
'ResetPasswordTokenTitle',
'ResetPasswordTokenComment',
null,
null,
1,
false,
true,
[
0 => ['value' => 'true', 'text' => 'Yes'],
1 => ['value' => 'false', 'text' => 'No']
]
);
$this->addSettingCurrent(
'user_reset_password_token_limit',
null,
'text',
'Security',
'3600',
'ResetPasswordTokenLimitTitle',
'ResetPasswordTokenLimitComment',
null,
null,
1,
false,
true,
[
0 => ['value' => 'true', 'text' => 'Yes'],
1 => ['value' => 'false', 'text' => 'No']
]
);
}
/**
@ -89,7 +125,9 @@ class Version20150813143000 extends AbstractMigrationChamilo
[
'prevent_multiple_simultaneous_login',
'gradebook_detailed_admin_view',
'course_catalog_published'
'course_catalog_published',
'user_reset_password',
'user_reset_password_token_limit'
]
)
);
@ -102,7 +140,8 @@ class Version20150813143000 extends AbstractMigrationChamilo
[
'prevent_multiple_simultaneous_login',
'gradebook_detailed_admin_view',
'course_catalog_published'
'course_catalog_published',
'user_reset_password'
]
)
);

@ -107,8 +107,8 @@ if (isset($_GET['reset']) && isset($_GET['id'])) {
$by_username = true;
foreach ($usersRelatedToUsername as $user) {
if ($_configuration['password_encryption'] != 'none') {
$setting = api_get_configuration_value('user_reset_password');
if ($setting) {
$setting = api_get_setting('user_reset_password');
if ($setting === 'true') {
$userObj = Database::getManager()->getRepository('ChamiloUserBundle:User')->find($user['uid']);
Login::sendResetEmail($userObj);
} else {

@ -24,7 +24,7 @@ $form->addRule('pass2', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule(array('pass1', 'pass2'), get_lang('PassTwo'), 'compare');
$form->addButtonSave(get_lang('Update'));
$ttl = api_get_configuration_value('user_reset_password_token_limit');
$ttl = api_get_setting('user_reset_password_token_limit');
if (empty($ttl)) {
$ttl = 3600;
}

@ -214,9 +214,5 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE;
'extra_fields'
];*/
// Reset password in portal
//$_configuration['user_reset_password'] = false;
// password token expired
//$_configuration['user_reset_password_token_limit'] = 3600;
// Show Default view and Session view link in My Courses tab
//$_configuration['my_courses_view_by_session'] = false;

@ -1722,7 +1722,10 @@ VALUES
('gamification_mode', NULL, 'radio', 'Platform', '0', 'GamificationModeTitle', 'GamificationModeComment', NULL, NULL, 1),
('prevent_multiple_simultaneous_login', NULL, 'radio', 'Security', 'false', 'PreventMultipleSimultaneousLoginTitle', 'PreventMultipleSimultaneousLoginComment', NULL, NULL, 0),
('gradebook_detailed_admin_view', NULL, 'radio', 'Gradebook', 'false', 'ShowAdditionalColumnsInStudentResultsPageTitle', 'ShowAdditionalColumnsInStudentResultsPageComment', NULL, NULL, 1),
('course_catalog_published', NULL, 'radio', 'Course', 'false', 'CourseCatalogIsPublicTitle', 'CourseCatalogIsPublicComment', NULL, NULL, 0);
('course_catalog_published', NULL, 'radio', 'Course', 'false', 'CourseCatalogIsPublicTitle', 'CourseCatalogIsPublicComment', NULL, NULL, 0),
('user_reset_password', NULL, 'radio', 'Security', 'false', 'ResetPasswordTokenTitle', 'ResetPasswordTokenComment', NULL, NULL, 0),
('user_reset_password_token_limit', NULL, 'text', 'Security', '3600', 'ResetPasswordTokenLimitTitle', 'ResetPasswordTokenLimitComment', NULL, NULL, 0);
INSERT INTO settings_options (variable, value, display_text)
VALUES
@ -1804,6 +1807,8 @@ VALUES
('gradebook_detailed_admin_view', 'true', 'Yes'),
('gradebook_detailed_admin_view', 'false', 'No'),
('course_catalog_published', 'true', 'Yes'),
('course_catalog_published', 'false', 'No');
('course_catalog_published', 'false', 'No'),
('user_reset_password', 'true', 'Yes'),
('user_reset_password', 'false', 'No');
UPDATE settings_current SET selected_value = '1.10.0.47' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.48' WHERE variable = 'chamilo_database_version';

Loading…
Cancel
Save