correciones en tiempo de session

This commit is contained in:
humano 2020-03-17 11:01:12 -05:00
parent 4cad68cc3a
commit 6c47a5da23
3 changed files with 24 additions and 24 deletions

View File

@ -1,7 +1,8 @@
<?php <?php
function Conectarse(){ function Conectarse(){
session_start();
if ( !isset ( $link ) ) { if ( !isset ( $link ) ) {
@include("includes/datos.php"); @include("includes/datos.php");
if(!isset($db)) { if(!isset($db)) {
@include("milfs/includes/datos.php"); @include("milfs/includes/datos.php");
@ -34,19 +35,19 @@ function Conectarse(){
$_SESSION['upload_size']= $upload_size; $_SESSION['upload_size']= $upload_size;
$_SESSION['timestamp']= $timestamp; $_SESSION['timestamp']= $timestamp;
return $link; return $link;
} }
} }
function Conectarse_recursivo(){ function Conectarse_recursivo(){
if ( !isset ( $link ) ) { if ( !isset ( $link ) ) {
@include("milfs/includes/datos.php"); @include("milfs/includes/datos.php");
if(!isset($db)) { if(!isset($db)) {
@include("../milfs/includes/datos.php"); @include("../milfs/includes/datos.php");
if(!isset($db)) { if(!isset($db)) {
include("../includes/datos.php"); include("../includes/datos.php");
} }
} }

View File

@ -20,7 +20,7 @@ require ("funciones/conex.php");
$xajax->processRequests(); $xajax->processRequests();
$embebido =0; $embebido =0;
if (isset($_REQUEST['form'])) { if (isset($_REQUEST['form'])) {
$form = $_REQUEST['form']; $form = $_REQUEST['form'];
$opciones["formato"]= $_REQUEST['formato']; $opciones["formato"]= $_REQUEST['formato'];
} else {$form = "";} } else {$form = "";}
@ -44,9 +44,9 @@ if (isset($_REQUEST['t'])) {$t = $_REQUEST['t'];} else {$t = "";}
<?php <?php
$xajax->printJavascript("xajax/"); $xajax->printJavascript("xajax/");
if(!isset($_REQUEST['experimental'])){ if(!isset($_REQUEST['experimental'])){
$bootstrap= " $bootstrap= "
<script <script
src='https://code.jquery.com/jquery-3.3.1.min.js' src='https://code.jquery.com/jquery-3.3.1.min.js'
integrity='sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=' integrity='sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8='
@ -58,14 +58,14 @@ if (isset($_REQUEST['t'])) {$t = $_REQUEST['t'];} else {$t = "";}
<link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet'> <link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet'>
"; ";
}else{ }else{
$bootstrap=" $bootstrap="
<script src='../librerias/jquery/jquery-2.1.4.min.js'></script> <script src='../librerias/jquery/jquery-2.1.4.min.js'></script>
<script src='../librerias/bootstrap/js/bootstrap.min.js'></script> <script src='../librerias/bootstrap/js/bootstrap.min.js'></script>
<link href='../librerias/bootstrap/css/bootstrap.min.css' rel='stylesheet' type='text/css'> <link href='../librerias/bootstrap/css/bootstrap.min.css' rel='stylesheet' type='text/css'>
"; ";
} }
// $xajax->debugOn(); // $xajax->debugOn();
//$xajax->statusMessagesOn(); //$xajax->statusMessagesOn();
@ -211,7 +211,7 @@ legend.legend-area {
</style> </style>
</head> </head>
<body onload="revisarSession()"; > <body >
<?php if($embebido ==1) { <?php if($embebido ==1) {
if($form!=''){ echo formulario_embebido($form,$opciones);} if($form!=''){ echo formulario_embebido($form,$opciones);}
elseif($identificador !='') { echo mostrar_identificador($identificador,$id);} elseif($identificador !='') { echo mostrar_identificador($identificador,$id);}
@ -256,13 +256,14 @@ else{}
<div class='row'> <div class='row'>
<div id='' class='col-sm-6'> <div id='' class='col-sm-6'>
<?php if(isset($_SESSION['id'])){ echo " <?php /* $sesion = "<pre>".print_r($_SESSION,true)."</pre>"; if(isset($_SESSION['id'])){ echo "
<form id='manejo_sesion' name='form_session' class='navbar-form navbar-left'> $sesion <form id='manejo_sesion' name='form_session' class='navbar-form navbar-left'>
<div class='input-group'> <div class='input-group'>
<input type='text' name='tiempo_session' size='18' class='form-control input-sm' readonly> <input type='text' name='tiempo_session' size='18' class='form-control input-sm' readonly>
<span class='input-group-addon'><a href='#' onclick=\"location.reload();\" title='Renovar'><span class='glyphicon glyphicon-refresh' aria-hidden='true'></span></a></span> <span class='input-group-addon'><a href='#' onclick=\"location.reload();\" title='Renovar'><span class='glyphicon glyphicon-refresh' aria-hidden='true'></span></a></span>
</div> </div>
</form> "; } ?> </form> "; }else{ echo "/ $sesion /<input type='text' name='tiempo_session' size='18' class='form-control input-sm' readonly>";}
*/ ?>
<?php <?php
///echo adjuntar_basico('33'); ///echo adjuntar_basico('33');

View File

@ -9,24 +9,25 @@ function delayTimer() {
var delayFunction = delayTimer(); var delayFunction = delayTimer();
function revisarSession(){ function revisarSession(sesion){
tiempo = "30"; tiempo = "30";
gavela="19"; gavela="19";
timestamp = Math.round(Date.now() /1000) timestamp = Math.round(Date.now() /1000)
inicio = leerCookie("timestamp"); inicio = sesion;//leerCookie("timestamp");
transcurrido = (timestamp - inicio); transcurrido = (timestamp - inicio);
transcurrido_minutos = Math.round(transcurrido/60); transcurrido_minutos = Math.round(transcurrido/60);
restante = (tiempo - transcurrido_minutos); restante = (tiempo - transcurrido_minutos);
prefin = (tiempo*60)-transcurrido; prefin = (tiempo*60)-transcurrido;
//sesion = "hola";
document.form_session.tiempo_session.value = "Cierra en: "+restante+" minutos "; document.form_session.tiempo_session.value = "Cierra en: "+restante+" minutos ("+transcurrido+" "+sesion+") ";
if(restante == 1 ){ if(restante == 1 ){
//alert(transcurrido); //alert(transcurrido);
location.href="../../salir.php"; location.href="../../salir.php";
}else{ }else{
setTimeout("revisarSession()",2000) ; setTimeout("revisarSession("+sesion+")",2000) ;
} }
} }
@ -57,8 +58,8 @@ function loadArticle(pageNumber,id,plantilla,registros,scroll,formato) {
// $('#scroll-contentx').append(html); // $('#scroll-contentx').append(html);
var contenido = html; var contenido = html;
newDiv.innerHTML = contenido; newDiv.innerHTML = contenido;
$('.lazy').lazy({ $('.lazy').lazy({
// your configuration goes here // your configuration goes here
//combined: true, //combined: true,
@ -622,6 +623,3 @@ else if (document.all) document.all[''+id+''].style.visibility = "hidden"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden" else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
} }
} }