Location: PHPKode > projects > phpGrabComics > www/admin/md5.php
<?php
/*

Copyright © 2001, 2002, 2003, 2004, 2005 Andres Baravalle

This file is part of phpGrabComics.

phpGrabComics is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

phpGrabComics is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with phpGrabComics; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/
include_once("dir.php");
include_once($dir . "inc/prepend.php");
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><!-- InstanceBegin template="../Templates/accessible.dwt" codeOutsideHTMLIsLocked="true" -->
<head>

<?php
include_once($dir . "inc/head.php");
?>
<!-- #BeginEditable "doctitle" -->
<?php
$title="Password setup";
?>
<!-- #EndEditable -->
<title>
<?php 
if($title!="")
	echo "phpGrabComics - " . $title;
else
{
	$title = "phpGrabComics";
	echo $title;
}
?>
</title>
</head>
<body> 
<div id="header"> 
	<div class="left" id="logo"><a href="../index.php"><img src="<?php echo $banners_file; ?>/phpgrabcomics_10.png" alt="phpGrabComics home page" width="85" height="85" style="vertical-align: middle; margin-right: 36px;" /></a><h1><?php echo $title; ?></h1></div> 
	<?php
	// disable search bar for sites other then the main one.
	if(!empty($atomz_code))
	{
	?>	
	<div class="right" id="title" style="vertical-align: top;">		
		<form method="get" action="../search.php">
			<p style="text-align:right"><br /><input size="15" name="sp-q" value="<?php if(isset($_REQUEST["sp-q"])) echo $_REQUEST["sp-q"]; ?>" />
				<input type="hidden" name="sp-a" value="<?php echo $atomz_code; ?>" style="font-size:12px;background-color:#FFFFCC" accesskey="s" />
				<input type="hidden" name="sp-p" value="all" />
				<input type="hidden" name="sp-f" value="iso-8859-1" />
				<input type="submit" value="Search" />				
			</p>
		</form>		
	</div> 
	<?php
	}
	?>
	<hr /> 
</div> 
<div id="body"> 
	<?php
	if (isset($_GET["show_source"]) and $_GET["show_source"]==1)
	{	
		echo "<br /><h2>Source of: ".$_SERVER["SCRIPT_NAME"]."</h2>\n<hr />\n";
		highlight_file($_SERVER["SCRIPT_FILENAME"]);
		printf("<hr /><br />". _LAST_MODIFIED . ": %s", gmdate("Y/M/d H:i:s",filemtime($_SERVER["SCRIPT_FILENAME"])));
	}
	else
	{
	?> 
	<!-- #BeginEditable "testo dentro il livello" --> 
		<?php
				if(!isset($_GET["md5_psw"]) or empty($_GET["md5_psw"]))
				{
				?>
				<p>In the file <code>inc/config.php</code> you will have to set up the md5 hash of your password. </p><p> To do that, use the following form and write in the config file the value that will be returned, instead of your password. You will be able to use the password that you choose without writing it in the configuration file, which would be unsafe.</p>
				<form action="<?php echo $_SERVER["../PHP_SELF"]; ?>" id="configure" method="get">
					<table cellpadding="2"> 
						<tr> 
							<td>admin password</td> 
							<td><input type="text" name="md5_psw" value="md5_psw" /></td> 
						</tr>
						<tr>
							<td colspan="2"><input type="submit" /></td>
						</tr>
					</table> 
				</form>	
				<?php
				}
				else
				{
				?>
					<p>The md5 hash to write in the configuration file for the password <i><?php echo $_GET["md5_psw"]; ?></i> is <?php echo md5($_GET["md5_psw"]);?> </p>
				<?php
				}
			?> 
<!-- #EndEditable --> 
	<?php
	}
	?> 
</div> 
<div id="footer"> 
	<hr /> 
	<div class="left" id="source"><a href="<?php echo $dir; ?>index.php"><img src="<?php echo $dir; ?>images/logo.png" id="show_source" width="32" height="48" alt="show source" /></a> <a href="<?php echo $_SERVER["SCRIPT_NAME"];?>?show_source=1">show source</a></div> 
	<div class="right" id="hosted"> <a href="http://sourceforge.net/projects/phpgrabcomics/"><img src="<?php echo $dir; ?>sourceforge.php" id="sourceforge" alt="SourceForge" /></a> phpGrabComics	project is hosted at <a href="http://sourceforge.net/projects/phpgrabcomics/">sourceforge.net</a>.</div> 
</div> 
</body>
<!-- InstanceEnd --></html>
<?php
include_once($dir . "inc/append.php");
?>
Return current item: phpGrabComics