浏览代码

Added function to check if user is a posixAccount

Théo Ertzscheid 2 年之前
父节点
当前提交
e46e00b522
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      funcs

+ 5 - 0
funcs

@@ -11,3 +11,8 @@ group_exists() {
 	res=$(ldapsearch -x -LLL -b $GROUPSDN -D $BINDDN -w $BINDPW "(&(cn=$1)(objectClass=groupOfNames))" | grep cn: | cut -f2 -d' ')
 	[ -n "$res" ]
 }
+
+is_posix() {
+	res=$(ldapsearch -x -LLL -b $PEOPLEDN -D $BINDDN -w $BINDPW "(&(uid=$1)(objectClass=posixAccount))" | grep uid: | cut -f2 -d' ')
+	[ -n "$res" ]
+}