Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F5492791
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
Tue, Sep 29, 5:21 PM
Size
398 B
Mime Type
text/plain
Expires
Thu, Oct 1, 5:21 PM (18 h, 36 m)
Engine
blob
Format
Raw Data
Handle
458425
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