/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (Sentinel::check()) { return redirect('/'); } return $next($request); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { //dd(Sentinel::check()); if ($user = Sentinel::check()) { return new RedirectResponse(url('/home')); } return $next($request); }
/** * Display a listing of the resource. * * @return Response */ public function index() { if (Sentinel::check()) { if (Sentinel::hasAccess('cuentas.view')) { $cuentas = Cuentas::all(); $cuentas->load('bancom'); return view('contabilidad::Cuentas.index', compact('cuentas')); } alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar'); return back(); } else { return redirect('login'); } }
public function index() { if (Sentinel::check()) { if (Sentinel::hasAccess('cancelaciones.view')) { $plazas = Place::plazasArray($this->user_auth->id); return view('contabilidad::Cancel.index', compact("plazas")); } else { alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar'); return back(); } } else { return redirect('login'); } }
public function index() { if (Sentinel::check()) { if (Sentinel::hasAccess('polizas.view')) { $fechaAyer = Carbon::now()->subDay()->format('Y/m/d'); $plazas = Place::plazasArray($this->user_auth->id); return view('contabilidad::Policies.form', compact('plazas', 'fechaAyer')); } else { alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar'); return back(); } } else { return redirect('login'); } }
public function index() { if (Sentinel::check()) { if (Sentinel::hasAccess('depositos.view')) { $deposito = new Deposito(); $cuentas = Cuentas::cuentasArray($this->user_auth->id); $cuentasDls = Cuentas::cuentasDolaresArray(); return view('contabilidad::Deposits.index', compact('deposito', 'cuentas', 'cuentasDls')); } else { alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar'); return back(); } } else { return redirect('login'); } }
public function index() { if (Sentinel::check()) { if (Sentinel::hasAccess('antiguedad.view')) { $fechaActual = Carbon::now()->format('Y/m/d'); $payment_methods = PaymentMethod::all(); $plazas = Place::plazasArray($this->user_auth->id); return view('contabilidad::OldBalance.form', compact("payment_methods", "plazas", "fechaActual")); } else { alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar'); return back(); } } else { return redirect('login'); } }
public function registerMenu() { if (!Sentinel::check()) { return redirect('login'); } $menu = Menu::instance('sidebar-menu'); if (Sentinel::hasAccess('ventas.view') || Sentinel::hasAccess('pendientes.view') || Sentinel::hasAccess('depositos.view') || Sentinel::hasAccess('cancelaciones.view') || Sentinel::hasAccess('polizas.view') || Sentinel::hasAccess('antiguedad.view') || Sentinel::hasAccess('auxmovimientos.view') || Sentinel::hasAccess('estadocuenta.view') || Sentinel::hasAccess('cuentas.view')) { $menu->dropdown('Contabilidad', function ($sub) { if (Sentinel::hasAccess('ventas.view')) { $sub->route('contabilidad.ventas.index', 'Ventas', [], 1, ['icon' => 'fa fa-circle-o']); } if (Sentinel::hasAccess('pendientes.view')) { $sub->route('contabilidad.pendientes.index', 'Pendientes', [], 1, ['icon' => 'fa fa-circle-o']); } if (Sentinel::hasAccess('depositos.view')) { $sub->route('contabilidad.depositos.index', 'Depósitos', [], 1, ['icon' => 'fa fa-circle-o']); } if (Sentinel::hasAccess('cancelaciones.view')) { $sub->route('contabilidad.cancelaciones.index', 'Cancelaciones', [], 1, ['icon' => 'fa fa-circle-o']); } if (Sentinel::hasAccess('polizas.view')) { $sub->route('contabilidad.polizas.index', 'Pólizas', [], 1, ['icon' => 'fa fa-circle-o']); } if (Sentinel::hasAccess('cuentas.view')) { $sub->route('contabilidad.cuentas.index', 'Cuentas', [], 1, ['icon' => 'fa fa-circle-o']); } if (Sentinel::hasAccess('antiguedad.view') || Sentinel::hasAccess('auxmovimientos.view')) { $sub->dropdown('Reportes', 2, function ($sub2) { if (Sentinel::hasAccess('antiguedad.view')) { $sub2->route('contabilidad.antiguedad.index', 'Antigüedad de saldos', [], 1, ['icon' => 'fa fa-circle-o']); } if (Sentinel::hasAccess('auxmovimientos.view')) { $sub2->route('contabilidad.antiguedad.index', 'Auxiliar de movimientos', [], 1, ['icon' => 'fa fa-circle-o']); } }, ['icon' => 'fa fa-bar-chart']); } if (Sentinel::hasAccess('estadocuenta.view')) { $sub->dropdown('Importar', 2, function ($sub2) { $sub2->route('contabilidad.antiguedad.index', 'Estado de cuenta', [], 1, ['icon' => 'fa fa-circle-o']); }, ['icon' => 'fa fa-cloud-upload']); } }, 2, ['icon' => 'fa fa-balance-scale']); } }
public function index() { if (Sentinel::check()) { if (Sentinel::hasAccess('pendientes.view')) { $usuario = User::find($this->user_auth->id); $oficinas = array(); foreach ($usuario->plazas as $plazas) { array_push($oficinas, $plazas->Oficina); } DB::enableQueryLog(); $ventasPendientes = Sales::select('*', DB::raw('SUM(ammount) as ammount, SUM(ammount_applied) as ammount_applied '))->whereRaw('credit_debit = ? ', ['credit'])->groupBy('reference')->get(); return view('contabilidad::Earrings.index', compact("ventasPendientes")); } else { alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar'); return back(); } } else { return redirect('login'); } }
public function index() { if (Sentinel::check()) { if (Sentinel::hasAccess('ventas.view')) { $usuario = User::find($this->user_auth->id); $oficinas = array(); foreach ($usuario->plazas as $plazas) { array_push($oficinas, $plazas->Oficina); } $salesLogs = SalesLog::whereIn('op_location', $oficinas)->orWhere(function ($query) use($oficinas) { $query->whereIn('cl_location', $oficinas); })->get(); return view('contabilidad::Sales.index', compact('salesLogs')); } else { alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar'); return back(); } } else { return redirect('login'); } }
<?php require_once "../includes.php"; use Cartalyst\Sentinel\Native\Facades\Sentinel; Sentinel::getUser(); $start = microtime(true); if (!Sentinel::check()) { $_SESSION["login_redirect"] = "/public_html/verify_columns.php"; header("location: /public_html/login.php"); die; } $parser = $initializer->columnify($_SESSION["file_path"]); $columns_info = $parser->find(); $form_options = $parser->form_options; $original_rows = $parser->original_rows; $tablehead = "<thead><tr>"; // Creating table header (aka the verification form). foreach ($columns_info as $name => $data) { $options_copy = $form_options; $position = $data["position"]; $yes_checked = $data["checkbox"]["yes_checked?"]; $no_checked = $data["checkbox"]["no_checked?"]; $should_hide = $data["checkbox"]["hidden?"]; $checkbox_text = $data["checkbox"]["text"]; $category = $data["category"]; if ($category != "unknown") { // Deviding the current category from the rest of the options. // The program will display these first. $category_options = $options_copy[$category]; unset($category_options[$name]); unset($options_copy[$category]);