<?php
/*
LabWiki 1.2.1, 22 August 2012, by Santosh Patnaik, MD, PhD. Based on QwikiWiki 1.5 of David Barrett
*/
// Show a backup qwiki file
include( "_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( );
// 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=
<?php
echo ($QW_CONFIG['encoding']);
?>
" />
<meta http-equiv="Content-Language" content="en-us" />
<title>Backup /
<?php
$page_name = str_replace("_", " ", $QW['page']);
echo (htmlspecialchars($page_name) .' - '.htmlspecialchars($QW_CONFIG['title']));
?>
</title>
<meta name="description" content="
<?php
echo (htmlspecialchars($QW_CONFIG['metaContent']) . ' - ');
$page_name = str_replace("_", " ", $QW['page']);
echo htmlspecialchars(" $page_name");
?>
" />
<meta name="keywords" content="
<?php
echo (htmlspecialchars($QW_CONFIG['metaKeywords']) . ', ');
$page_name = str_replace("_", " ", $QW['page']);
echo htmlspecialchars(" $page_name");
?>
" />
<link rel="stylesheet" type="text/css" href="
<?php
echo ($QW_CONFIG['stylesheetFilename']);
?>
" />
<style type="text/css" media="all">
/*<![CDATA[*/
@import "
<?php
echo ($QW_CONFIG['stylesheetFilename']);
?>
";
/*]]>*/
</style>
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<script type="text/javascript" charset="
<?php
echo ($QW_CONFIG['encoding']);
?>
">
//<![CDATA[
<!--//
function confirmdelete(deletePage)
{
if (confirm('Are you sure?')) {location = deletePage;}
}
function confirmsubmit()
{
var agree = confirm ("Are you sure?");
if (agree)
return true ;
else
return false ;
}
<?php
// when backup maintenance mode ... backups.php
if(isset($extra_javascript)){echo ($extra_javascript);}
?>
// -->
//]]>
</script>
</head>
<body class="QWBody">
<div class="QWBody">
<div id="main">
<?php echo $QW_TEMPLATE['injectBody']();
?><br />
</div>
</div>
<?php
if( $QW_CONFIG['enableDebugging'] && $QW['requestDebug'] ) echo QWFormatDebug( );
?>
</body>
</html>