Blame view

src/Controller/Component/LdapAuthComponent.php 918 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()
091b1d3d   Etienne Pallier   ldap bugfix en ur...
18
19
            //return TableRegistry::get('LdapConnections')->ldapAuthentication($login, $password);
            return TableRegistry::getTableLocator()->get('LdapConnections')->ldapAuthentication($login, $password);
63c3cb16   epallier   Nombreux petits b...
20
        } catch (Exception $e) {
091b1d3d   Etienne Pallier   ldap bugfix en ur...
21
22
23
            var_dump($e->getMessage());
            //return $e->getMessage();
            return FALSE;
63c3cb16   epallier   Nombreux petits b...
24
25
        }
    }
e1f6c5b7   Alexandre   Version: 2.3.0.0
26
27
}
?>