Skip to content
Snippets Groups Projects
Commit fbfed060 authored by Christian Dresen's avatar Christian Dresen
Browse files

Refactored in different Apps

parent 86fda74a
No related branches found
No related tags found
No related merge requests found
Showing
with 50 additions and 0 deletions
File moved
File moved
File moved
File moved
File moved
File moved
from django.contrib import admin
# Register your models here.
File moved
from django.db import models
from ldapdb.models.fields import CharField, IntegerField, ListField
import ldapdb.models
from django.forms import ModelForm, HiddenInput
from django import forms
from django.utils import timezone
class PasswordResetToken(models.Model):
user = models.CharField(max_length=100)
email = models.CharField(max_length=100)
hash = models.CharField(max_length=100)
created = models.DateTimeField(auto_now_add=True)
# LDAP
class LdapUser(ldapdb.models.Model):
base_dn = "ou=user,dc=warpzone,dc=ms"
object_classes = ['posixAccount', 'shadowAccount', 'uidObject', 'account']
uid = CharField(db_column='uid', unique=True, primary_key=True)
email = CharField(db_column='description', max_length=200)
password = CharField(db_column='Password')
def __str__(self):
return self.uid
def __unicode__(self):
return self.uid
class LdapGroup(ldapdb.models.Model):
base_dn = "ou=groups,dc=nodomain,dc=org"
object_classes = ['posixGroup']
gid = IntegerField(db_column='gidNumber', unique=True)
name = CharField(db_column='cn', max_length=200, primary_key=True)
members = ListField(db_column='memberUid')
def __str__(self):
return self.name
def __unicode__(self):
return self.name
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment