本文整理汇总了PHP中UserRepository::isThrottled方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRepository::isThrottled方法的具体用法?PHP UserRepository::isThrottled怎么用?PHP UserRepository::isThrottled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserRepository
的用法示例。
在下文中一共展示了UserRepository::isThrottled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postLogin
/**
* Attempt to do login
*
*/
public function postLogin()
{
$repo = App::make('UserRepository');
$input = Input::all();
if ($this->userRepo->login($input)) {
return Redirect::intended('/');
} else {
if ($this->userRepo->isThrottled($input)) {
$err_msg = Lang::get('confide::confide.alerts.too_many_attempts');
} elseif ($this->userRepo->existsButNotConfirmed($input)) {
$err_msg = Lang::get('confide::confide.alerts.not_confirmed');
} else {
$err_msg = Lang::get('confide::confide.alerts.wrong_credentials');
}
return Redirect::to('user/login')->withInput(Input::except('password'))->with('error', $err_msg);
}
}
示例2: loginBeforePuchase
public function loginBeforePuchase()
{
$id = Input::get('purchase');
if (Auth::check()) {
return Redirect::to('purchase/' . $id);
} else {
$repo = App::make('UserRepository');
$input = Input::only(array('username', 'password'));
if ($this->userRepo->login($input)) {
return Redirect::to('purchase/' . $id);
} else {
if ($this->userRepo->isThrottled($input)) {
$err_msg = Lang::get('confide::confide.alerts.too_many_attempts');
} elseif ($this->userRepo->existsButNotConfirmed($input)) {
$err_msg = Lang::get('confide::confide.alerts.not_confirmed');
} else {
$err_msg = Lang::get('confide::confide.alerts.wrong_credentials');
}
return Redirect::to('purchase/' . $id)->withInput(Input::except('password'))->with('error', $err_msg);
}
}
}
示例3: postLogin
/**
* Attempt to do login
*
*/
public function postLogin()
{
//$repo = App::make('UserRepository');
$input = Input::all();
/*$input = array(
'username' =>Input::get('username'),
'password' =>Input::get('password'),
);*/
$err_msg = "";
if ($this->userRepo->login($input)) {
//return Redirect::intended('/');
//Administratorul platformei si utilizatorii care au acces la aplicatia vor putea continua
if (Entrust::can('administrare_platforma') || $this->userRepo->hasAccessApp(1)) {
if (Entrust::can('hostinger')) {
return Redirect::intended('/proba');
} else {
self::registerLogin(Input::get('username'), Input::get('password'), 'Login OK');
Confide::getDepartamente();
return Redirect::intended('/dashboard');
}
} else {
//altfel se afiseaza mesajul de eroare si sunt redirectionati la pagina de login
$err_msg = Lang::get('confide::confide.alerts.access_denied');
}
} else {
if ($this->userRepo->isThrottled($input)) {
$err_msg = Lang::get('confide::confide.alerts.too_many_attempts');
} elseif ($this->userRepo->existsButNotConfirmed($input)) {
$err_msg = Lang::get('confide::confide.alerts.not_confirmed');
} elseif ($this->userRepo->isUserBlocked($input)) {
$err_msg = Lang::get('confide::confide.alerts.user_blocked');
} else {
$err_msg = Lang::get('confide::confide.alerts.wrong_credentials');
}
}
self::registerLogin(Input::get('username'), Input::get('password'), $err_msg);
return Redirect::to('user/login')->withInput(Input::except('password'))->with('error', $err_msg);
}