8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

Ajoute un champ dialup access

This commit is contained in:
chibrac 2017-06-26 22:23:58 +02:00
parent e968f2b12f
commit d7908e7e5d
4 changed files with 70 additions and 2 deletions

View file

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-26 18:51
from __future__ import unicode_literals
from django.db import migrations
import ldapdb.models.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0051_user_telephone'),
]
operations = [
migrations.AddField(
model_name='ldapuser',
name='shadowexpire',
field=ldapdb.models.fields.CharField(blank=True, db_column='shadowExpire', max_length=200, null=True),
),
]

View file

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-26 19:05
from __future__ import unicode_literals
from django.db import migrations
import ldapdb.models.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0052_ldapuser_shadowexpire'),
]
operations = [
migrations.AlterField(
model_name='ldapuser',
name='shadowexpire',
field=ldapdb.models.fields.IntegerField(blank=True, db_column='shadowExpire', null=True),
),
]

View file

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-26 20:19
from __future__ import unicode_literals
from django.db import migrations
import ldapdb.models.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0053_auto_20170626_2105'),
]
operations = [
migrations.AlterField(
model_name='ldapuser',
name='shadowexpire',
field=ldapdb.models.fields.CharField(blank=True, db_column='shadowExpire', max_length=200, null=True),
),
]

View file

@ -361,6 +361,10 @@ class User(AbstractBaseUser):
user_ldap.sambat_nt_password = self.pwd_ntlm.upper()
if self.shell:
user_ldap.login_shell = self.shell.shell
if self.state == self.STATE_DISABLED:
user_ldap.shadowexpire = str(0)
else:
user_ldap.shadowexpire = None
if access_refresh:
user_ldap.dialupAccess = str(self.has_access)
if mac_refresh:
@ -599,7 +603,7 @@ class LdapUser(ldapdb.models.Model):
"""
# LDAP meta-data
base_dn = LDAP['base_user_dn']
object_classes = ['inetOrgPerson','top','posixAccount','sambaSamAccount','radiusprofile']
object_classes = ['inetOrgPerson','top','posixAccount','sambaSamAccount','radiusprofile', 'shadowAccount']
# attributes
gid = ldapdb.models.fields.IntegerField(db_column='gidNumber')
@ -617,6 +621,7 @@ class LdapUser(ldapdb.models.Model):
user_password = ldapdb.models.fields.CharField(db_column='userPassword', max_length=200, blank=True, null=True)
sambat_nt_password = ldapdb.models.fields.CharField(db_column='sambaNTPassword', max_length=200, blank=True, null=True)
macs = ldapdb.models.fields.ListField(db_column='radiusCallingStationId', max_length=200, blank=True, null=True)
shadowexpire = ldapdb.models.fields.CharField(db_column='shadowExpire', blank=True, null=True)
def __str__(self):
return self.name