Location: PHPKode > scripts > Cwfm > cwfm/php/BootOpenFile.php
<?
//////////////////////////////////////////////////////////////////////
//
// BootOpenFile.php - Cwfm
//
// By Vincenzo Valvano - hide@address.com
//
// This program 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. This program 
// 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 this program; if not, write 
// to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
// Boston, MA  02111-1307  USA
//////////////////////////////////////////////////////////////////////
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
session_start();
include_once("Global.php");
include_once("lang/$Language.php");
if( !ValidSession() )
{
	IntrusionNotify();
	exit;
}
if( !$CanEdit )
	exit;
$f = LastSelected();
$file = FilePart($f);
if( $f == "" )
{
	echo "<script language=\"JavaScript\">\n";
	echo "alert('$A5_L');";
	echo "</script>";
	exit;
}
if( strncmp(cType($f), "text", 4))
{
	echo "<script language=\"JavaScript\">\n";
	echo "if( !confirm('$file $A40_L') )\n";
	echo "window.location='Empty.php';\n";
	echo "</script>";

}
if( filesize($f) > 100000 )
{
	echo "<script language=\"JavaScript\">\n";
	echo "if( !confirm('$file $A41_L') )\n";
	echo "window.location='Empty.php';\n";
	echo "</script>";

}
?> 
<script language="JavaScript">
var w = 700;
var h = 520;
var top = (screen.height-h)/2 - 50;
var left = (screen.width-w)/2;
window.open('FileEdit.php?command=open&dir=<?echo $dir?>&file=<?echo EncodeFilename($file)?>', 'Newfile','width='+w+',height='+h+',top='+top+',left='+left);
</script>
Return current item: Cwfm