Example #1
0
def main():
  """Main function.
  """
  args = parseargs()
  myldap = LdapUtil(args)
  if args.groups:
    groups = myldap.getgroups()
    for group in groups:
      print 'group[%s] = %s'% (group, groups[group])
  elif args.add:
    myldap.adduser(filename = args.filename, localgid = args.group)
  elif args.delete:
    myldap.deluser(args.filename)
Example #2
0
def main():
  """Main function.
  """
  args = parseargs()
  myldap = LdapUtil(args.uri , args.basedn, args.basep, args.baseg, args.binddn,
                    args.passwd, args.verbose, args.test)
  if args.groups:
    groups = myldap.getgroups()
    for group in groups:
      print 'group[%s] = %s'% (group, groups[group])
  elif args.add:
    myldap.adduser(filename = args.filename, localgid = args.group)
  elif args.delete:
    myldap.deluser(args.filename)