Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Roland Alla MAC Updated Qr Code Version 2 a5a84a7 Jun 5, 2017
0 contributors

Users who have contributed to this file

56 lines (45 sloc) 1.04 KB
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Sentinel;
use App\User;
class QrLoginController extends Controller
{
public function index(Request $request) {
return view('auth.QrLogin');
}
public function indexoption2(Request $request) {
return view('auth.QrLogin2');
}
public function ViewUserQrCode($value='')
{
return view('backEnd.users.viewqrcode');
}
public function checkUser(Request $request) {
$result =0;
if ($request->data) {
$user = User::where('QRpassword',$request->data)->first();
if ($user) {
Sentinel::authenticate($user);
$result =1;
}else{
$result =0;
}
}
return $result;
}
public function QrAutoGenerate(Request $request)
{
$result=0;
if ($request->action = 'updateqr') {
$user = Sentinel::getUser();
if ($user) {
$qrLogin=bcrypt($user->personal_number.$user->email.str_random(40));
$user->QRpassword= $qrLogin;
$user->update();
$result=1;
}
}
return $result;
}
}
You can’t perform that action at this time.