Commit d7908e7e authored by chibrac's avatar chibrac

Ajoute un champ dialup access

parent e968f2b1
# -*- 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),
),
]
# -*- 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),
),
]
# -*- 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),
),
]
......@@ -360,7 +360,11 @@ class User(AbstractBaseUser):
user_ldap.user_password = self.password[:6] + self.password[7:]
user_ldap.sambat_nt_password = self.pwd_ntlm.upper()
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:
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment