2021-01-10 16:49:23 +00:00
|
|
|
from django.contrib import admin
|
|
|
|
|
2021-02-10 10:06:09 +00:00
|
|
|
from .models import (LdapServiceUser, LdapServiceUserGroup, LdapUser,
|
|
|
|
LdapUserGroup)
|
|
|
|
|
2021-01-10 16:49:23 +00:00
|
|
|
|
|
|
|
class LdapUserAdmin(admin.ModelAdmin):
|
|
|
|
"""LdapUser Admin view. Can't change password, manage
|
|
|
|
by User General model.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
Django ModelAdmin: Apply on django ModelAdmin
|
|
|
|
|
|
|
|
"""
|
2021-02-10 10:06:09 +00:00
|
|
|
|
2021-01-10 16:49:23 +00:00
|
|
|
list_display = ("name", "uidNumber", "login_shell")
|
|
|
|
exclude = ("user_password", "sambat_nt_password")
|
|
|
|
search_fields = ("name",)
|
|
|
|
|
|
|
|
|
|
|
|
class LdapServiceUserAdmin(admin.ModelAdmin):
|
|
|
|
"""LdapServiceUser Admin view. Can't change password, manage
|
|
|
|
by User General model.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
Django ModelAdmin: Apply on django ModelAdmin
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
list_display = ("name",)
|
|
|
|
exclude = ("user_password",)
|
|
|
|
search_fields = ("name",)
|
|
|
|
|
|
|
|
|
|
|
|
class LdapUserGroupAdmin(admin.ModelAdmin):
|
|
|
|
"""LdapUserGroup Admin view.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
Django ModelAdmin: Apply on django ModelAdmin
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
list_display = ("name", "members", "gid")
|
|
|
|
search_fields = ("name",)
|
|
|
|
|
|
|
|
|
|
|
|
class LdapServiceUserGroupAdmin(admin.ModelAdmin):
|
|
|
|
"""LdapServiceUserGroup Admin view.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
Django ModelAdmin: Apply on django ModelAdmin
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
list_display = ("name",)
|
|
|
|
search_fields = ("name",)
|
|
|
|
|
|
|
|
|
|
|
|
admin.site.register(LdapUser, LdapUserAdmin)
|
|
|
|
admin.site.register(LdapUserGroup, LdapUserGroupAdmin)
|
|
|
|
admin.site.register(LdapServiceUser, LdapServiceUserAdmin)
|
|
|
|
admin.site.register(LdapServiceUserGroup, LdapServiceUserGroupAdmin)
|