Blame view

src/Controller/Component/LdapAuthComponent.php 474 Bytes
e1f6c5b7   Alexandre   Version: 2.3.0.0
1
2
3
4
5
6
7
8
<?php
namespace App\Controller\Component;

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

class LdapAuthComponent extends AuthComponent {

e1f6c5b7   Alexandre   Version: 2.3.0.0
9
10
11
12
	public function connection() {
		try {	
			$login = $this->request->data['ldap'];
			$password = $this->request->data['password']; 
c1cbc061   Thibaud Ajas   Bugfixes, correct...
13
14
			$resp = TableRegistry::get('LdapConnections')->ldapAuthentication($login, $password);
			return $resp;
e1f6c5b7   Alexandre   Version: 2.3.0.0
15
16
17
18
19
20
		}
		catch(Exception $e) {
			return $e->getMessage();
		}
	}
	
e1f6c5b7   Alexandre   Version: 2.3.0.0
21
22
}
?>