Browse Source

Added LDAP login function

feature/ldap
dries peeters 8 years ago committed by Chocobozzz
parent
commit
848f7c7b43
  1. 17
      include/functions.php

17
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;
}
}
?>

Loading…
Cancel
Save