Location: PHPKode > projects > LabWiki > labwiki/show_backup.php
<?php 

// Show a backup qwiki file
require_once( "_global.php" );

// Disable Caching
QWDisableCaching( );

// Checks

if(!$QW['userIsAuthenticated']){QWRedirect( "login.php" );exit;}

if (!isset($_GET['page']))
{echo "Document not specified.</body></html>"; exit;}
else
{$filename = $_GET['page'];
 if(strlen($filename)>0)
 {
 // get document-specific directory name
 $dir_name = substr ($filename, 0, -11);
 if (ereg("(\.qwiki)$",$filename) && !ereg("\/\.\.", $filename))
  {$QW['pagePath'] = "backups/" . "$dir_name" . "/". "$filename";} 
 else
  {echo "Not allowed.</body></html>"; exit;}
 }
 else
 {echo "Document not specified.</body></html>"; exit;
 }
}

// QWTIndexFormatBody
$QW_TEMPLATE['injectBody'] = "QWTBackupFormatBody";
function QWTBackupFormatBody( )
{
global $QW;
return QWFormatQwikiFile( $QW['pagePath'] );
}

// Output debugging, if requested
if( $QW_CONFIG['enableDebugging'] && $QW['requestDebug'] ) echo QWFormatDebug( );

// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);

// Start HTML
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<title>
<?php 
$page_name = str_replace("_", " ", $QW[page]);
echo ("$QW_CONFIG[title] - $page_name");
?>
</title>
<meta name="description" content="Methods, protocols, techniques, tutorials and other information for biomedical students and researchers from the Laboratory of Prof. Pamela Stanley at the Albert Einstein College of Medicine in New York -
<?php 
$page_name = str_replace("_", " ", $qw[page]);
echo (" $page_name");
?>
" />
<meta name="keywords" content="protocols, molecular biology, rna, dna, protein, cell biology, glycobiology, spectrometry, page, blotting, antibodies, how, writing, presentation, transfection, ligation, purification, probe, mouse, Laboratory, Pamela Stanley, AECOM, Albert Einstein College of Medicine, Graduate school, PhD, glycobiology, sugar, glycan, molecular, cell, biomedical, biology, methods, techniques, protocol, links, bioinformatics, wiki, glycosylation, development, cancer,
<?php 
$page_name = str_replace("_", " ", $qw[page]);
echo (" $page_name");
?>
" />
<link rel="stylesheet" type="text/css" href="labstyle.css" />
<style type="text/css" media="all">
/*<![CDATA[*/
@import "labstyle.css";
/*]]>*/
</style>
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
</head>
<body class="QWBody">
<div style="width:800px;">

  <div id="main">
   <?php echo $QW_TEMPLATE['injectBody'](); 
   ?><br />
  </div>

</div>
</body>
</html>
Return current item: LabWiki