//almacerá información que va a la vista $data = array(); ####### Para la carga de la página ######## $scripts = array(); //incluir archivos js necesarios //$scripts [] = TIENDA."js/registro.js"; //información para la vista $data["scripts"] = $scripts; $data["title"] = $title; $data["subtitle"] = $subtitle; $data['proceso'] = 'Recupera tu contraseña'; ####### END carga de la página ####### Lógica para cerrar la sesión en la tienda session_start(); //no caché no_cache(); cerrar_session(); $url = site_url(); header("Location: {$url}", TRUE, 302); /* echo "Enviar<pre>"; print_r($_GET); print_r($_POST); print_r($_SESSION); echo "<pre>"; exit; */ ####### END Lógica de logout function cerrar_session() { foreach ($_SESSION as $key => $value) {
?> "> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <jdoc:include type="head" /> <!-- HTML5 Shim and Respond.js 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="<?php echo $this->baseurl . '/templates/' . $this->template . '/theme/js/html5shiv.js' . no_cache(); ?> "></script> <script src="<?php echo $this->baseurl . '/templates/' . $this->template . '/theme/js/respond.min.js' . no_cache(); ?> "></script> <![endif]--> </head> <body> <!-- Navigation --> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-menu-01"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span>
function draw_page_top($this_page) { # # Top navigation bar for CodeTrack. Do a few W3C-legal tricks with span colors on current page, and # (optionally) show balloon tooltips over links. # Unless we're debugging, don't cache any rendered (vs. form processing/redirect) page, and autologout after # CT_DEFAULT_PAGE_TIMOUT seconds (def. is 8 hours). Logout is proactively forced via refresh head meta directive. # global $debug_g, $current_session_g, $query_string_g; # Latter is Apache server variable if (!$debug_g) { no_cache(); } draw_page_header(); ?> <div id="bodyFrame"> <div id="navBar"> <a href='codetrack.php?page=home' title='Summary of your current project' <?php if ($this_page == 'home') { print ' id="navCurrent"'; } ?> >Home</a> <a href='codetrack.php?page=newIssue' title='Create a new defect report or Change Request' <?php if ($this_page == 'newIssue') { print ' id="navCurrent"'; } ?> >New Issue</a> <a href='codetrack.php?page=reports' title='Create simple and advanced reports' <?php if ($this_page == 'reports') { print ' id="navCurrent"'; } ?> >Reports</a> <a href='codetrack.php?page=projects' title='List of active projects' <?php if ($this_page == 'projects') { print ' id="navCurrent"'; } ?> >Projects</a> <?php if ($current_session_g["role"] == "Admin") { print "\t<a href='codetrack.php?page=adminLinks' " . ($this_page == 'adminLinks' ? 'id="navCurrent" ' : '') . "title='CodeTrack Administration and Setup'>Admin</a> \n\n"; } else { print "\t<a href='codetrack.php?page=tools' " . ($this_page == 'tools' ? 'id="navCurrent" ' : '') . "title='CodeTrack system tools'>Tools</a> \n\n"; } ?> <a href="javascript: this.print();" title="Printer friendly version of this page">Print</a> <a href="docs/help.html#home" title="Need help with this (or any) screen?" onclick='this.target="_blank";'>Help</a> <a href="codetrack.php?page=logout&origin=user" title="Log off the CodeTrack System">Logout</a> </div> <hr class="legacyDivider" /> <noscript> <div class="cfgProb"> CodeTrack is pretty broken without Javascript. Please turn it back on. </div> </noscript> <?php }
function secure_tokens($check = true, $generate = true) { if ($_SESSION['tinybrowser']['debug_mode']) { return; } no_cache(); if (session_id() != '') { if ($check == true) { if (!empty($_GET)) { if (empty($_GET['tokenget']) || preg_match('/[a-f0-9]{32}/', $_GET['tokenget']) != true) { echo 'NO GET TOKEN ' . TB_DENIED; exit; } else { $find_token = array_search($_GET['tokenget'], $_SESSION['get_tokens']); if ($find_token === false) { echo 'INVALID GET TOKEN ' . TB_DENIED; exit; } else { unset($_SESSION['get_tokens'][$find_token]); } } } if (!empty($_POST)) { if (empty($_POST['tokenpost']) || preg_match('/[a-f0-9]{32}/', $_POST['tokenpost']) != true) { echo 'NO POST TOKEN ' . TB_DENIED; exit; } else { $find_token = array_search($_POST['tokenpost'], $_SESSION['post_tokens']); if ($find_token === false) { echo 'INVALID POST TOKEN ' . TB_DENIED; exit; } else { unset($_SESSION['post_tokens'][$find_token]); } } } } if ($generate == true) { $_SESSION['get_tokens'][] = md5(uniqid(mt_rand(), true)); $_SESSION['post_tokens'][] = md5(uniqid(mt_rand(), true)); } } }
function set_output_file($file_name, $content_type = "application/x-download", $attachment = true, $file_size = 0) { header('Content-Description: File Transfer'); header("Content-type: " . $content_type); header("Content-Transfer-Encoding: Binary"); no_cache(); header('Pragma: public'); if ($attachment) { header('Content-Disposition: attachment; filename=' . $file_name); } if ($file_size) { header('Content-length: ' . $file_size); } }