Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use adLDAP\adLDAP;
- require_once(dirname(__FILE__) . '/../adLDAP/adLDAP.php');
- session_start();
- $adldap = new adLDAP(
- array(
- 'base_dn'=>'DC=capelps,DC=local',
- 'account_suffix'=>'@capelps.local',
- 'domain_controllers'=>array('STUDENT-DC.capelps.local'),
- 'use_ssl'=>true
- )
- );
- $username = "administrator";
- $password = "mypassword";
- $authUser = $adldap->user()->authenticate($username, $password);
- if ($authUser == true) {
- echo "User authenticated successfully";
- }
- else {
- echo "User authentication unsuccessful";
- }
- $usernames = $adldap->user()->all();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement