我正在使用 usercake 用户管理系统的 mod。用户蛋糕: http
:
//usercake.com/ 模组:http ://usercake.com/thread.php?id=366
该模组可以保护子文件夹中的文件。这是目录概述 (admin_pages.php) 的来源:
<?php
/*
UserCake Version: 2.0.2
http://usercake.com
*/
$root=str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']);
require_once("models/config.php");
if (!securePage($_SERVER['PHP_SELF'])){die();}
$path="";
if(isset($_GET['path'])) $path=$_GET['path'];
$script=dirname($_SERVER['PHP_SELF']);
$baspth=$path;
$dir = glob($root.$path."/*" ,GLOB_ONLYDIR);
$pages = getPageFiles($root.$path); //Retrieve list of pages in root usercake folder
$dbpages = fetchAllPages(); //Retrieve list of pages in pages table
$creations = array();
$deletions = array();
//Check if any pages exist which are not in DB
if (count($pages) > 0)
foreach ($pages as $page){
if(!isset($dbpages[$page])){
$creations[] = $page;
}
}
//Enter new pages in DB if found
if (count($creations) > 0) {
createPages($creations) ;
}
if (count($dbpages) > 0){
//Check if DB contains pages that don't exist
foreach ($dbpages as $page){
if(!isset($pages[$page['page']])){
$deletions[] = $page['id'];
}
}
}
//Delete pages from DB if not found
/*if (count($deletions) > 0) {
deletePages($deletions);
}*/
//Update DB pages
$dbpages = fetchAllPagesD($path."/");
require_once("models/header.php");
echo "
<body>
<div id='wrapper'>
<div id='content'>
<h1>Nutzermanagement</h1>
<h2>Admin Pages</h2>
<div id='left-nav'>";
include("left-nav.php");
echo "
</div>
<div id='main'>
<table class='admin'>
<tr><th><h2>".$baspth."/</h2></th></tr>
<tr><td style='padding-right:25px;'><table class='admin' width='300'>
<tr><th>Id</th><th align='left'>Page</th><th>Access</th></tr>
";
//Display list of pages
if (count($dbpages) > 0)
foreach ($dbpages as $page){
echo "
<tr>
<td>
".$page['id']."
</td>
<td>
<a href ='admin_page.php?id=".$page['id']."'>".basename($page['page'])."</a>
</td>
<td>";
//Show public/private setting of page
if($page['private'] == 0){
echo "Public";
}
else {
echo "Private";
}
echo "
</td>
</tr>";
}
else echo "<tr><td> </td></tr>";
echo "</table></td>
<td style='padding-left:40px;border-left:1px solid'><table class='admin'>
<tr><th align='left'>Directories</th></tr>
";
//echo"<br>realpth:".$realpth." baspth:".$baspth." dirname (baspth):".dirname($baspth)."<br>";
if($path!="/" )
{
$top=dirname($baspth);
if($top=="\\")$top="";
echo "<tr><td><a href='".$_SERVER['PHP_SELF']."?path=".$top."'>../</a></tr></td>";
}
if (count($dir) > 0)
foreach ($dir as $directory){
$directory =str_replace($root,'',$directory);
echo "
<tr>
<td>
";
echo "<a href='".$_SERVER['PHP_SELF']."?path=".$directory."'>".basename($directory)."</a>";
echo "
</td>
</tr>";
}
echo "</table></td></tr>";
echo "
</table>
</div>
<div id='bottom'></div>
</div>
</div>
</body>
</html>";
?>
问题是,代码总是在页面顶部返回实际路径,在所有其他代码之前。这意味着,如果我使用浏览器检查源代码,它会显示,例如:
1 /folder/
而且我在源代码中找不到创建第一行的位置。任何想法?