本文整理汇总了PHP中Manager::getModelMAD方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::getModelMAD方法的具体用法?PHP Manager::getModelMAD怎么用?PHP Manager::getModelMAD使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager::getModelMAD方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
/**
*
* @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;
}
示例2: checkLogin
public function checkLogin()
{
Manager::logMessage('[LOGIN] Running CheckLogin');
// if not checking logins, we are done
if (!MUtil::getBooleanValue(Manager::$conf['login']['check'])) {
Manager::logMessage('[LOGIN] I am not checking login today...');
return true;
}
// we have a session login?
$session = Manager::getSession();
$login = $session->getValue('__sessionLogin');
$loginMiolo = $_SESSION['login'];
// Miolo compatibility
if ($loginMiolo) {
if (is_null($login)) {
// se ainda não tem login no Maestro...
$user = Manager::getModelMAD('user');
$user->getByLogin($loginMiolo->id);
$profile = $user->getProfileAtual();
$user->getByProfile($profile);
$login = new MLogin($user);
$this->setLogin($login);
Manager::logMessage("[LOGIN] Authenticated {$loginMiolo->idkey} from Miolo");
}
}
if ($login) {
if ($login->getLogin()) {
Manager::logMessage('[LOGIN] Using session login: ' . $login->getLogin());
$this->setLogin($login);
return true;
}
}
// if we have already a login, assume it is valid and return
if ($this->login instanceof MLogin) {
Manager::logMessage('[LOGIN] Using existing login:' . $this->login->getLogin());
return true;
}
Manager::logMessage('[LOGIN] No Login but Login required!');
return false;
}
示例3: validate
public function validate($userId, $challenge, $response)
{
$user = Manager::getModelMAD('user');
$user = $user->getByLogin($userId);
return $user->validatePasswordMD5($challenge, $response);
}
示例4: getGroupsAllowed
public function getGroupsAllowed($trans, $action = A_ACCESS)
{
$transaction = Manager::getModelMAD('transaction');
$transaction->getByName($trans);
return $transaction->getGroupsAllowed($action);
}