Browse Source

Fix stupid VPN/LDAP mistakes

Baptiste Jonglez 11 years ago
parent
commit
610c69270c
1 changed files with 4 additions and 4 deletions
  1. 4 4
      coin/vpn/models.py

+ 4 - 4
coin/vpn/models.py

@@ -30,7 +30,7 @@ class VPNSubscription(CoinLdapSyncModel):
 
     objects = NetManager()
 
-    def get_subnets(version):
+    def get_subnets(self, version):
         subnets = self.administrative_subscription.ip_subnet.all()
         return [subnet for subnet in subnets if subnet.inet.version == version]
 
@@ -46,7 +46,7 @@ class VPNSubscription(CoinLdapSyncModel):
         config.ipv4_endpoint = str(self.ipv4_endpoint)
         config.ipv6_endpoint = str(self.ipv6_endpoint)
         config.ranges_v4 = [str(s) for s in self.get_subnets(4)]
-        config.ranges_v4 = [str(s) for s in self.get_subnets(6)]
+        config.ranges_v6 = [str(s) for s in self.get_subnets(6)]
         config.save()
 
     def delete_from_ldap(self):
@@ -86,12 +86,12 @@ class VPNSubscription(CoinLdapSyncModel):
 
 class LdapVPNConfig(ldapdb.models.Model):
     # TODO: déplacer ligne suivante dans settings.py
-    base_dn = "ou=vpn,ou=unix,o=ILLYSE,l=Villeurbanne,st=RHA,c=FR"
+    base_dn = "ou=vpn,o=ILLYSE,l=Villeurbanne,st=RHA,c=FR"
     object_classes = ['person', 'organizationalPerson', 'inetOrgPerson',
                       'top', 'radiusprofile']
 
     login = CharField(db_column='cn', primary_key=True, max_length=255)
-    sn = CharField(db_column='sn', primary_key=True, max_length=255)
+    sn = CharField(db_column='sn', max_length=255)
     password = CharField(db_column='userPassword', max_length=255)
     active = CharField(db_column='dialupAccess', max_length=3)
     ipv4_endpoint = CharField(db_column='radiusFramedIPAddress', max_length=16)