Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F5130966
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
Mon, Aug 17, 1:24 PM
Size
395 B
Mime Type
text/plain
Expires
Wed, Aug 19, 1:24 PM (7 h, 37 m)
Engine
blob
Format
Raw Data
Handle
418608
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