Blame view

src/Controller/Component/LdapAuthComponent.php 515 Bytes
e1f6c5b7   Alexandre   Version: 2.3.0.0
1
2
3
4
<?php
namespace App\Controller\Component;

use Cake\Controller\Component\AuthComponent;
a0fefb3d   Thibaud Ajas   bugfixes suite au...
5
use Cake\Core\Exception\Exception;
e1f6c5b7   Alexandre   Version: 2.3.0.0
6
7
8
9
use Cake\ORM\TableRegistry;

class LdapAuthComponent extends AuthComponent {

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