Esempio n. 1
0
 /**
  * 
  * @param int $userId
  * @param string $challenge
  * @param string $response
  * @return boolean
  */
 public function validate($userId, $challenge, $response)
 {
     $user = Manager::getModelMAD('user');
     $user->getByLogin($userId);
     $login = $user->getLoginAtivo();
     mdump("Ldap validating userid = {$userId} - login ativo = {$login}");
     $filter = "uid={$login}";
     mdump("Ldap filter = {$filter}");
     $mldap = new \MLdap();
     $info = $mldap->search($filter, array('userPassword'));
     mdump($info);
     if ($info['count'] == 0) {
         return false;
     }
     $passLdap = trim($info[0]['userpassword'][0]);
     $hash_pass = md5(trim($login) . ':' . MLdap::ldapToMd5($passLdap) . ":" . $challenge);
     return $hash_pass == $response;
 }
Esempio n. 2
0
 public function validate($userId, $challenge, $response)
 {
     $user = Manager::getModelMAD('user');
     $user = $user->getByLogin($userId);
     return $user->validatePasswordMD5($challenge, $response);
 }
Esempio n. 3
0
 public function getUser()
 {
     if ($this->idUser) {
         $user = Manager::getModelMAD('user');
         $user->getById($this->idUser);
         return $user;
     }
     return NULL;
 }
Esempio n. 4
0
 public function getGroupsAllowed($trans, $action = A_ACCESS)
 {
     $transaction = Manager::getModelMAD('transaction');
     $transaction->getByName($trans);
     return $transaction->getGroupsAllowed($action);
 }