HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/somerenslust.komma.pro/app/KommaApp/Auth/LoginController.php
<?php

namespace App\KommaApp\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;

class LoginController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles authenticating users for the application and
    | redirecting them to your home screen. The controller uses a trait
    | to conveniently provide its functionality to your applications.
    |
    */

    /**
     * @var int $maxAttempts How many times you may try to login with wrong credentials before being locked out
     */
    protected $maxAttempts = 3;

    /**
     * @var int $decayMinutes How long it takes before you can login again after being locked out in minutes
     */
    protected $decayMinutes = 10;

    use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = '/kms';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest', ['except' => 'logout']);

        // check for "frontend" user
        if(\Route::current() && \Route::current()->uri == "login") {
            $this->redirectTo = url()->previous();
        }
    }

    public function showLoginForm()
    {
        return view('kms.auth.login');
    }

    public function loginUsername(Request $request)
    {
        $this->redirectTo = 'ledeninfo';

        $username = $request->input('username');
        $request = $request->merge(['form' => 'memberLogin']);

        if($username !== 'msllogin'){
            return redirect(url()->previous());
        }
        else{
            return $this->login($request);
        }
    }


//    public function login(Request $request)
//    {
//        $this->validateLogin($request);
//
//        // If the class is using the ThrottlesLogins trait, we can automatically throttle
//        // the login attempts for this application. We'll key this by the username and
//        // the IP address of the client making these requests into this application.
//        if ($this->hasTooManyLoginAttempts($request)) {
//            $this->fireLockoutEvent($request);
//
//            return $this->sendLockoutResponse($request);
//        }
//
//        if ($this->attemptLogin($request)) {
//            return $this->sendLoginResponse($request);
//        }
//
//        // If the login attempt was unsuccessful we will increment the number of attempts
//        // to login and redirect the user back to the login form. Of course, when this
//        // user surpasses their maximum number of attempts they will get locked out.
//
//        // Only add detection for kms login
////        $formType = $request->input('form');
////        if(!isset($formType)) $this->incrementLoginAttempts($request);
//        $this->incrementLoginAttempts($request);
//
//        return $this->sendFailedLoginResponse($request);
//    }

}