2008-11-05 22:52:40 +00:00
|
|
|
from django.contrib import admin
|
2013-03-16 22:13:35 +00:00
|
|
|
|
|
|
|
|
from axes.models import AccessLog
|
|
|
|
|
from axes.models import AccessAttempt
|
2008-11-05 22:52:40 +00:00
|
|
|
|
2011-04-12 21:04:51 +00:00
|
|
|
|
2008-11-05 22:52:40 +00:00
|
|
|
class AccessAttemptAdmin(admin.ModelAdmin):
|
2013-03-16 22:13:35 +00:00
|
|
|
list_display = (
|
|
|
|
|
'attempt_time',
|
|
|
|
|
'ip_address',
|
|
|
|
|
'user_agent',
|
2013-07-01 10:57:31 +00:00
|
|
|
'username',
|
2013-03-16 22:13:35 +00:00
|
|
|
'path_info',
|
|
|
|
|
'failures_since_start',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
list_filter = [
|
|
|
|
|
'attempt_time',
|
2013-07-01 10:57:31 +00:00
|
|
|
'username',
|
2013-03-16 22:13:35 +00:00
|
|
|
'path_info',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
search_fields = [
|
|
|
|
|
'ip_address',
|
2013-07-01 10:57:31 +00:00
|
|
|
'username',
|
2013-03-16 22:13:35 +00:00
|
|
|
'user_agent',
|
|
|
|
|
'path_info',
|
|
|
|
|
]
|
|
|
|
|
|
2008-11-05 22:52:40 +00:00
|
|
|
date_hierarchy = 'attempt_time'
|
2013-03-16 22:13:35 +00:00
|
|
|
|
2008-11-05 22:52:40 +00:00
|
|
|
fieldsets = (
|
|
|
|
|
(None, {
|
|
|
|
|
'fields': ('path_info', 'failures_since_start')
|
|
|
|
|
}),
|
|
|
|
|
('Form Data', {
|
|
|
|
|
'fields': ('get_data', 'post_data')
|
|
|
|
|
}),
|
|
|
|
|
('Meta Data', {
|
|
|
|
|
'fields': ('user_agent', 'ip_address', 'http_accept')
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
|
2011-04-12 21:04:51 +00:00
|
|
|
admin.site.register(AccessAttempt, AccessAttemptAdmin)
|
2012-11-25 20:46:45 +00:00
|
|
|
|
2013-03-16 22:13:35 +00:00
|
|
|
|
2012-11-25 20:46:45 +00:00
|
|
|
class AccessLogAdmin(admin.ModelAdmin):
|
2013-03-16 22:13:35 +00:00
|
|
|
list_display = (
|
|
|
|
|
'attempt_time',
|
|
|
|
|
'logout_time',
|
|
|
|
|
'ip_address',
|
2013-07-01 10:57:31 +00:00
|
|
|
'username',
|
2013-03-16 22:13:35 +00:00
|
|
|
'user_agent',
|
|
|
|
|
'path_info',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
list_filter = [
|
|
|
|
|
'attempt_time',
|
|
|
|
|
'logout_time',
|
2013-07-01 10:57:31 +00:00
|
|
|
'username',
|
2013-03-16 22:13:35 +00:00
|
|
|
'path_info',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
search_fields = [
|
|
|
|
|
'ip_address',
|
|
|
|
|
'user_agent',
|
2013-07-01 10:57:31 +00:00
|
|
|
'username',
|
2013-03-16 22:13:35 +00:00
|
|
|
'path_info',
|
|
|
|
|
]
|
|
|
|
|
|
2012-11-25 20:46:45 +00:00
|
|
|
date_hierarchy = 'attempt_time'
|
2013-03-16 22:13:35 +00:00
|
|
|
|
2012-11-25 20:46:45 +00:00
|
|
|
fieldsets = (
|
|
|
|
|
(None, {
|
|
|
|
|
'fields': ('path_info',)
|
|
|
|
|
}),
|
|
|
|
|
('Meta Data', {
|
|
|
|
|
'fields': ('user_agent', 'ip_address', 'http_accept')
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
|
2013-03-16 22:13:35 +00:00
|
|
|
admin.site.register(AccessLog, AccessLogAdmin)
|