Blame view

src/Controller/Component/LdapAuthComponent.php 463 Bytes
e1f6c5b7   Alexandre   Version: 2.3.0.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
namespace App\Controller\Component;

use Cake\Controller\Component\AuthComponent;
use Cake\ORM\TableRegistry;

class LdapAuthComponent extends AuthComponent {


	public function connection() {
		try {	
			$login = $this->request->data['ldap'];
			$password = $this->request->data['password']; 
			
			return TableRegistry::get('LdapConnections')->ldapAuthentication($login, $password);	
		}
		catch(Exception $e) {
			return $e->getMessage();
		}
	}
	

}
?>