<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

include_once( "../include/class.SQLString.php" );
include_once("auth.php");

## mysql verbindung aufbauen
db_connect($db_host, $db_user, $db_pass);
## /mysql verbindung aufbauen

$id = safe_query( "select maxftp, webmail, webftp, pwschutz, fehlerseiten, perl from kunden where kunde = ? ", TRUE, new SQLString( $PHP_AUTH_USER ) );
$werte = db_fetch_array($id);
$maxftp = $werte["maxftp"];
$skwebmail = $werte["webmail"];
$skwebftp = $werte["webftp"];
$skfehlerseiten = $werte["fehlerseiten"];
$skpwschutz = $werte["pwschutz"];
$skperl = $werte["perl"];
?>
<HTML>
<HEAD>
<META content="text/html; charset=<? echo $lang_html_charset; ?>" http-equiv=Content-Type>
<LINK href="<?=$strSkinName?>/style.css" rel=stylesheet type=text/css>
</HEAD>

<BODY bgColor=#ffffff bottomMargin=0 leftMargin=0 topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0">
<br><? include("../fehler.inc.php"); ?>
<script>
function doChange()
{
document.forms[0].submit();
}
</script>
<table class="tblbgcolor" align="left" border="1" cellpadding="3" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
        <tr > 
          <td class="titel-3" ><? echo ltext("tofe_cell_dir"); ?></td>
          <td class="titel-3" ><? echo ltext("tofe_cell_action"); ?></td>
        </tr>
        <?
$id = safe_query( "select * from fehlermeldungen where kunde = ? ", TRUE, new SQLString( $PHP_AUTH_USER ) );
while ($werte = db_fetch_array($id))
	{
	 $pfade[] = $werte["pfad"];
	 if ($werte["pfad"] == "/") $root_protected = 1;
	}

if ($root_protected == 1) $actionlink = '<a class=data href="tools_fehlerseiten_aendern.php?pfad=/">'.ltext("tofe_link_edit").'</a>'; else $actionlink = '<a class=data href="tools_fehlerseiten_neu.php?pfad=/">'.ltext("tofe_link_new").'</a>';
echo '<tr><td ><img src="'.$strSkinName.'/file_icons/file_dir.gif"  height="16" border="0"> <a class=data href="tools_fehlerseiten.php?dir=/">html</a></td><td>'.$actionlink.'</td></tr>';


if (substr($dir, 0, 1) != "/") $dir = "/".$dir;
$dir = "/$PHP_AUTH_USER/html".$dir;

$dirs = explode("/", $dir);
$i = 2;
$start = true;
$abbau = false;
while ($i > 1)
	{
	 $i1 = $i+1;
	 $listname = "lines".$i;
	 $startdir = "dir".$i;
	 if (istleer($$startdir)) $$startdir = 0;
	 if (!$abbau)
		{
		 $exec = $bindir."/lsdir.pl ";
		 for ($e = 1; $e <= $i; $e++) $exec .= "/".$dirs[$e];
		 exec($exec, $$listname, $return);
		}
	 if (count($$listname) > $$startdir)
		{
		 for ($n = $$startdir; $n < count($$listname); $n++)
			{
			 $leer =  ($i-1) * 16;
			 $link = "";
			 for ($e = 3; $e <= $i; $e++) $link .= "/".$dirs[$e];
			 $link .= "/".${$listname}[$n];
			 $protected = 0;
			 for ($z = 0; $z < count($pfade); $z++)
				{
				 if ($pfade[$z] == $link) $protected = 1;
				}
			 if ($protected == 1) $actionlink = '<a class=data href="tools_fehlerseiten_aendern.php?pfad='.$link.'">'.ltext("tofe_link_edit").'</a>'; else $actionlink = '<a class=data href="tools_fehlerseiten_neu.php?pfad='.$link.'">'.ltext("tofe_link_new").'</a>';
			 echo '<tr><td ><img src="'.$strSkinName.'/file_icons/1x1.gif" width="'.$leer.'" height="16"><img src="'.$strSkinName.'/file_icons/file_dir.gif"  height="16" border="0"> <a class=data href="tools_fehlerseiten.php?dir='.$link.'">'.${$listname}[$n].'</a></td><td>'.$actionlink.'</td></tr>';
			 if (${$listname}[$n] == $dirs[$i1])
				{
				 $i++;
				 $$startdir = $n+1;
				 break 1;
				}

			 if (($n+1) == count($$listname))
				{
				 $i--;
				 $abbau = true;
				}
			}
		} else
		{
		 $i--;
		 $abbau = true;
		}
	}
?>
</TABLE>
</BODY>
</HTML>
<?
db_close(); 
?>
