mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 19:33:11 +00:00
Ajoute un champ dialup access
This commit is contained in:
parent
e968f2b12f
commit
d7908e7e5d
4 changed files with 70 additions and 2 deletions
21
users/migrations/0052_ldapuser_shadowexpire.py
Normal file
21
users/migrations/0052_ldapuser_shadowexpire.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
21
users/migrations/0053_auto_20170626_2105.py
Normal file
21
users/migrations/0053_auto_20170626_2105.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
21
users/migrations/0054_auto_20170626_2219.py
Normal file
21
users/migrations/0054_auto_20170626_2219.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
|
@ -361,6 +361,10 @@ class User(AbstractBaseUser):
|
||||||
user_ldap.sambat_nt_password = self.pwd_ntlm.upper()
|
user_ldap.sambat_nt_password = self.pwd_ntlm.upper()
|
||||||
if self.shell:
|
if self.shell:
|
||||||
user_ldap.login_shell = self.shell.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:
|
if access_refresh:
|
||||||
user_ldap.dialupAccess = str(self.has_access)
|
user_ldap.dialupAccess = str(self.has_access)
|
||||||
if mac_refresh:
|
if mac_refresh:
|
||||||
|
@ -599,7 +603,7 @@ class LdapUser(ldapdb.models.Model):
|
||||||
"""
|
"""
|
||||||
# LDAP meta-data
|
# LDAP meta-data
|
||||||
base_dn = LDAP['base_user_dn']
|
base_dn = LDAP['base_user_dn']
|
||||||
object_classes = ['inetOrgPerson','top','posixAccount','sambaSamAccount','radiusprofile']
|
object_classes = ['inetOrgPerson','top','posixAccount','sambaSamAccount','radiusprofile', 'shadowAccount']
|
||||||
|
|
||||||
# attributes
|
# attributes
|
||||||
gid = ldapdb.models.fields.IntegerField(db_column='gidNumber')
|
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)
|
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)
|
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)
|
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):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
Loading…
Reference in a new issue