|
Lines 34-39
Link Here
|
| 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 |
|
Lines 722-731
Link Here
|
| 722 |
return ( zone, ip, mac ) |
723 |
return ( zone, ip, mac ) |
| 723 |
|
724 |
|
| 724 |
def is_ip( ip ): |
725 |
def is_ip( ip ): |
| 725 |
_re = re.compile( '^[ 0-9 ]+\.[ 0-9 ]+\.[ 0-9 ]+\.[ 0-9 ]+$' ) |
726 |
# match IPv4 (0.0.0.0 is allowed) or IPv6 address (incl. IPv4-mapped IPv6) |
| 726 |
if _re.match ( ip ): |
727 |
try: |
| 727 |
return True |
728 |
ipaddr.IPAddress(ip) |
| 728 |
return False |
729 |
except ValueError: |
|
|
730 |
return False |
| 731 |
return True |
| 729 |
|
732 |
|
| 730 |
def is_alias( alias ): |
733 |
def is_alias( alias ): |
| 731 |
# hostname based upon RFC 952: <let>[*[<let-or-digit-or-hyphen>]<let-or-digit>] |
734 |
# hostname based upon RFC 952: <let>[*[<let-or-digit-or-hyphen>]<let-or-digit>] |
|
Lines 851-857
Link Here
|
| 851 |
|
854 |
|
| 852 |
if name: |
855 |
if name: |
| 853 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
856 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
| 854 |
dnsZone=self.lo.searchDn('(&(objectClass=dnsZone)(relativeDomainName=@)(!(zoneName=*.in-addr.arpa)))', base=domainPos.getBase(), scope='domain') |
857 |
dnsZone=self.lo.searchDn('(&(objectClass=dnsZone)(relativeDomainName=@)(!(zoneName=*.arpa)))', base=domainPos.getBase(), scope='domain') # IPv4 + IPv6 |
| 855 |
|
858 |
|
| 856 |
if self.save.get('x_choice_value_of_%s'%name,'') == '': |
859 |
if self.save.get('x_choice_value_of_%s'%name,'') == '': |
| 857 |
self.save.put('x_choice_value_of_%s'%name, 'None' ) |
860 |
self.save.put('x_choice_value_of_%s'%name, 'None' ) |
|
Lines 995-1001
Link Here
|
| 995 |
|
998 |
|
| 996 |
if name: |
999 |
if name: |
| 997 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
1000 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
| 998 |
dnsZone=self.lo.searchDn('(&(objectClass=dNSZone)(relativeDomainName=@)(zoneName=*.in-addr.arpa))', base=domainPos.getBase(), scope='domain') |
1001 |
dnsZone=self.lo.searchDn('(&(objectClass=dNSZone)(relativeDomainName=@)(zoneName=*.arpa))', base=domainPos.getBase(), scope='domain') # IPv4 + IPv6 |
| 999 |
|
1002 |
|
| 1000 |
if self.save.get('x_choice_value_of_%s'%name,'') == '': |
1003 |
if self.save.get('x_choice_value_of_%s'%name,'') == '': |
| 1001 |
self.save.put('x_choice_value_of_%s'%name, 'None' ) |
1004 |
self.save.put('x_choice_value_of_%s'%name, 'None' ) |
|
Lines 1513-1519
Link Here
|
| 1513 |
primary_group_choicelist=[] |
1516 |
primary_group_choicelist=[] |
| 1514 |
|
1517 |
|
| 1515 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
1518 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
| 1516 |
dnsZone=self.lo.searchDn('(&(objectClass=dnsZone)(relativeDomainName=@)(!(zoneName=*.in-addr.arpa)))', base=domainPos.getBase(), scope='domain') |
1519 |
dnsZone=self.lo.searchDn('(&(objectClass=dnsZone)(relativeDomainName=@)(!(zoneName=*.arpa)))', base=domainPos.getBase(), scope='domain') # IPv4 + IPv6 |
| 1517 |
|
1520 |
|
| 1518 |
if dnsZone: |
1521 |
if dnsZone: |
| 1519 |
groups=dnsZone |
1522 |
groups=dnsZone |
|
Lines 1548-1554
Link Here
|
| 1548 |
dns_entry_reverse_choicelist=[] |
1551 |
dns_entry_reverse_choicelist=[] |
| 1549 |
|
1552 |
|
| 1550 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
1553 |
domainPos=univention.admin.uldap.position(position.getDomain()) |
| 1551 |
dnsZone=self.lo.searchDn('(&(objectClass=dNSZone)(relativeDomainName=@)(zoneName=*.in-addr.arpa))', base=domainPos.getBase(), scope='domain') |
1554 |
dnsZone=self.lo.searchDn('(&(objectClass=dNSZone)(relativeDomainName=@)(zoneName=*.arpa))', base=domainPos.getBase(), scope='domain') # IPv4 + IPv6 |
| 1552 |
|
1555 |
|
| 1553 |
if dnsZone: |
1556 |
if dnsZone: |
| 1554 |
groups=dnsZone |
1557 |
groups=dnsZone |