mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Applying @dmeltzer’s changes from afc8ac5e72
This commit is contained in:
parent
6b31e2aca9
commit
7bb50a61a7
|
@ -214,7 +214,7 @@ class LoginController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
$google2fa = app()->make('PragmaRX\Google2FA\Contracts\Google2FA');
|
$google2fa = app()->make('pragmarx.google2fa');
|
||||||
|
|
||||||
if ($user->two_factor_secret=='') {
|
if ($user->two_factor_secret=='') {
|
||||||
$user->two_factor_secret = $google2fa->generateSecretKey(32);
|
$user->two_factor_secret = $google2fa->generateSecretKey(32);
|
||||||
|
@ -222,7 +222,7 @@ class LoginController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$google2fa_url = $google2fa->getQRCodeGoogleUrl(
|
$google2fa_url = $google2fa->getQRCodeInline(
|
||||||
urlencode(Setting::getSettings()->site_name),
|
urlencode(Setting::getSettings()->site_name),
|
||||||
urlencode($user->username),
|
urlencode($user->username),
|
||||||
$user->two_factor_secret
|
$user->two_factor_secret
|
||||||
|
@ -257,7 +257,7 @@ class LoginController extends Controller
|
||||||
|
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
$secret = $request->get('two_factor_secret');
|
$secret = $request->get('two_factor_secret');
|
||||||
$google2fa = app()->make('PragmaRX\Google2FA\Contracts\Google2FA');
|
$google2fa = app()->make('pragmarx.google2fa');
|
||||||
$valid = $google2fa->verifyKey($user->two_factor_secret, $secret);
|
$valid = $google2fa->verifyKey($user->two_factor_secret, $secret);
|
||||||
|
|
||||||
if ($valid) {
|
if ($valid) {
|
||||||
|
|
|
@ -115,7 +115,8 @@ abstract class Importer
|
||||||
public function import()
|
public function import()
|
||||||
{
|
{
|
||||||
$headerRow = $this->csv->fetchOne();
|
$headerRow = $this->csv->fetchOne();
|
||||||
$results = $this->normalizeInputArray($this->csv->fetchAssoc());
|
$this->csv->setHeaderOffset(0);
|
||||||
|
$results = $this->normalizeInputArray($this->csv->getRecords());
|
||||||
|
|
||||||
$this->populateCustomFields($headerRow);
|
$this->populateCustomFields($headerRow);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue