diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-11 19:07:36 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-11 19:07:36 +0000 |
commit | 1013e77e165252d9765acc249ad1f09607cf0ced (patch) | |
tree | 35bd7894e5af812778be45f886b4c21ccd046480 /db/migrate | |
parent | 97a647c1e5d43106d97d3b07febfd659eb5681c1 (diff) | |
download | redmine-1013e77e165252d9765acc249ad1f09607cf0ced.tar.gz redmine-1013e77e165252d9765acc249ad1f09607cf0ced.zip |
Force password reset for default admin user (#22381).
Patch by Gregor Schmidt.
git-svn-id: http://svn.redmine.org/redmine/trunk@15321 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20160404080304_force_password_reset_during_setup.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/db/migrate/20160404080304_force_password_reset_during_setup.rb b/db/migrate/20160404080304_force_password_reset_during_setup.rb new file mode 100644 index 000000000..d80057a2c --- /dev/null +++ b/db/migrate/20160404080304_force_password_reset_during_setup.rb @@ -0,0 +1,9 @@ +class ForcePasswordResetDuringSetup < ActiveRecord::Migration + def up + User.where(login: "admin", last_login_on: nil).update_all(must_change_passwd: true) + end + + def down + User.where(login: "admin", last_login_on: nil, must_change_passwd: true).update_all(must_change_passwd: false) + end +end |