示例#1
0
文件: groupapi.py 项目: yiker/ldapapi
def group_del(groupname):
    if is_group_exist(groupname) == False:
        ret = 1
        result = {'msg': 'group doesn\'t exists'}
    else:
        dn = group_dn(groupname)
        result = ldap_del(dn)
        if result is not None:
            ret = 0
        else:
            ret = 1000
    return dict({'ret': ret, 'ldapresult': result})
示例#2
0
def group_del(groupname):
    if is_group_exist(groupname) == False:
        ret = 1
        result = {"msg": "group doesn't exists"}
    else:
        dn = group_dn(groupname)
        result = ldap_del(dn)
        if result is not None:
            ret = 0
        else:
            ret = 1000
    return dict({"ret": ret, "ldapresult": result})
示例#3
0
文件: userapi.py 项目: yiker/ldapapi
def user_del(username):
	if is_user_exist(username) == False:
		ret = 1
		result = {'msg':'user doesn\'t exists'}
	else:
		dn = user_dn(username)
		result = ldap_del(dn)
		if result is not None:
			ret = 0
		else:
			ret = 1000
	return dict({'ret':ret,'ldapresult':result})