mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
git-svn-id: http://www.observium.org/svn/observer/trunk@991 61d68cd4-352d-0410-923a-c4978735b2b8
64 lines
1.1 KiB
PHP
64 lines
1.1 KiB
PHP
<?php
|
|
|
|
function authenticate($username,$password)
|
|
{
|
|
global $config;
|
|
|
|
$ds=@ldap_connect($config['auth_ldap_server'],$config['auth_ldap_port']);
|
|
if ($ds)
|
|
{
|
|
if ($config['auth_ldap_version'])
|
|
{
|
|
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $config['auth_ldap_version']);
|
|
}
|
|
if (ldap_bind($ds, $config['auth_ldap_prefix'] . $username . $config['auth_ldap_suffix'], $password))
|
|
{
|
|
if (!$config['auth_ldap_group'])
|
|
{
|
|
return 1;
|
|
}
|
|
else
|
|
{
|
|
if (ldap_compare($ds,$config['auth_ldap_group'],'memberUid',$username))
|
|
{
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
# FIXME return a warning that LDAP couldn't connect?
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
function passwordscanchange()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
function changepassword($username,$newpassword)
|
|
{
|
|
# Not supported (for now)
|
|
}
|
|
|
|
function auth_usermanagement()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
function adduser($username, $password, $level, $email = "", $realname = "")
|
|
{
|
|
# Not supported
|
|
return 0;
|
|
}
|
|
|
|
function user_exists($username)
|
|
{
|
|
return 0; # FIXME to be implemented
|
|
}
|
|
|
|
|
|
?>
|