UUID_FORMAT = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
-EmailCheck = re.compile("^([^ <>@]+@[^ ,<>@]+)?$")
+EmailCheck = re.compile("^([^ <>@]+@[^ ,<>@]+)(,\s*([^ <>@]+@[^ ,<>@]+))*$")
BSMTPCheck = re.compile(".*mx 0 (master)\.debian\.org\..*",re.DOTALL)
PurposeHostField = re.compile(r".*\[\[([\*\-]?[a-z0-9.\-]*)(?:\|.*)?\]\]")
IsV6Addr = re.compile("^[a-fA-F0-9:]+$")
supgroups=[]
addGroups(supgroups, account['supplementaryGid'], account['uid'], current_host)
for g in supgroups:
- if allowed.has_key(g):
+ if g in allowed:
return True
return False
F = open(File, "w", 0600)
os.umask(OldMask)
- root = Element('domain')
- root.attrib['name'] = "$${sip_profile}"
+ root = Element('include')
for a in accounts:
if not 'voipPassword' in a: continue
params.append(param)
param.attrib['name'] = "a1-hash"
param.attrib['value'] = "%s" % (Pass)
+ variables = Element('variables')
+ user.append(variables)
+ variable = Element('variable')
+ variable.attrib['name'] = "toll_allow"
+ variable.attrib['value'] = "domestic,international,local"
+ variables.append(variable)
F.write("%s" % (prettify(root)))
# Write out the position for each user
for a in accounts:
if not a.is_active_user(): continue
+ if a.is_guest_account(): continue
if not 'privateSub' in a: continue
try:
Line = "%s"%(a['privateSub'])
for a in accounts:
if not 'dnsZoneEntry' in a: continue
if not a.is_active_user() and not isRoleAccount(a): continue
+ if a.is_guest_account(): continue
try:
F.write("; %s\n"%(a.email_address()))
continue
generate_host(host, global_dir, accounts, ssh_userkeys)
-def generate_host(host, global_dir, accounts, ssh_userkeys):
+def generate_host(host, global_dir, all_accounts, ssh_userkeys):
current_host = host[1]['hostname'][0]
OutDir = global_dir + current_host + '/'
if not os.path.isdir(OutDir):
ExtraList[extra.upper()] = True
if GroupList != {}:
- accounts = filter(lambda x: IsInGroup(x, GroupList, current_host), accounts)
+ accounts = filter(lambda x: IsInGroup(x, GroupList, current_host), all_accounts)
DoLink(global_dir, OutDir, "debianhosts")
DoLink(global_dir, OutDir, "ssh_known_hosts")
parser.add_option("-g", "--generatedir", dest="generatedir", metavar="DIR",
help="Output directory.")
parser.add_option("-f", "--force", dest="force", action="store_true",
- help="Force generation, even if not update to LDAP has happened.")
+ help="Force generation, even if no update to LDAP has happened.")
(options, args) = parser.parse_args()
if len(args) > 0: