Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1431149
admin.rb
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jan 18, 3:13 PM
Size
398 B
Mime Type
text/plain
Expires
Tue, Jan 20, 3:13 PM (22 h, 49 m)
Engine
blob
Format
Raw Data
Handle
326065
Attached To
rARCHIVING archiving
admin.rb
View Options
Warden
::
Strategies
.
add
(
:admin
)
do
def
valid?
params
[
'username'
]
&&
params
[
'password'
]
end
def
authenticate!
admin
=
User
.
fetch_admin_with_password
(
params
[
'username'
]
,
params
[
'password'
]
)
return
fail
!
(
"Wrong credentials"
)
unless
admin
return
fail
!
(
"Your account is disabled"
)
unless
admin
.
enabled?
admin
.
login_at
=
Time
.
now
admin
.
save
success!
(
admin
)
end
end
Event Timeline
Log In to Comment