up
This commit is contained in:
@@ -40,6 +40,12 @@ class ShowRecarga extends Component
|
|||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
// $this->fechaActual = date('d/m/Y');
|
// $this->fechaActual = date('d/m/Y');
|
||||||
|
$estadoUsuario = auth()->user()->estado;
|
||||||
|
if ($estadoUsuario !== null && $estadoUsuario !== 'activo') {
|
||||||
|
Auth::logout();
|
||||||
|
return redirect()->route('login')->with('error', 'Tu cuenta está cerrada o inactiva.');
|
||||||
|
}
|
||||||
|
|
||||||
if (auth()->user()->rol->nombre == "super" || auth()->user()->rol->nombre == "administrador" || auth()->user()->rol->nombre == "distribuidor") {
|
if (auth()->user()->rol->nombre == "super" || auth()->user()->rol->nombre == "administrador" || auth()->user()->rol->nombre == "distribuidor") {
|
||||||
$this->cobrar = true;
|
$this->cobrar = true;
|
||||||
$this->monto = "500";
|
$this->monto = "500";
|
||||||
@@ -57,6 +63,14 @@ class ShowRecarga extends Component
|
|||||||
|
|
||||||
public function pagar(){
|
public function pagar(){
|
||||||
|
|
||||||
|
$estadoUsuario = auth()->user()->estado;
|
||||||
|
if ($estadoUsuario !== null && $estadoUsuario !== 'activo') {
|
||||||
|
$this->alert('error', 'Tu cuenta está cerrada o inactiva. No puedes realizar recargas.', [
|
||||||
|
'position' => 'top'
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//auth2.0
|
//auth2.0
|
||||||
$client_id='5ml5b35ijjk13f4q99utnsm97e';
|
$client_id='5ml5b35ijjk13f4q99utnsm97e';
|
||||||
$client_secret='1b3703aq0o6t1rrfti13q7uf7f42glik3gsf81s0d783shblmt8l';
|
$client_secret='1b3703aq0o6t1rrfti13q7uf7f42glik3gsf81s0d783shblmt8l';
|
||||||
|
|||||||
@@ -319,6 +319,14 @@ class ShowUsuarios extends Component
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$usuarioDestino = User::find($this->user_saldo);
|
||||||
|
if ($usuarioDestino && $usuarioDestino->estado !== null && $usuarioDestino->estado !== 'activo') {
|
||||||
|
$this->alert('error', 'No se puede recargar saldo a una cuenta cerrada o inactiva.', [
|
||||||
|
'position' => 'top'
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->valor_recargar = str_replace([',', '.'], '', $this->valor_recargar);
|
$this->valor_recargar = str_replace([',', '.'], '', $this->valor_recargar);
|
||||||
$montoRecarga = (int) $this->valor_recargar;
|
$montoRecarga = (int) $this->valor_recargar;
|
||||||
|
|
||||||
@@ -383,6 +391,15 @@ class ShowUsuarios extends Component
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$usuarioDestino = User::find($this->user_saldo);
|
||||||
|
if ($usuarioDestino && $usuarioDestino->estado !== null && $usuarioDestino->estado !== 'activo') {
|
||||||
|
$this->alert('error', 'No se puede recargar saldo a una cuenta cerrada o inactiva.', [
|
||||||
|
'position' => 'top'
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->valor_recargar = str_replace([',', '.'], '', $this->valor_recargar);
|
$this->valor_recargar = str_replace([',', '.'], '', $this->valor_recargar);
|
||||||
$recarga = new recarga;
|
$recarga = new recarga;
|
||||||
$recarga->payment_method_id = 'manual';
|
$recarga->payment_method_id = 'manual';
|
||||||
|
|||||||
@@ -53,6 +53,16 @@ class LoginRequest extends FormRequest
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$user = Auth::user();
|
||||||
|
if ($user->estado !== null && $user->estado !== 'activo') {
|
||||||
|
Auth::logout();
|
||||||
|
RateLimiter::hit($this->throttleKey());
|
||||||
|
|
||||||
|
throw ValidationException::withMessages([
|
||||||
|
'email' => 'Tu cuenta está cerrada o inactiva. Contacta con soporte.',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
RateLimiter::clear($this->throttleKey());
|
RateLimiter::clear($this->throttleKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user