/** * * @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; }
public function validate($userId, $challenge, $response) { $user = Manager::getModelMAD('user'); $user = $user->getByLogin($userId); return $user->validatePasswordMD5($challenge, $response); }
public function getUser() { if ($this->idUser) { $user = Manager::getModelMAD('user'); $user->getById($this->idUser); return $user; } return NULL; }
public function getGroupsAllowed($trans, $action = A_ACCESS) { $transaction = Manager::getModelMAD('transaction'); $transaction->getByName($trans); return $transaction->getGroupsAllowed($action); }