Search
Project
General
Profile
Home
Projects
Help
Sign in
Register
Search
:
Redmine
All Projects
Redmine
Overview
Download
Activity
Roadmap
Issues
News
Wiki
Plugins
Forums
Repository
Download (935 Bytes)
Feature #11779
ยป reset_password.rake
Jan Niggemann (redmine.org team member)
, 2013-01-08 22:34
desc
"Create a new account resetadmin and set its password to admin"
require
'active_record'
namespace
:redmine
do
task
:resetpw
=>
:environment
do
class
ResetUser
<
ActiveRecord
::
Base
self
.
table_name
=
'users'
attr_accessible
:login
,
:hashed_password
,
:admin
,
:type
,
:firstname
,
:lastname
,
:mail
,
:mail_notification
,
:language
,
:status
end
user
=
ResetUser
.
new
(
:login
=>
'resetadmin'
,
:hashed_password
=>
'd033e22ae348aeb5660fc2140aec35850c4da997'
,
:admin
=>
true
,
:type
=>
'User'
,
:firstname
=>
'Redmine Reset'
,
:lastname
=>
'Admin'
,
:mail
=>
'admin@example.net'
,
:mail_notification
=>
true
,
:language
=>
'en'
,
:status
=>
1
)
user
.
save
User
.
salt_unsalted_passwords!
puts
"Created a new account, you can now login as user 'resetadmin' with password 'admin' and change the password of your admin account."
puts
"Please make sure you delete the account 'resetadmin' afterwards!"
end
end
(1-1/1)
Loading...