Exemplo n.º 1
0
function checkRole()
{
    if (!Session::exist('level')) {
        header('location:index.php?module=login');
        exit;
    }
}
Exemplo n.º 2
0
 public static function check($token)
 {
     $tokenName = config::get("session/token_name");
     if (Session::exist($tokenName) && $token === Session::get($tokenName)) {
         Session::delete($tokenName);
         return true;
     }
 }
Exemplo n.º 3
0
 function index()
 {
     Session::init();
     if (Session::exist()) {
         $this->view->render($this, 'personal');
     } else {
         header("location: " . URL);
     }
 }
Exemplo n.º 4
0
 function index()
 {
     //print (Hash::create(ALGO,"admin",HASH_KEY));
     Session::init();
     if (Session::exist()) {
         $this->inicio();
     } else {
         $this->view->render($this, 'index');
     }
 }
Exemplo n.º 5
0
 function beforeroute()
 {
     if (Cookie::exists(config::get('cookie/name')) && !Session::exist(config::get('session/session_name'))) {
         $hash = Cookie::get(config::get('cookie/name'));
         $hashCheck = DB::getInstance()->get('users_session', array('hash', '=', $hash));
         if ($hashCheck->count()) {
             $user = new User($hashCheck->first()->user_id);
             $user->login();
             Redirect::to('home');
         }
     }
 }
Exemplo n.º 6
0
 public function __construct($user = null)
 {
     parent::__construct("users");
     $this->_salt = config::get('encryption/salt');
     $this->_sessionName = config::get('session/session_name');
     $this->_cookieName = config::get('cookie/name');
     if (!$user) {
         if (Session::exist($this->_sessionName)) {
             $user = Session::get($this->_sessionName);
             if ($this->find(['id', '=', $user])) {
                 $this->_isLoggedIn = true;
             }
         }
     } else {
         $this->find(['id', '=', $user]);
     }
 }
Exemplo n.º 7
0
?>
}
					}).done(function(response){
						location.href = "<?php 
echo URL;
?>
GestorReqPrincipal/mostrarPost/"+idPost;
					});
				}
			}

			function agregarDenuncia(){
				var motivo = $('select[name=motivo]').val();
				var argumento = $('input[name=argumento]').val();
				<?php 
if (Session::exist()) {
    ?>
					var idUsuarioDenuncia = <?php 
    echo Session::getValue('U_ID');
    ?>
;
				<?php 
} else {
    ?>
					var idUsuarioDenuncia = "";
				<?php 
}
?>

				if(motivo!="Seleccionar" && argumento!=""){
					$.ajax({
Exemplo n.º 8
0
    <link href="assets/css/login.css" rel="stylesheet" />
    <link href="assets/css/style.css" rel="stylesheet" />

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="container">
<header class="row">
    <h1 class="col-md-3"><a class="text-hide" href="index.php?module=home" title="A link">Manager Water System</a></h1>
    <h2 class="caption col-md-5">Hệ Thống Quản lý nước 172</h2>
    <?php 
if (Session::exist('level') && Session::get('level') === '2') {
    ?>
             <div class="col-md-4 info-acount pull-right">
                 <span class="acount">Xin Chào: <?php 
    echo Session::get('uname');
    ?>
</span>
                 <a href="index.php?module=logout" onclick="return confirm('Do you exit?');" class="btn-default">Đăng Xuất</a>
             </div>
     <?php 
}
?>

    <div class="clearfix"></div>
</header>
Exemplo n.º 9
0
<?php

# evaluo que efectivamente existe una sesión y la misma coincide con el usuario que quiere modificar la información de perfil
if (Session::exist() && Session::getValue('U_ID') === $usuario->getIdUsuario()) {
    include "cabecera.php";
    ?>
	<div class="container">
		<div class="row">
			<!-- Menu secundario superior de navegación -->
			<div class="">
				<ul class="nav nav-tabs">
					<li role="presentation"><a href="<?php 
    echo URL;
    ?>
GestorReqPrincipal/mostrarPerfil/<?php 
    echo $usuario->getIdUsuario();
    ?>
">Biografía</a></li>
					<li role="presentation"><a href="<?php 
    echo URL;
    ?>
GestorReqPrincipal/mostrarPosts/imagenes/1/<?php 
    echo $usuario->getIdUsuario();
    ?>
">Imagenes</a></li>
					<li role="presentation"><a href="<?php 
    echo URL;
    ?>
GestorReqPrincipal/mostrarPosts/videos/1/<?php 
    echo $usuario->getIdUsuario();
    ?>
Exemplo n.º 10
0
">Videos</a></li>
						</ul>
					</div>
			<?php 
}
?>
			
			
			<!-- Contenido de la sección de post de imagenes del perfil -->
			<div class="main col-xs-12">
				<?php 
$gestorReqPrincipal = new GestorReqPrincipal();
$usuario = $gestorReqPrincipal->obtenerUsuario($idUsuario);
echo '<h2>Imagenes de ' . $usuario->getNombreCompleto() . '</h2>';
# Si el administrador esta viendo el perfil de usuario se muestra un boton para dar de baja la cuenta
if (Session::exist() && Session::getValue('U_ID') == 1) {
    echo '<a href="#avisoBaja" class="btn btn-danger" data-toggle="modal">Eliminar cuenta usuario</a>';
}
?>
					<!-- Ventana emergente para verificar la seguridad de la eliminacion de la cuenta -->
						<div class="modal fade" id="avisoBaja">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<button tyle="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
										<h4 class="modal-title">Cuidado!</h4>
									</div>

									<div class="modal-body">
										Esta a punto de dar de baja la cuenta de este usuario.
									</div>
Exemplo n.º 11
0
 function usuarioRegistro()
 {
     Session::init();
     if (Session::exist()) {
         $this->view->render($this, 'bono_registro');
     } else {
         header("location: " . URL);
     }
 }
Exemplo n.º 12
0
 function asignarDescuentos()
 {
     Session::init();
     if (Session::exist()) {
         $personal = new personal();
         $descuento = new descuento();
         $this->view->personalData = $personal->model->listarPersonal(" where t1.id_estado in ('01') ");
         $this->view->descuentoData = $descuento->model->listarDescuento(" where t1.id_estado in ('01') ");
         $this->view->planillaOnData = $this->model->listarPlanilla(" where t1.id_estado in ('03') and t1.id_tipo_planilla in('02') ");
         $this->view->render($this, 'planilla_descuento');
     } else {
         header("location: " . URL);
     }
 }