fixed problem with being able to save the header.inc.php file

This commit is contained in:
seek3r 2000-12-18 21:49:12 +00:00
parent b24264a48b
commit 91c0a44d06

View File

@ -20,18 +20,18 @@
echo "</pre></body></html>"; echo "</pre></body></html>";
break; break;
case "write config": case "write config":
if(!is_writeable ("../header.inc.php")){ if(is_writeable ("../header.inc.php")|| (!file_exists ("../header.inc.php") && is_writeable ("../"))){
show_header("Error generating header.inc.php");
echo "Could not open header.inc.php for writing!<br>\n";
echo "Please check read/write permissions on directories or back up and use another option.<br>";
echo "</td></tr></table></body></html>";
}else{
show_header("Saved header.inc.php"); show_header("Saved header.inc.php");
$newheader = generate_header(); $newheader = generate_header();
$fsetup = fopen("../header.inc.php","w"); $fsetup = fopen("../header.inc.php","w");
fwrite($fsetup,$newheader); fwrite($fsetup,$newheader);
fclose($fsetup); fclose($fsetup);
echo "Created header.inc.php!<br>"; echo "Created header.inc.php!<br>";
}else{
show_header("Error generating header.inc.php");
echo "Could not open header.inc.php for writing!<br>\n";
echo "Please check read/write permissions on directories or back up and use another option.<br>";
echo "</td></tr></table></body></html>";
} }
break; break;
default: default:
@ -189,15 +189,16 @@
echo "<br>"; echo "<br>";
echo "<form>"; echo "<form>";
if(is_writeable ("../header.inc.php")){ if(is_writeable ("../header.inc.php")|| (!file_exists ("../header.inc.php") && is_writeable ("../"))){
echo '<input type=submit name="action" value="write config">'; echo '<input type=submit name="action" value="write config">';
echo' or <input type=submit name="action" value="download"> or <input type=submit name="action" value="view"> the file.</form>';
}else{ }else{
echo 'Cannot create the header.inc.php due to file permission restrictions.<br> Instead you can '; echo 'Cannot create the header.inc.php due to file permission restrictions.<br> Instead you can ';
echo'<input type=submit name="action" value="download">or <input type=submit name="action" value="view"> the file.</form>'; echo'<input type=submit name="action" value="download">or <input type=submit name="action" value="view"> the file.</form>';
echo '<form action="index.php" method=post>';
echo'<br> After retrieving the file put it into place as the header.inc.php, then click continue.<br>';
echo'<input type=submit name="junk" value="continue">';
} }
echo '<form action="index.php" method=post>';
echo'<br> After retrieving the file put it into place as the header.inc.php, then click continue.<br>';
echo'<input type=submit name="junk" value="continue">';
echo "</form>"; echo "</form>";
echo "</body>"; echo "</body>";
echo "</html>"; echo "</html>";