Browse Source

Added function to check if user is a posixAccount

Théo Ertzscheid 2 years ago
parent
commit
e46e00b522
1 changed files with 5 additions and 0 deletions
  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" ]
+}