From 848f7c7b43ac79821a88075abc0926b5695152c1 Mon Sep 17 00:00:00 2001 From: dries peeters Date: Mon, 9 Jan 2017 16:37:45 +0100 Subject: [PATCH] Added LDAP login function --- include/functions.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/functions.php b/include/functions.php index 8729365..c452866 100644 --- a/include/functions.php +++ b/include/functions.php @@ -42,4 +42,21 @@ return password_verify($pass, $hash); } +//login with LDAP + +function loginLDAP($serverFQDN, $username, $password) +{ + //connect to LDAP server or AD server. Both work + $ldap = ldap_connect($serverFQDN); + //check if user exists if works return true if not return false + if ($bind = ldap_bind($ldap, $username, $password)) + { + return true; + } + else + { + return false; + } +} + ?>