mirror of
https://github.com/Clortox/SimpleFileRepository.git
synced 2025-01-09 02:17:59 +00:00
Add Debug Option to config
This commit is contained in:
parent
da12e25e3a
commit
74d6593cf5
46
index.php
46
index.php
@ -2,21 +2,18 @@
|
||||
<head>
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
//css, js, and other includes
|
||||
include 'www/include.php';
|
||||
include 'helpers/files.php';
|
||||
|
||||
//if this is a session inside the local connection
|
||||
if(strpos($_SERVER['REMOTE_ADDR'],"192.168.1.")){
|
||||
if($isDebug){
|
||||
ini_set('display_errors',1);
|
||||
ini_set('display_startup_errors',1);
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
|
||||
ini_set('display_errors',1);
|
||||
ini_set('display_startup_errors',1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
|
||||
//css, js, and other includes
|
||||
include 'www/include.php';
|
||||
include 'helpers/files.php';
|
||||
?>
|
||||
<title><?php echo $site_name ?></title>
|
||||
<link rel="icon" href="<?php echo $site_image ?>">
|
||||
@ -67,6 +64,7 @@
|
||||
<?php
|
||||
if($isTree){
|
||||
echo <<< cardHead
|
||||
<br />
|
||||
<div class="card bg-dark text-white ml-4 mr-4">
|
||||
<div class="card-header">
|
||||
cardHead;
|
||||
@ -96,6 +94,36 @@
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($isHidden){
|
||||
echo <<< cardtop
|
||||
<br />
|
||||
<div class="card bg-dark text-white ml-4 mr-4">
|
||||
<div class="card-header">
|
||||
<h2>Access Hidden Directories</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
cardtop;
|
||||
|
||||
if($useJavascript){
|
||||
echo '<p>The server admin has enabled javascript. Type the name and key and hit enter!</p>';
|
||||
|
||||
} else {
|
||||
echo '<p>The server admin has disabled javascript. Please type the link in the URL and replace <name> with the directory name, and <password> with the password</p>';
|
||||
echo '<p>The link to copy is:</p>';
|
||||
echo $_SERVER['HTTP_HOST'];
|
||||
|
||||
|
||||
}
|
||||
|
||||
echo <<< cardbottom
|
||||
</div>
|
||||
</div>
|
||||
cardbottom;
|
||||
}
|
||||
?>
|
||||
<br />
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
14
listing.php
14
listing.php
@ -2,20 +2,18 @@
|
||||
<head>
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
//css, js, and other includes
|
||||
include 'www/include.php';
|
||||
include 'helpers/files.php';
|
||||
|
||||
//if this is a session inside the local connection
|
||||
if(strpos($_SERVER['REMOTE_ADDR'],"192.168.1.")){
|
||||
if($isDebug){
|
||||
ini_set('display_errors',1);
|
||||
ini_set('display_startup_errors',1);
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
|
||||
ini_set('display_errors',1);
|
||||
ini_set('display_startup_errors',1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
//css, js, and other includes
|
||||
include 'www/include.php';
|
||||
include 'helpers/files.php';
|
||||
?>
|
||||
<title><?php echo $site_name ?></title>
|
||||
<link rel="icon" href="<?php echo $site_image ?>">
|
||||
|
@ -78,6 +78,11 @@
|
||||
* All Dirs here will not be available, and will require the user to know
|
||||
* both the name of the folder, as well as the password. This does not use
|
||||
* any databases
|
||||
*
|
||||
* If you would like to enable the use of javascript for dynamic links, change
|
||||
* $useJavascript to yes, else keep it disabled. If you keep it disabled,
|
||||
* users will have to type the url themselves. This keeps the application light,
|
||||
* but removes some useability.
|
||||
*
|
||||
* Each variable in $hid_dir_names will be a folder that will be hidden
|
||||
* This will need to be known in order to access the folder
|
||||
@ -167,6 +172,16 @@
|
||||
' is asking for help with their homework from ',
|
||||
);
|
||||
|
||||
/* Debug
|
||||
*
|
||||
* This is not recomneded for production enviroments. This will display
|
||||
* information that could be useful to an attacker. Only use this
|
||||
* if you are developing anything!
|
||||
*
|
||||
*/
|
||||
|
||||
$isDebug = false;
|
||||
|
||||
//Be safe, check arrays
|
||||
if(empty($nav_names) or empty($nav_links)){
|
||||
$isNav = false;
|
||||
|
Loading…
Reference in New Issue
Block a user