- Add Handler
- Remove InstantWin - Add OTP SMS - Update OTP Vue component
This commit is contained in:
parent
d68829921d
commit
e804ced4d1
33 changed files with 244 additions and 342 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Exceptions;
|
|||
|
||||
use Exception;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
|
|
@ -34,9 +35,29 @@ class Handler extends ExceptionHandler
|
|||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function report(Exception $exception)
|
||||
public function report(Exception $e)
|
||||
{
|
||||
parent::report($exception);
|
||||
try {
|
||||
if (!config('app.debug')) {
|
||||
if ($this->shouldntReport($e)) {
|
||||
return;
|
||||
}
|
||||
Mail::send('emails.exception', [
|
||||
'url' => app()->runningInConsole() ?
|
||||
'CONSOLE' : (
|
||||
(request() and request()->fullUrl()) ?
|
||||
request()->fullUrl() : 'none'),
|
||||
'exception' => $e
|
||||
], function ($m) {
|
||||
$m->to(
|
||||
config('mail.contactsList.serviceweb'),
|
||||
'LDC WEB Exception Handler'
|
||||
)->subject('Need help !, an error occured in your application, please check Logs ASAP');
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
parent::report($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -54,14 +54,8 @@ class DatastorePCCController extends Controller
|
|||
public function forceDelete(Request $request)
|
||||
{
|
||||
$dpcc_id = $request->id;
|
||||
$otp1 = $request->otp1;
|
||||
$otp2 = $request->otp2;
|
||||
$otp3 = $request->otp3;
|
||||
$otp4 = $request->otp4;
|
||||
$otp5 = $request->otp5;
|
||||
$otp6 = $request->otp6;
|
||||
|
||||
$otp = $otp1 . $otp2 . $otp3 . $otp4 . $otp5 . $otp6;
|
||||
$otp = $request->otp;
|
||||
|
||||
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
|
||||
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
|
||||
|
|
|
|||
|
|
@ -54,14 +54,7 @@ class DomainNamesController extends Controller
|
|||
public function forceDelete(Request $request)
|
||||
{
|
||||
$dm_id = $request->id;
|
||||
$otp1 = $request->otp1;
|
||||
$otp2 = $request->otp2;
|
||||
$otp3 = $request->otp3;
|
||||
$otp4 = $request->otp4;
|
||||
$otp5 = $request->otp5;
|
||||
$otp6 = $request->otp6;
|
||||
|
||||
$otp = $otp1 . $otp2 . $otp3 . $otp4 . $otp5 . $otp6;
|
||||
$otp = $request->otp;
|
||||
|
||||
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
|
||||
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
|
||||
|
|
|
|||
|
|
@ -51,14 +51,7 @@ class EmailAddressesController extends Controller
|
|||
public function forceDelete(Request $request)
|
||||
{
|
||||
$email_id = $request->id;
|
||||
$otp1 = $request->otp1;
|
||||
$otp2 = $request->otp2;
|
||||
$otp3 = $request->otp3;
|
||||
$otp4 = $request->otp4;
|
||||
$otp5 = $request->otp5;
|
||||
$otp6 = $request->otp6;
|
||||
|
||||
$otp = $otp1 . $otp2 . $otp3 . $otp4 . $otp5 . $otp6;
|
||||
$otp = $request->otp;
|
||||
|
||||
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
|
||||
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GamesController extends Controller
|
||||
{
|
||||
public function index(Request $request) {
|
||||
return view('games.index');
|
||||
}
|
||||
|
||||
public function instantWin(Request $request) {
|
||||
return view('games.instant-win');
|
||||
}
|
||||
|
||||
public function instantWinGenerate(Request $request) {
|
||||
$start_date = $request->start_date;
|
||||
$end_date = $request->end_date;
|
||||
$lots = $request->lots;
|
||||
$lots = json_decode($lots, true);
|
||||
|
||||
$begin = new \DateTime( $start_date );
|
||||
$end = new \DateTime( $end_date );
|
||||
$end = $end->modify( '+1 day' );
|
||||
$interval = new \DateInterval('P1D');
|
||||
$daterange = new \DatePeriod($begin, $interval ,$end);
|
||||
$dateGlobal = [];
|
||||
$lotsGlobal = [];
|
||||
|
||||
foreach ($lots as $k => $lot)
|
||||
for ($i = 0; $i < $lot['qty']; $i++)
|
||||
$lotsGlobal[] = ['id' => $lot['id'], 'name' => $lot['name'], 'hour' => str_pad(mt_rand(6, 22), 2, "0", STR_PAD_LEFT) . ":" . str_pad(mt_rand(0, 59), 2, "0", STR_PAD_LEFT) . ":00"];
|
||||
shuffle($lotsGlobal);
|
||||
foreach($daterange as $date)
|
||||
array_push($dateGlobal, ['date' => $date->format("Y-m-d"), 'lots' => []]);
|
||||
|
||||
|
||||
$res = $this->generate($lotsGlobal,$dateGlobal, 0);
|
||||
|
||||
return redirect()->route('games.instantwin')->with('generated', $res);
|
||||
}
|
||||
|
||||
private function generate($lotsGlobal, $dateGlobal, $lotsDone){
|
||||
$rKey = array_rand($dateGlobal, 1);
|
||||
if ($lotsDone < count($dateGlobal)) {
|
||||
if (count($dateGlobal[$rKey]['lots']) > 0) {
|
||||
return $this->generate($lotsGlobal, $dateGlobal, $lotsDone);
|
||||
}
|
||||
}
|
||||
array_push($dateGlobal[$rKey]['lots'], $lotsGlobal[$lotsDone++]);
|
||||
if ($lotsDone < count($lotsGlobal)) {
|
||||
return $this->generate($lotsGlobal, $dateGlobal, $lotsDone);
|
||||
}
|
||||
foreach ($dateGlobal as $k => $date)
|
||||
usort($dateGlobal[$k]['lots'], [$this, 'sortFunction']);
|
||||
return $dateGlobal;
|
||||
}
|
||||
|
||||
private function sortFunction( $a, $b ) {
|
||||
return strtotime($a["hour"]) - strtotime($b["hour"]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,9 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use lfkeitel\phptotp\{Base32,Totp};
|
||||
use SimpleSoftwareIO\QrCode\Facades\QrCode;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
|
|
@ -13,7 +16,17 @@ class HomeController extends Controller
|
|||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
// otpauth://totp/LDC%20WEB:vincent.bridier@ldc.fr?secret=JWAQXGWVH2UDGEPFIY6IOHDZIY&issuer=LDC%20WEB
|
||||
//$secret = Totp::GenerateSecret(16);
|
||||
# Display new key to user so they can enter it in Google Authenticator or Authy
|
||||
//echo strtoupper(Base32::encode($secret));exit;
|
||||
// otpauth://totp/LDC%20WEB:mail@ldc.fr?secret=secret&issuer=LDC%20WEB
|
||||
return view('home');
|
||||
}
|
||||
|
||||
public function qr()
|
||||
{
|
||||
$user = Auth::user();
|
||||
$qrcode = QrCode::size(200)->generate("otpauth://totp/LDC%20WEB:".$user->email."?secret=".$user->totp_secret."&issuer=LDC%20WEB");
|
||||
return view("qrcode", compact('qrcode'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,14 +49,7 @@ class LDCNetworkController extends Controller
|
|||
public function forceDelete(Request $request)
|
||||
{
|
||||
$network_id = $request->id;
|
||||
$otp1 = $request->otp1;
|
||||
$otp2 = $request->otp2;
|
||||
$otp3 = $request->otp3;
|
||||
$otp4 = $request->otp4;
|
||||
$otp5 = $request->otp5;
|
||||
$otp6 = $request->otp6;
|
||||
|
||||
$otp = $otp1 . $otp2 . $otp3 . $otp4 . $otp5 . $otp6;
|
||||
$otp = $request->otp;
|
||||
|
||||
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
|
||||
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
|
||||
|
|
|
|||
|
|
@ -19,17 +19,11 @@ class OTPController extends Controller
|
|||
}
|
||||
|
||||
public function check(Request $request) {
|
||||
$otp1 = $request->otp1;
|
||||
$otp2 = $request->otp2;
|
||||
$otp3 = $request->otp3;
|
||||
$otp4 = $request->otp4;
|
||||
$otp5 = $request->otp5;
|
||||
$otp6 = $request->otp6;
|
||||
|
||||
$otp = $otp1 . $otp2 . $otp3 . $otp4 . $otp5 . $otp6;
|
||||
$otp = $request->otp;
|
||||
$user = session()->get('tmpUserOTP');
|
||||
if (!$user)
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
|
||||
$lastCode = (new Totp())->GenerateToken(Base32::decode($user->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
|
||||
$code = (new Totp())->GenerateToken(Base32::decode($user->totp_secret));
|
||||
|
||||
|
|
@ -43,4 +37,28 @@ class OTPController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
public function sendOTPBySMS()
|
||||
{
|
||||
$user = session()->get('tmpUserOTP');
|
||||
if (!$user)
|
||||
return back()->withErrors('User not found.');
|
||||
|
||||
if (is_null($user->phone))
|
||||
return back()->withErrors('Phone number missing.');
|
||||
|
||||
$otp = (new Totp())->GenerateToken(Base32::decode($user->totp_secret));
|
||||
/** @var \App\Lib\LDC\MailjetSms */
|
||||
$mj = app('MailjetSms');
|
||||
$mjResponse = $mj->send("OTP : " . implode(' ', str_split($otp)), $user->phone);
|
||||
|
||||
/** @var \GuzzleHttp\Psr7\Response $mjResponse */
|
||||
$responseStatus = $mjResponse->getStatusCode(); //"200"
|
||||
$responsePhrase = $mjResponse->getReasonPhrase(); //"OK"
|
||||
if ($responseStatus == 200) {
|
||||
$mjSmsResponse = $mjResponse->getBody()->getContents();
|
||||
return back()->with('success', "SMS envoyé.");
|
||||
}
|
||||
return back()->withErrors('SMS not sent.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,14 +99,7 @@ class ProjectsController extends Controller
|
|||
public function forceDelete(Request $request)
|
||||
{
|
||||
$uuid = $request->uuid;
|
||||
$otp1 = $request->otp1;
|
||||
$otp2 = $request->otp2;
|
||||
$otp3 = $request->otp3;
|
||||
$otp4 = $request->otp4;
|
||||
$otp5 = $request->otp5;
|
||||
$otp6 = $request->otp6;
|
||||
|
||||
$otp = $otp1 . $otp2 . $otp3 . $otp4 . $otp5 . $otp6;
|
||||
$otp = $request->otp;
|
||||
|
||||
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
|
||||
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
|
||||
|
|
|
|||
|
|
@ -61,14 +61,7 @@ class ServersController extends Controller
|
|||
public function forceDelete(Request $request)
|
||||
{
|
||||
$server_id = $request->id;
|
||||
$otp1 = $request->otp1;
|
||||
$otp2 = $request->otp2;
|
||||
$otp3 = $request->otp3;
|
||||
$otp4 = $request->otp4;
|
||||
$otp5 = $request->otp5;
|
||||
$otp6 = $request->otp6;
|
||||
|
||||
$otp = $otp1 . $otp2 . $otp3 . $otp4 . $otp5 . $otp6;
|
||||
$otp = $request->otp;
|
||||
|
||||
$lastCode = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret), Carbon::now()->subSeconds(30)->timestamp);
|
||||
$code = (new Totp())->GenerateToken(Base32::decode(Auth::user()->totp_secret));
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class User extends Authenticatable
|
|||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'email', 'password',
|
||||
'name', 'email', 'phone', 'password',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
"laravel/framework": "^6.2",
|
||||
"laravel/tinker": "^2.0",
|
||||
"laravel/ui": "1.0",
|
||||
"lfkeitel/phptotp": " 1.0"
|
||||
"lfkeitel/phptotp": " 1.0",
|
||||
"simplesoftwareio/simple-qrcode": "^4.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"facade/ignition": "^1.4",
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ return [
|
|||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\MailjetSmsServiceProvider::class,
|
||||
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,11 @@ return [
|
|||
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||
],
|
||||
|
||||
// Contacts List
|
||||
'contactsList' => [
|
||||
'serviceweb' => env('MAIL_LIST_SERVICEWEB', 'informatique.internet@ldc.fr'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|
|
|
|||
|
|
@ -30,4 +30,12 @@ return [
|
|||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
],
|
||||
|
||||
'mailjet' => [
|
||||
'key' => env('MAILJET_APIKEY'),
|
||||
'secret' => env('MAILJET_APISECRET'),
|
||||
'sms_token' => env('MAILJET_SMSTOKEN'),
|
||||
'sms_endpoint' => env('MAILJET_SMSENDPOINT', 'https://api.mailjet.com/v4/sms-send'),
|
||||
'sms_from' => env('MAILJET_SMSFROM', config('app.name')),
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -22,5 +22,8 @@
|
|||
"sass-loader": "^8.0.2",
|
||||
"vue": "^2.5.17",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@bachdgvn/vue-otp-input": "^1.0.8"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
5
resources/js/app.js
vendored
5
resources/js/app.js
vendored
|
|
@ -8,6 +8,9 @@ require('./bootstrap');
|
|||
|
||||
window.Vue = require('vue');
|
||||
|
||||
import OtpInput from "@bachdgvn/vue-otp-input";
|
||||
|
||||
|
||||
/**
|
||||
* The following block of code may be used to automatically register your
|
||||
* Vue components. It will recursively scan this directory for the Vue
|
||||
|
|
@ -19,10 +22,10 @@ window.Vue = require('vue');
|
|||
// const files = require.context('./', true, /\.vue$/i)
|
||||
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
|
||||
|
||||
Vue.component("v-otp-input", OtpInput);
|
||||
Vue.component('otp-form', require('./components/OTPFormComponent.vue').default);
|
||||
Vue.component('login-id', require('./components/LoginIDComponent.vue').default);
|
||||
Vue.component('wp-auto-login', require('./components/WPAutoLoginComponent.vue').default);
|
||||
Vue.component('instant-win', require('./components/InstantWinComponent.vue').default);
|
||||
|
||||
/**
|
||||
* Next, we will create a fresh Vue application instance and attach it to
|
||||
|
|
|
|||
|
|
@ -1,77 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<form :action="route" method="POST">
|
||||
<input type="hidden" name="_token" :value="csrf">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label>Début du jeu :</label>
|
||||
<input type="date" v-model="start_date" name="start_date" class="form-control" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>Fin du jeu :</label>
|
||||
<input type="date" v-model="end_date" name="end_date" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"style="margin-top: 10px;">
|
||||
<div v-if="datas.length > 0" class="col-md-12">
|
||||
<div class="row" v-for="(item, index) in datas">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<input v-model="item.id" type="text" placeholder="ID du lot" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input v-model="item.name" type="text" placeholder="Libelle du lot" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<input v-model="item.qty" type="number" step="1" placeholder="Qté" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<a @click="removeItem(index)" href="#" class="btn btn-danger"><i class="fas fa-times"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 text-center">
|
||||
<button @click="newItem" class="btn btn-primary" type="button"><i class="fas fa-plus"></i></button>
|
||||
<input type="hidden" name="lots" :value="JSON.stringify(datas)" required>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="datas.length > 0" class="row" style="margin-top: 10px;">
|
||||
<div class="col-md-12 text-center">
|
||||
<button class="btn btn-success" type="submit"><i class="fas fa-cog"></i> Générer</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
mounted() {
|
||||
console.log('Instant Win Component mounted.');
|
||||
},
|
||||
props: [
|
||||
'csrf',
|
||||
'route'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
datas: [],
|
||||
start_date: '',
|
||||
end_date: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
newItem() {
|
||||
this.datas.push({id: '', name: '', qty: ''});
|
||||
},
|
||||
removeItem(index) {
|
||||
this.datas.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,19 +1,22 @@
|
|||
<template>
|
||||
<form ref="otp_form" class="d-inline" method="POST" :action="action">
|
||||
<div v-show="showSubmitBtn" class="alert alert-danger" role="alert">
|
||||
Vous devez remplir tous les champs, 1 caractère par case.
|
||||
</div>
|
||||
<input type="hidden" name="_token" :value="csrf">
|
||||
<div class="otp_fields">
|
||||
<input ref="otp1" v-model="otp1" :disabled="blockInputs" name="otp1" type="number" min="0" max="9" maxlength="1" minlength="1" @keypress="nextInput(2)" @click="otp1 = ''" autofocus required>
|
||||
<input ref="otp2" v-model="otp2" :disabled="blockInputs" name="otp2" type="number" min="0" max="9" maxlength="1" minlength="1" @keypress="nextInput(3)" @click="otp2 = ''" required>
|
||||
<input ref="otp3" v-model="otp3" :disabled="blockInputs" name="otp3" type="number" min="0" max="9" maxlength="1" minlength="1" @keypress="nextInput(4)" @click="otp3 = ''" required>
|
||||
<input ref="otp4" v-model="otp4" :disabled="blockInputs" name="otp4" type="number" min="0" max="9" maxlength="1" minlength="1" @keypress="nextInput(5)" @click="otp4 = ''" required>
|
||||
<input ref="otp5" v-model="otp5" :disabled="blockInputs" name="otp5" type="number" min="0" max="9" maxlength="1" minlength="1" @keypress="nextInput(6)" @click="otp5 = ''" required>
|
||||
<input ref="otp6" v-model="otp6" :disabled="blockInputs" name="otp6" type="number" min="0" max="9" maxlength="1" minlength="1" @click="otp6 = ''">
|
||||
</div>
|
||||
<input v-show="showSubmitBtn" type="submit" value="Valider" class="btn btn-primary" style="display: block;margin: 10px auto 0;">
|
||||
</form>
|
||||
<div style="display: flex; flex-direction: row; justify-content: center;align-items: center;">
|
||||
<form ref="otp_form" class="d-inline" method="POST" :action="action">
|
||||
<input type="hidden" name="_token" :value="csrf">
|
||||
<v-otp-input
|
||||
ref="otpInput"
|
||||
input-classes="otp-input"
|
||||
separator="-"
|
||||
:num-inputs="6"
|
||||
:should-auto-focus="true"
|
||||
:is-input-num="true"
|
||||
@on-change="handleOnChange"
|
||||
@on-complete="handleOnComplete"
|
||||
/>
|
||||
<input type="hidden" name="otp" v-model.lazy="otpValue">
|
||||
</form>
|
||||
<button @click="handleClearInput()" class="btn btn-sn btn-primary">Reset</button>
|
||||
<a href="/login/send-sms-otp" class="btn btn-link">SMS</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -27,52 +30,41 @@
|
|||
],
|
||||
data() {
|
||||
return {
|
||||
otp1: '',
|
||||
otp2: '',
|
||||
otp3: '',
|
||||
otp4: '',
|
||||
otp5: '',
|
||||
otp6: '',
|
||||
showSubmitBtn: false,
|
||||
blockInputs: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
otp6() {
|
||||
if (this.otp6.length === 1) {
|
||||
this.blockInputs = true;
|
||||
this.submit();
|
||||
}
|
||||
otpValue: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
nextInput(id) {
|
||||
switch (id) {
|
||||
case 2:
|
||||
this.$refs.otp2.focus();
|
||||
break;
|
||||
case 3:
|
||||
this.$refs.otp3.focus();
|
||||
break;
|
||||
case 4:
|
||||
this.$refs.otp4.focus();
|
||||
break;
|
||||
case 5:
|
||||
this.$refs.otp5.focus();
|
||||
break;
|
||||
case 6:
|
||||
this.$refs.otp6.focus();
|
||||
break;
|
||||
}
|
||||
handleOnComplete(value) {
|
||||
setTimeout(() => { this.$refs.otp_form.submit(); }, 0.1);
|
||||
},
|
||||
submit() {
|
||||
if (this.otp1.length === 1 && this.otp2.length === 1 && this.otp3.length === 1 && this.otp4.length === 1 && this.otp5.length === 1 && this.otp6.length === 1){
|
||||
this.$refs.otp_form.submit();
|
||||
}else{
|
||||
this.showSubmitBtn = true;
|
||||
this.blockInputs = false;
|
||||
}
|
||||
handleOnChange(value) {
|
||||
this.otpValue = value;
|
||||
},
|
||||
handleClearInput() {
|
||||
this.otpValue = '';
|
||||
this.$refs.otpInput.clearInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.otp-input {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
padding: 5px;
|
||||
margin: 0 10px;
|
||||
font-size: 20px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.3);
|
||||
text-align: center;
|
||||
}
|
||||
.otp-input.error {
|
||||
border: 1px solid red !important;
|
||||
}
|
||||
.otp-input::-webkit-inner-spin-button,
|
||||
.otp-input::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<h3>Code de vérification invalide.</h3>
|
||||
<h3>Code invalide.</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,20 @@
|
|||
<div class="card-header">Confirmation de connexion</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session()->get('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<otp-form csrf='{{ csrf_token() }}' action="/login/checkOTP"></otp-form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,20 @@
|
|||
<div class="card-header">Confirmation de suppression du nom de domaine <a href="{{route('domain-names.edit', ['id' => $dm->id])}}" class="btn btn-sm btn-primary float-right">Retour</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session()->get('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<otp-form csrf='{{ csrf_token() }}' action="{{route('domain-names.force-delete', ['id' => $dm->id])}}"></otp-form>
|
||||
</div>
|
||||
@else
|
||||
|
|
|
|||
|
|
@ -9,6 +9,20 @@
|
|||
<div class="card-header">Confirmation de suppression du datastore pcc <a href="{{route('dpccs.edit', ['id' => $dpcc->id])}}" class="btn btn-sm btn-primary float-right">Retour</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session()->get('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<otp-form csrf='{{ csrf_token() }}' action="{{route('dpccs.force-delete', ['id' => $dpcc->id])}}"></otp-form>
|
||||
</div>
|
||||
@else
|
||||
|
|
|
|||
|
|
@ -8,6 +8,20 @@
|
|||
<div class="card-header">Confirmation de suppression de l'adresse email <a href="{{route('email-addresses.edit', ['id' => $email->id])}}" class="btn btn-sm btn-primary float-right">Retour</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session()->get('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<otp-form csrf='{{ csrf_token() }}' action="{{route('email-addresses.force-delete', ['id' => $email->id])}}"></otp-form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Jeux</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-md-12 d-flex justify-content-around">
|
||||
<a href="{{route('games.instantwin')}}" class="btn btn-lg btn-primary">
|
||||
<i class="far fa-list-alt"></i><br>
|
||||
Instants Gagnants
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">Jeux - Instants Gagnants</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (!session('generated'))
|
||||
<div class="row">
|
||||
<div class="col-md-12 d-flex justify-content-around">
|
||||
<instant-win route="{{route('games.instantwin-generate')}}" csrf="{{ csrf_token() }}"></instant-win>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if (session('generated'))
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@foreach(session('generated') as $date)
|
||||
@foreach($date['lots'] as $lot)
|
||||
Le {{ date('d/m/Y', strtotime($date['date'])) }} à {{$lot['hour']}} : {{$lot['name']}} <br>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
@foreach(session('generated') as $date)
|
||||
@foreach($date['lots'] as $lot)
|
||||
INSERT INTO ldcjeux_instantgagnant VALUES (0, {{$lot['id']}}, '{{$date['date']}} {{$lot['hour']}}', 0, 0);
|
||||
<br>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -47,10 +47,6 @@
|
|||
<i class="fas fa-network-wired"></i><br>
|
||||
Réseau LDC
|
||||
</a>
|
||||
<a href="{{route('games.index')}}" class="btn btn-lg btn-primary">
|
||||
<i class="fas fa-dice"></i><br>
|
||||
Jeux
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -60,15 +60,13 @@
|
|||
<li class="nav-item">
|
||||
<a href="/status-checker" class="nav-link">Status Checker</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/games" class="nav-link">Jeux</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
{{ Auth::user()->firstname }} {{ Auth::user()->lastname }}<span class="caret"></span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="{{ route('otp-qr-code') }}">OTP QRCode</a>
|
||||
<a class="dropdown-item" href="{{route('saml2_logout', 'ldc')}}?returnTo={{route('saml2_sls', 'ldc')}}&sessionIndex={{session()->get('sessionIndex')}}&nameId={{session()->get('nameId')}}">Déconnexion</a>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,20 @@
|
|||
<div class="card-header">Confirmation de suppression de l'IP <a href="{{route('ldc-networks.edit', ['id' => $network->id])}}" class="btn btn-sm btn-primary float-right">Retour</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session()->get('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<otp-form csrf='{{ csrf_token() }}' action="{{route('ldc-networks.force-delete', ['id' => $network->id])}}"></otp-form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,20 @@
|
|||
<div class="card-header">Confirmation de suppression du projet {{ $project->display_name }} <a href="/projects/{{$project->uuid}}/edit" class="btn btn-sm btn-primary float-right">Retour</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session()->get('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<otp-form csrf='{{ csrf_token() }}' action="/projects/{{$project->uuid}}/force-delete"></otp-form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,20 @@
|
|||
<div class="card-header">Confirmation de suppression du serveur <a href="{{route('servers.edit', ['id' => $server->id])}}" class="btn btn-sm btn-primary float-right">Retour</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session()->get('success') }}
|
||||
</div>
|
||||
@endif
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<otp-form csrf='{{ csrf_token() }}' action="{{route('servers.force-delete', ['id' => $server->id])}}"></otp-form>
|
||||
</div>
|
||||
@else
|
||||
|
|
|
|||
|
|
@ -12,12 +12,14 @@
|
|||
*/
|
||||
|
||||
Route::get('/login/verify', 'OTPController@verify')->name('auth.verify');
|
||||
Route::get('/login/send-sms-otp', 'OTPController@sendOTPBySMS')->name('auth.sms-otp');
|
||||
Route::post('/login/checkOTP', 'OTPController@check')->name('auth.otp');
|
||||
Route::view('/login/verification_failed', 'auth.verification_failed')->name('verification_failed');
|
||||
Route::view('/login/unauthorized', 'auth.unauthorized')->name('unauthorized');
|
||||
|
||||
Route::group(['middleware' => ['auth']], function () {
|
||||
Route::get('/', 'HomeController@index')->name('home');
|
||||
Route::get('/otp-qr-code', 'HomeController@qr')->name('otp-qr-code');
|
||||
/* STATUS CHECKER */
|
||||
Route::get('/status-checker', 'StatusCheckerController@index');
|
||||
/* EDL WEB */
|
||||
|
|
@ -69,8 +71,4 @@ Route::group(['middleware' => ['auth']], function () {
|
|||
Route::post('/ldc-networks/{id}/update', 'LDCNetworkController@update')->name('ldc-networks.update');
|
||||
Route::get('/ldc-networks/{id}/delete', 'LDCNetworkController@delete')->name('ldc-networks.delete');
|
||||
Route::post('/ldc-networks/{id}/force-delete', 'LDCNetworkController@forceDelete')->name('ldc-networks.force-delete');
|
||||
/* JEUX */
|
||||
Route::get('/games', 'GamesController@index')->name('games.index');
|
||||
Route::get('/games/instant-win', 'GamesController@instantWin')->name('games.instantwin');
|
||||
Route::post('/games/instant-win/generate', 'GamesController@instantWinGenerate')->name('games.instantwin-generate');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue