本文整理匯總了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);
}