Location: PHPKode > scripts > Cwfm > cwfm/php/Options.php
<?
//////////////////////////////////////////////////////////////////////
//
// Options.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");
include_once("Userdb.php");
include_once("Global.php");
session_start();
if( file_exists("data/Cwfmini.php") )
	include_once("data/Cwfmini.php");
else
	$Language = "English";
include_once("lang/$Language.php");
global $AdUser, $Uname;
if( $sid != session_id() || $Uname != $AdUser )
{
	IntrusionNotify();
	exit();
}
?>
<html>
<head><title><? echo $T3_L?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel=stylesheet href="Css.php" type="text/css">
<script language="JavaScript">
function SetCBox(name, val)
{
	dml=document.General;
	len = dml.elements.length;
	var i=0;
	for( i=0 ; i<len ; i++) 
	{
		if (dml.elements[i].name==name) 
		{
			dml.elements[i].checked=val;
		}
	}
}
function checkOut()
{
	if( document.General.name.value == "" )
	{
		alert('<?echo $A10_L?>');
		document.General.name.focus();
		return;
	}
	if( document.General.pass1.value == "" )
	{
		alert('<?echo $A11_L?>');
		document.General.pass1.focus();
		return;
	}
	if( document.General.pass1.value != document.General.pass2.value )
	{
		alert('<?echo $A12_L?>');
		document.General.pass1.focus();
		return;
	}
	document.General.submit();
}
</script>
</head>
<body <? if( !isset($action) ) echo "onload=\"document.General.name.focus()\"" ?> >
<?
global $action, $icons;
if( $action == "Checkout" )
{
	if( $oldPwd != $pass1 )
		$password = md5($pass1);
	else
		$password = $pass1;
	@chmod("data/Cwfmini.php", 0600);
	if( !($fp = @fopen("data/Cwfmini.php", "w")) )
	{
		echo "<script language=\"JavaScript\">\n";
		echo "alert('$A18_L');\n";
		echo "</script>";
		exit;
	}
	fwrite($fp, "<?\n\$AdUser = \"$name\";\n");
	fwrite($fp, "\$AdPassword = \"$password\";\n");
	fwrite($fp, "if( !isset(\$ShowIcons) )\n");
	fwrite($fp, "    \$ShowIcons = \"".($icons == "1"?"1":"0")."\";\n" );
	fwrite($fp, "\$ZipPath = \"$zpath\";\n");
	fwrite($fp, "\$UnzipPath = \"$unzpath\";\n");
	fwrite($fp, "if( !isset(\$Language) )\n");
	fwrite($fp, "    \$Language = \"$language\";\n");
	fwrite($fp, "\$userDat = \"data/user.dat.php\";\n");
	fwrite($fp, "\$userTmp = \"tmp/user.tmp\";\n");
	fwrite($fp, "\$descIdx = \"data/desc.idx.php\";\n");
	fwrite($fp, "\$descDat = \"data/desc.dat.php\";\n");
	fwrite($fp, "\$BgCol = \"#F0F0E0\";\n");
	fwrite($fp, "\$FgCol = \"#000000\";\n");
	fwrite($fp, "\$LoBgCol = \"#F0F0E0\";\n");
	fwrite($fp, "\$LoFgCol = \"#000000\";\n");
	fwrite($fp, "\$HiBgCol = \"#DFDFDF\";\n");
	fwrite($fp, "\$HiFgCol = \"#000000\";\n");
	fwrite($fp, "\$MnFlCol = \"#B48000\";\n");
	fwrite($fp, "\$MnOvBgCol = \"#DFDFDF\";\n");
	fwrite($fp, "\$DbVersion = \"V09\";\n");
	fwrite($fp, "\$Stop = \"<? echo 'no way'; exit; ?>\\n\";\n?>\n"); 
	fclose($fp);
	@chmod( "data/Cwfmini.php", 0400);
	if( $AdUser == "" ) 
	{ 
		echo "<script language=\"JavaScript\">\n";
		echo "document.location='index.php'";
		echo "</script>\n";
	}
	else
		exit;
}
?>
<table border="0">
  <tr> 
    <td><a href="javascript:checkOut()" class=menu><? echo HiMenu($F30_L,1) ?></a></td>
  </tr>
</table>
<form name="General" method="post" action="Options.php?action=Checkout">
  <table border="0" cellspacing="7" class=form>
    <tr> 
      <td nowrap> 
        <div align="left">
          <? echo $F31_L ?>
          </div>
      </td>
      <td> 
        <div align="left"> 
          <input type="text" name="name" size="50">
        </div>
      </td>
    </tr>
    <tr> 
      <td nowrap> 
        <div align="left">
          <? echo $F32_L ?>
          </div>
      </td>
      <td > 
        <div align="left"> 
          <input type="password" name="pass1" size="50">
        </div>
      </td>
    </tr>
    <tr> 
      <td nowrap> 
        <div align="left">
          <? echo $F33_L ?>
          </div>
      </td>
      <td > 
        <div align="left"> 
          <input type="password" name="pass2" size="50">
        </div>
      </td>
    </tr>
    <tr> 
      <td nowrap>
        <? echo $F34_L ?>
        </td>
      <td > 
        <input type="checkbox" name="icons" value="1" class=cb>
      </td>
    </tr>
    <tr> 
      <td nowrap>
        <? echo $F35_L ?>
        </td>
      <td > 
        <input type="text" name="zpath" size="50">
      </td>
    </tr>
    <tr> 
      <td nowrap>
        <? echo $F54_L ?>
        </td>
      <td > 
        <input type="text" name="unzpath" size="50">
      </td>
    </tr>
    <tr>
      <td nowrap>
        <? echo $F36_L ?>
        </td>
      <td >
        <select name="language" size="1">
            <option value="BrazilianPortuguese"> 
            <?echo $S2E_L?>
            </option>        
            <option value="Castellano"> 
            <?echo $S2C_L?>
            </option>        
            <option value="Dutch"> 
            <?echo $S2D_L?>
            </option>        
            <option value="English" selected> 
            <?echo $S2A_L?>
            </option>
            <option value="German"> 
            <?echo $S2G_L?>
            </option>
            <option value="Indonesian"> 
            <?echo $S2F_L?>
            </option>
            <option value="Italian"> 
            <?echo $S2B_L?>
            </option>
            <option value="Polish"> 
            <?echo $S2H_L?>
            </option>
        </select>
      </td>
    </tr>
  </table>
  <input type="hidden" name="oldPwd">
</form>
<?
if( $action == "" && isset($AdUser) )
{
	echo "<script language=\"JavaScript\">\n";
	echo "document.General.name.value=\"$AdUser\";\n";
	echo "document.General.pass1.value=\"$AdPassword\";\n";
	echo "document.General.pass2.value=\"$AdPassword\";\n";
	echo "document.General.zpath.value=\"$ZipPath\";\n";
	echo "document.General.unzpath.value=\"$UnzipPath\";\n";
	echo "document.General.oldPwd.value=\"$AdPassword\";\n";
	echo "setTimeout(\"SetCBox('icons', $ShowIcons)\",10);\n";
	echo "document.General.language.value=\"$Language\";\n";
	echo "</script>";
}
?>
</body>
</html>
Return current item: Cwfm