| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | umask(0007); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-23 12:02:58 +02:00
										 |  |  | if (isset($_SERVER['PHP_AUTH_USER'])) | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 	$PHPki_user = md5($_SERVER['PHP_AUTH_USER']); | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  | 	$PHPki_user = md5('default'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $PHP_SELF = $_SERVER['PHP_SELF']; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function printHeader($withmenu="default") { | 
					
						
							|  |  |  | 	global $config; | 
					
						
							|  |  |  | 	$title = ($config['header_title']?$config['header_title']:'PHPki Certificate Authority'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	switch ($withmenu) { | 
					
						
							|  |  |  | 	case 'public': | 
					
						
							|  |  |  | 	case 'about': | 
					
						
							|  |  |  | 	case 'setup': | 
					
						
							|  |  |  | 		$style_css = './css/style.css'; | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case 'ca': | 
					
						
							|  |  |  | 	case 'admin': | 
					
						
							|  |  |  | 	default: | 
					
						
							|  |  |  | 		$style_css = '../css/style.css'; | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); | 
					
						
							|  |  |  | 	header("Expires: -1"); | 
					
						
							|  |  |  |         header("Cache-Control: no-store, no-cache, must-revalidate"); | 
					
						
							|  |  |  |         header("Cache-Control: post-check=0, pre-check=0", false); | 
					
						
							|  |  |  |         header("Pragma: no-cache"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	?>
 | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 	<!DOCTYPE html> | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 	<head> | 
					
						
							| 
									
										
										
										
											2013-07-22 22:26:36 +02:00
										 |  |  | 	<meta charset="utf-8"> | 
					
						
							| 
									
										
										
										
											2013-07-17 19:11:54 +00:00
										 |  |  | 	<title>PHPki: <?php echo $title?> </title>
 | 
					
						
							|  |  |  | 	<link rel="stylesheet" type="text/css" href="<?php echo $style_css?>"> | 
					
						
							| 
									
										
										
										
											2013-07-21 11:33:38 +02:00
										 |  |  | 	<script type="text/javascript" language="javascript"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	function setVisibility(rowName, show) { | 
					
						
							|  |  |  |         // Tabellenzelle ermitteln
 | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |         var actualVisibility=document.getElementById(rowName).style.visibility; | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |         if(show==false) { | 
					
						
							|  |  |  |                 document.getElementById(rowName).style.visibility = "hidden"; | 
					
						
							|  |  |  |                 document.getElementById(rowName).style.display = "none"; | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |                 document.getElementById(rowName).style.visibility = "visible"; | 
					
						
							|  |  |  |                 document.getElementById(rowName).style.display = ""; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	</script> | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 	</head> | 
					
						
							|  |  |  | 	<body> | 
					
						
							| 
									
										
										
										
											2013-07-17 19:11:54 +00:00
										 |  |  | 	<?php | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	if (isKonq()) {  | 
					
						
							| 
									
										
										
										
											2013-07-18 14:52:46 +00:00
										 |  |  | 		$logoclass  = '"logo-konq"'; | 
					
						
							|  |  |  | 		$titleclass = '"title-konq"'; | 
					
						
							|  |  |  | 		$menuclass  = '"headermenu-konq"'; | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2013-07-18 14:52:46 +00:00
										 |  |  | 		$logoclass  = '"logo-ie"'; | 
					
						
							|  |  |  | 		$titleclass = '"title-ie"'; | 
					
						
							|  |  |  | 		$menuclass  = '"headermenu-ie"'; | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	?>
 | 
					
						
							| 
									
										
										
										
											2013-07-17 19:11:54 +00:00
										 |  |  | 	<div class=<?php echo $logoclass?>>PHPki</div>
 | 
					
						
							|  |  |  | 	<div class=<?php echo $titleclass?>><?php echo $title?></div>
 | 
					
						
							|  |  |  | 	<?php | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	switch ($withmenu) { | 
					
						
							|  |  |  | 	case false: | 
					
						
							|  |  |  | 	case 'about': | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case 'setup': | 
					
						
							|  |  |  | 		?>
 | 
					
						
							| 
									
										
										
										
											2013-07-17 19:11:54 +00:00
										 |  |  | 		<div class=<?php echo $menuclass?>>
 | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 		<a class=<?php echo $menuclass?> href="readme.php">ReadMe</a>
 | 
					
						
							|  |  |  | 		<a class=<?php echo $menuclass?> href="setup.php">Setup</a>
 | 
					
						
							|  |  |  | 		<a class=<?php echo $menuclass?> href="about.php" target="_about">About</a>
 | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		</div> | 
					
						
							| 
									
										
										
										
											2013-07-17 19:11:54 +00:00
										 |  |  | 		<?php | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		break; | 
					
						
							|  |  |  | 	case 'public': | 
					
						
							|  |  |  | 		print "<div class=$menuclass>"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if (DEMO)  { | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 			print "<a class=$menuclass href=\"index.php\">Public</a>"; | 
					
						
							|  |  |  | 			print "<a class=$menuclass href=\"ca/\">Manage</a>"; | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		else { | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 			print "<a class=$menuclass href=\"index.php\">Menu</a>"; | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if (file_exists('policy.html')) { | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 			print '<a class='.$menuclass.' style="color: red;" href="policy.html" target="help">Policy</a>'; | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		?>
 | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 		<a class=<?php echo $menuclass?> href="help.php" target="_help">Help</a>
 | 
					
						
							|  |  |  | 		<a class=<?php echo $menuclass?> href="about.php" target="_about">About</a>
 | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		</div> | 
					
						
							| 
									
										
										
										
											2013-07-18 14:50:18 +00:00
										 |  |  | 		<?php | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		break; | 
					
						
							|  |  |  | 	case 'ca': | 
					
						
							|  |  |  | 	default: | 
					
						
							|  |  |  | 		print "<div class=$menuclass>"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if (DEMO)  { | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 			print "<a class=$menuclass href=\"../index.php\">Public</a>"; | 
					
						
							|  |  |  | 			print "<a class=$menuclass href=\"../ca/index.php\">Manage</a>"; | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		else { | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 			print "<a class=$menuclass href=\"index.php\">Menu</a>"; | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if (file_exists('../policy.html')) { | 
					
						
							| 
									
										
										
										
											2013-10-14 04:49:04 +06:00
										 |  |  | 			print '<a class='.$menuclass.' style="color: red;" href="../policy.html" target="help">Policy</a>'; | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		?>
 | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 		<a class=<?php echo $menuclass?> href="../help.php" target="_help">Help</a>
 | 
					
						
							|  |  |  | 		<a class=<?php echo $menuclass?> href="../about.php" target="_about">About</a>
 | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 		</div> | 
					
						
							| 
									
										
										
										
											2013-07-17 19:11:54 +00:00
										 |  |  | 		<?php | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 	?><hr style="width:99%; align:left; color:#99caff;" /><?php
 | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function printFooter() { | 
					
						
							|  |  |  | 	?>
 | 
					
						
							| 
									
										
										
										
											2013-07-18 15:04:57 +00:00
										 |  |  | 	<br /> | 
					
						
							|  |  |  | 	<hr style="width:99%; align:left; color:#99caff;" /> | 
					
						
							|  |  |  | 	<p style="margin-top: -5px; font-size: 8pt; text-align:center;">PHPki v<?php echo PHPKI_VERSION?> - Copyright 2003 - William E. Roadcap</p>
 | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | 	</body> | 
					
						
							|  |  |  | 	</html> | 
					
						
							| 
									
										
										
										
											2013-07-17 19:11:54 +00:00
										 |  |  | 	<?php | 
					
						
							| 
									
										
										
										
											2012-02-28 08:23:39 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ?>
 |