Blame view

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

use Cake\Controller\Component\AuthComponent;
907bf7ec   Etienne Pallier   inutile
5
use Cake\Core\Exception\Exception;
e1f6c5b7   Alexandre   Version: 2.3.0.0
6
7
use Cake\ORM\TableRegistry;

63c3cb16   epallier   Nombreux petits b...
8
9
class LdapAuthComponent extends AuthComponent
{
e1f6c5b7   Alexandre   Version: 2.3.0.0
10

63c3cb16   epallier   Nombreux petits b...
11
12
13
    public function connection()
    {
        try {
2050f6d1   Etienne Pallier   mis à jour LDAP c...
14
            // Get login and password entered by the current user (who is trying to connect)
63c3cb16   epallier   Nombreux petits b...
15
16
            $login = $this->request->getData('ldap');
            $password = $this->request->getData('password');
aa52e447   Etienne Pallier   amelioration ldap...
17
            // calls src/Model/Table/LdapConnectionsTable.php/ldapAuthentication()
31b4e425   Etienne Pallier   ldap connexion cl...
18
            return TableRegistry::get('LdapConnections')->ldapAuthentication($login, $password);
63c3cb16   epallier   Nombreux petits b...
19
20
21
22
        } catch (Exception $e) {
            return $e->getMessage();
        }
    }
e1f6c5b7   Alexandre   Version: 2.3.0.0
23
24
}
?>