Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F887839
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, Aug 10, 5:44 AM
Size
395 B
Mime Type
text/plain
Expires
Tue, Aug 12, 5:44 AM (8 h, 25 m)
Engine
blob
Format
Raw Data
Handle
234899
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
!
(
"Service not available"
)
unless
admin
.
enabled?
admin
.
login_at
=
Time
.
now
admin
.
save
success!
(
admin
)
end
end
Event Timeline
Log In to Comment