1
0
forked from qwerty/milfs

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

View File

@ -20,7 +20,7 @@ require ("funciones/conex.php");
$xajax->processRequests();
$embebido =0;
if (isset($_REQUEST['form'])) {
if (isset($_REQUEST['form'])) {
$form = $_REQUEST['form'];
$opciones["formato"]= $_REQUEST['formato'];
} else {$form = "";}
@ -44,9 +44,9 @@ if (isset($_REQUEST['t'])) {$t = $_REQUEST['t'];} else {$t = "";}
<?php
$xajax->printJavascript("xajax/");
if(!isset($_REQUEST['experimental'])){
$bootstrap= "
<script
src='https://code.jquery.com/jquery-3.3.1.min.js'
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'>
";
}else{
$bootstrap="
<script src='../librerias/jquery/jquery-2.1.4.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'>
";
";
}
// $xajax->debugOn();
//$xajax->statusMessagesOn();
@ -211,7 +211,7 @@ legend.legend-area {
</style>
</head>
<body onload="revisarSession()"; >
<body >
<?php if($embebido ==1) {
if($form!=''){ echo formulario_embebido($form,$opciones);}
elseif($identificador !='') { echo mostrar_identificador($identificador,$id);}
@ -256,13 +256,14 @@ else{}
<div class='row'>
<div id='' class='col-sm-6'>
<?php if(isset($_SESSION['id'])){ echo "
<form id='manejo_sesion' name='form_session' class='navbar-form navbar-left'>
<?php /* $sesion = "<pre>".print_r($_SESSION,true)."</pre>"; if(isset($_SESSION['id'])){ echo "
$sesion <form id='manejo_sesion' name='form_session' class='navbar-form navbar-left'>
<div class='input-group'>
<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>
</div>
</form> "; } ?>
</form> "; }else{ echo "/ $sesion /<input type='text' name='tiempo_session' size='18' class='form-control input-sm' readonly>";}
*/ ?>
<?php
///echo adjuntar_basico('33');

View File

@ -9,24 +9,25 @@ function delayTimer() {
var delayFunction = delayTimer();
function revisarSession(){
function revisarSession(sesion){
tiempo = "30";
gavela="19";
timestamp = Math.round(Date.now() /1000)
inicio = leerCookie("timestamp");
inicio = sesion;//leerCookie("timestamp");
transcurrido = (timestamp - inicio);
transcurrido_minutos = Math.round(transcurrido/60);
restante = (tiempo - transcurrido_minutos);
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 ){
//alert(transcurrido);
location.href="../../salir.php";
}else{
setTimeout("revisarSession()",2000) ;
setTimeout("revisarSession("+sesion+")",2000) ;
}
}
@ -57,8 +58,8 @@ function loadArticle(pageNumber,id,plantilla,registros,scroll,formato) {
// $('#scroll-contentx').append(html);
var contenido = html;
newDiv.innerHTML = contenido;
$('.lazy').lazy({
// your configuration goes here
//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"
}
}