Authentication of users from a specific ldap active directory group

I want only a group (of teachers) to have access to a specific webpage on my website.

This page is for teachers only.

Inside the active directory we have a group called the “faculty”

Here is a snippet of code that I have to run to authenticate users through the ldap / active directory, but I only want to identify users in the teacher group.

$ldap = ldap_connect("ldap.domain.com")
if($bind = ldap_bind($ldap, $_POST['username'], $_POST['password'])) {
  // log them in!
} else {
  // error message
}
+3
source share
1 answer

AD , , cn = faculty, ou = whatever, dc = acme, dc = com , . , , , .

, , .

+1

Source: https://habr.com/ru/post/1716700/


All Articles