Location: PHPKode > projects > PhpCsAdmin > phpcsadmin/install.php
<html>

<head>
<meta http-equiv="Content-Language" content="fr">

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>PhpCsAdmin Installer</title>
<style>
<!--
input        { font-family: Verdana; font-size: 8pt; color: #333333; font-weight: bold; 
               border-style: solid; border-width: 1; background-color: #C0C0C0 }
-->
</style>
</head>

<body style="font-family: Verdana; font-size: 8pt; color: #333333">

<p>
<img border="0" src="logo_phpcsadmin.gif" width="287" height="149" align="left">Welcome to the PhpCsAdmin Installer.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><font color="#FF0000">Make sure you have <b>screen</b> installed and htpassw (screen might not 
be required but is currently needed by the scripts)</font></p>
<p>First we will gather some informations about your Linux half life dedicated 
server</p>
<form method="POST" action="install.php">
  Path to Hlds :
  <input type="text" name="hldspath" size="20" value="/home/hlds_l"></p>
  <p>Owner of the directory (if you don't know let it blank)
  <input type="text" name="dirowner" size="20"></p>
  <p>You will now have to choose a username and password to protect the administration page 
  from any visitor</p>
  <p><input type="text" name="username" size="20"></p>
  <p><input type="password" name="password" size="20"></p>
  <p><input type="submit" value="ok" name="B1">
  <input type="reset" value="Erase" name="B2"></p>
  <?
  if (is_file("config.inc.php")) {
  	system("rm -rf config.inc.php");
  }
  else {
  	if (($hldspath=="")|($username=="")|($password=="")) {
  		if ($hldspath=="") echo "You must enter a directory eg : /home/hlds_l";
  		if ($username="") echo "You must enter a username to protect phpcsadmin";
  		if ($password=="") echo "You must enter a password to protect phpcsadmin";
  	}
  	else {
  	$fp = fopen("config.inc.php","a");
  	fputs($fp,"<?\n");
  	fputs($fp,"\$version = \"0.03\";\n");
  	fputs($fp,"\$hldspath = \"$hldspath\";\n");
  	fputs($fp,"\$dirowner = \"$dirowner\";\n");
  	fputs($fp,"?>");
  	fclose($fp);
  	system("chmod +x config.inc.php");
  		if (is_file("login.php")) {
  			system ("rm -rf login.php");
		}
  		else {
  		$fp = fopen("login.php","a");
 		fputs($fp,"<html><head><title>Authentication page</title></head><body><p>
  <img border=\"0\" src=\"logo_phpcsadmin.gif\" width=\"600\" height=\"313\"></p><p align=\"center\"><b><font face=\"Verdana\" size=\"1\" color=\"#FF0000\">Authentication page</font></b></p>
  <form method=\"POST\" action=\"admin.php\"><p align=\"center\"><input type=\"text\" name=\"admin\" size=\"20\" style=\"font-family: Verdana; font-size: 8pt; border: 1px solid #333333; background-color: #C0C0C0\"></p><p align=\"center\"><input type=\"text\" name=\"passwd\" size=\"20\" style=\"font-family: Verdana; font-size: 8pt; border: 1px solid #333333; background-color: #C0C0C0\"></p><p align=\"center\"><input type=\"submit\" value=\"Login\" name=\"B1\" style=\"font-family: Verdana; font-size: 8pt; border: 1px solid #333333; background-color: #C0C0C0\"><input type=\"reset\" value=\"Cancel\" name=\"B2\" style=\"font-family: Verdana; font-size: 8pt; border: 1px solid #333333; background-color: #C0C0C0\"></p><?
if ((\$admin==\"\")|(\$passw==\"\")) {
	if (\$login==\"\") echo \"Enter your login\";
	if (\$passwd=\"\") echo \"Enter your passorwd\";
}
else {
	if((\$admin==\"$login\")|(\$passwd==\"$password\")) {
		fopen(\"admin.php\",\"r\");
	}
	else {
		echo \"Login or password is incorrect, retry\";
	}
}
?></form><p align=\"center\">&nbsp;</p></body></html>");
		fclose($fp);
		}
		system("chown -R apache:apache /var/www/html");
		system("chmod -R ug+rwx /var/www/html");
	}
  	echo "<p><font color=\"#008000\">Ok config.inc.php successfully written, Password protection enabled for $username</font></p>";
  	}
  	?>
</form>

</body>

</html>
Return current item: PhpCsAdmin