|
34 |
from local import _ |
34 |
from local import _ |
35 |
from syntax import * |
35 |
from syntax import * |
36 |
|
36 |
|
|
|
37 |
import ipaddr # IPv6 |
37 |
import univention.debug |
38 |
import univention.debug |
38 |
import univention.admin.uldap |
39 |
import univention.admin.uldap |
39 |
import univention.admin.modules |
40 |
import univention.admin.modules |
|
726 |
return ( zone, ip, mac ) |
727 |
return ( zone, ip, mac ) |
727 |
|
728 |
|
728 |
def is_ip( ip ): |
729 |
def is_ip( ip ): |
729 |
_re = re.compile( '^[ 0-9 ]+\.[ 0-9 ]+\.[ 0-9 ]+\.[ 0-9 ]+$' ) |
730 |
# match IPv4 (0.0.0.0 is allowed) or IPv6 address (incl. IPv4-mapped IPv6) |
730 |
if _re.match ( ip ): |
731 |
try: |
731 |
return True |
732 |
ipaddr.IPAddress(ip) |
732 |
return False |
733 |
except ValueError: |
|
|
734 |
return False |
735 |
return True |
733 |
|
736 |
|
734 |
def is_alias( alias ): |
737 |
def is_alias( alias ): |
735 |
# hostname based upon RFC 952: <let>[*[<let-or-digit-or-hyphen>]<let-or-digit>] |
738 |
# hostname based upon RFC 952: <let>[*[<let-or-digit-or-hyphen>]<let-or-digit>] |
|
855 |
|
858 |
|
856 |
if name: |
859 |
if name: |
857 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
860 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
858 |
dnsZone=self.lo.searchDn('(&(objectClass=dnsZone)(relativeDomainName=@)(!(zoneName=*.in-addr.arpa)))', base=domainPos.getBase(), scope='domain') |
861 |
dnsZone=self.lo.searchDn('(&(objectClass=dnsZone)(relativeDomainName=@)(!(zoneName=*.arpa)))', base=domainPos.getBase(), scope='domain') # IPv4 + IPv6 |
859 |
|
862 |
|
860 |
if self.save.get('x_choice_value_of_%s'%name,'') == '': |
863 |
if self.save.get('x_choice_value_of_%s'%name,'') == '': |
861 |
self.save.put('x_choice_value_of_%s'%name, 'None' ) |
864 |
self.save.put('x_choice_value_of_%s'%name, 'None' ) |
|
999 |
|
1002 |
|
1000 |
if name: |
1003 |
if name: |
1001 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
1004 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
1002 |
dnsZone=self.lo.searchDn('(&(objectClass=dNSZone)(relativeDomainName=@)(zoneName=*.in-addr.arpa))', base=domainPos.getBase(), scope='domain') |
1005 |
dnsZone=self.lo.searchDn('(&(objectClass=dNSZone)(relativeDomainName=@)(zoneName=*.arpa))', base=domainPos.getBase(), scope='domain') # IPv4 + IPv6 |
1003 |
|
1006 |
|
1004 |
if self.save.get('x_choice_value_of_%s'%name,'') == '': |
1007 |
if self.save.get('x_choice_value_of_%s'%name,'') == '': |
1005 |
self.save.put('x_choice_value_of_%s'%name, 'None' ) |
1008 |
self.save.put('x_choice_value_of_%s'%name, 'None' ) |
|
1517 |
primary_group_choicelist=[] |
1520 |
primary_group_choicelist=[] |
1518 |
|
1521 |
|
1519 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
1522 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
1520 |
dnsZone=self.lo.searchDn('(&(objectClass=dnsZone)(relativeDomainName=@)(!(zoneName=*.in-addr.arpa)))', base=domainPos.getBase(), scope='domain') |
1523 |
dnsZone=self.lo.searchDn('(&(objectClass=dnsZone)(relativeDomainName=@)(!(zoneName=*.arpa)))', base=domainPos.getBase(), scope='domain') # IPv4 + IPv6 |
1521 |
|
1524 |
|
1522 |
if dnsZone: |
1525 |
if dnsZone: |
1523 |
groups=dnsZone |
1526 |
groups=dnsZone |
|
1552 |
dns_entry_reverse_choicelist=[] |
1555 |
dns_entry_reverse_choicelist=[] |
1553 |
|
1556 |
|
1554 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
1557 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
1555 |
dnsZone=self.lo.searchDn('(&(objectClass=dNSZone)(relativeDomainName=@)(zoneName=*.in-addr.arpa))', base=domainPos.getBase(), scope='domain') |
1558 |
dnsZone=self.lo.searchDn('(&(objectClass=dNSZone)(relativeDomainName=@)(zoneName=*.arpa))', base=domainPos.getBase(), scope='domain') # IPv4 + IPv6 |
1556 |
|
1559 |
|
1557 |
if dnsZone: |
1560 |
if dnsZone: |
1558 |
groups=dnsZone |
1561 |
groups=dnsZone |