mirror of
https://github.com/ThomasGsp/HyperProxmox.git
synced 2025-03-09 15:40:18 +00:00
Massive import web manager
This commit is contained in:
parent
951853fd34
commit
def9f77707
2 changed files with 23 additions and 0 deletions
6
code/web/www/pages/connectors/ldap.conf.sample.php
Normal file
6
code/web/www/pages/connectors/ldap.conf.sample.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
// COPY TO ldap.conf.php
|
||||
$ldapserver = "ldap.yourserver.fr";
|
||||
$ldapServerPort = 389;
|
||||
$baseDN = "dc=yourserver,dc=fr";
|
||||
$ldapOrgUnit="ou=Users";
|
17
code/web/www/pages/connectors/ldap.php
Normal file
17
code/web/www/pages/connectors/ldap.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
function ldaplogin($username, $password)
|
||||
{
|
||||
require 'ldap.conf.php';
|
||||
$ldaprdn = 'cn='.$username.','.$ldapOrgUnit.','.$baseDN;
|
||||
$ldap = @ldap_connect($ldapserver, $ldapServerPort);
|
||||
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
$bind = @ldap_bind($ldap, $ldaprdn, $password);
|
||||
if ($bind)
|
||||
{
|
||||
ldap_close($ldap);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue