File: /var/www/proveedores.bradford/application/libraries/General.php
<?php
class General
{
function sesion($array, $admin = null)
{
if (!isset($array['habilitado'])) {
$html = '
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>'.APP_NAME.' | Acceso Restringido</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Google Font: Source Sans Pro -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<!-- Font Awesome -->
<link rel="stylesheet" href="' . ASSETS . '/plugins/fontawesome-free/css/all.min.css">
<!-- icheck bootstrap -->
<link rel="stylesheet" href="' . ASSETS . '/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="' . ASSETS . '/css/adminlte.min.css">
</head>
<body class="login-page" style="margin-top:-20px;">
<div class="login-box">
<!-- /.login-logo -->
<div class="card card-outline card-danger">
<div class="card-header text-center">
<a href="<?php echo base_url() ?>" class="h1"><b><?php echo APP_NAME ?></b></a>
</div>
<div class="card-body">
<p class="alert alert-danger text-center"><i class="fa fa-exclamation-triangle"></i> <br>PÁGINA CON ACCESO RESTRINGIDO</p>
<p class="text-center"> Click en el botón para Volver al Login </p>
<div class="row">
<div class="col-2"></div>
<div class="col-8">
<input type="hidden" id="mobile" name="mobile" value="0" />
<a href="'.base_url().'" class="btn btn-dark btn-block"><i class="fa fa-reply"></i> Volver al Login</a>
</div>
</div>
<hr />
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.login-box -->
<!-- jQuery -->
<script src="' . ASSETS . '/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="' . ASSETS . '/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="' . ASSETS . '/js/adminlte.min.js"></script>
<script src="' . ASSETS . '/plugins/jQueryRut/jquery.Rut.min.js"></script>
</body>
</html>
';
#die('Página con acceso restringido. <a href="' . base_url() . '">Click aquí para hacer login</a>');
die($html);
} elseif ($admin) {
if ($array['type'] != 100) {
die('No tiene permiso para acceder a esta pagina. <a href="' . base_url('admin/dashboard') . '">Click aquí para volver al inicio</a>');
}
} else {
return 1;
}
}
}