Skip to content

Commit

Permalink
Migration of connect function
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Jul 12, 2024
1 parent ff60e46 commit 657f23a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion htdocs/checkpassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
require __DIR__ . '/../vendor/autoload.php';

# Connect to LDAP
$ldap_connection = \Ltb\Ldap::connect($ldap_url, $ldap_starttls, $dn, $password, $ldap_network_timeout);
$ldap_connection = $ldapInstance->connect();

$ldap = $ldap_connection[0];
$result = $ldap_connection[1];
Expand Down
2 changes: 1 addition & 1 deletion htdocs/display.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
require_once("../lib/date.inc.php");

# Connect to LDAP
$ldap_connection = \Ltb\Ldap::connect($ldap_url, $ldap_starttls, $ldap_binddn, $ldap_bindpw, $ldap_network_timeout);
$ldap_connection = $ldapInstance->connect();

$ldap = $ldap_connection[0];
$result = $ldap_connection[1];
Expand Down
14 changes: 14 additions & 0 deletions htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@
$mail_smtp_timeout
);

#==============================================================================
# LDAP Config
#==============================================================================
$ldapInstance = new \Ltb\Ldap(
$ldap_url,
$ldap_starttls,
isset($ldap_binddn) ? $ldap_binddn : null,
isset($ldap_bindpw) ? $ldap_bindpw : null,
isset($ldap_network_timeout) ? $ldap_network_timeout : null,
$ldap_base,
null,
isset($ldap_krb5ccname) ? $ldap_krb5ccname : null
);

#==============================================================================
# Smarty
#==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion htdocs/lockaccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
require __DIR__ . '/../vendor/autoload.php';

# Connect to LDAP
$ldap_connection = \Ltb\Ldap::connect($ldap_url, $ldap_starttls, $ldap_binddn, $ldap_bindpw, $ldap_network_timeout);
$ldap_connection = $ldapInstance->connect();

$ldap = $ldap_connection[0];
$result = $ldap_connection[1];
Expand Down
2 changes: 1 addition & 1 deletion htdocs/resetpassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
require_once("../lib/hook.inc.php");

# Connect to LDAP
$ldap_connection = \Ltb\Ldap::connect($ldap_url, $ldap_starttls, $ldap_binddn, $ldap_bindpw, $ldap_network_timeout);
$ldap_connection = $ldapInstance->connect();

$ldap = $ldap_connection[0];
$result = $ldap_connection[1];
Expand Down
2 changes: 1 addition & 1 deletion htdocs/unlockaccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
require __DIR__ . '/../vendor/autoload.php';

# Connect to LDAP
$ldap_connection = \Ltb\Ldap::connect($ldap_url, $ldap_starttls, $ldap_binddn, $ldap_bindpw, $ldap_network_timeout);
$ldap_connection = $ldapInstance->connect();

$ldap = $ldap_connection[0];
$result = $ldap_connection[1];
Expand Down

0 comments on commit 657f23a

Please sign in to comment.