mirror of
				https://github.com/Clortox/SimpleFileRepository.git
				synced 2025-07-17 12:32:12 +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> | <head> | ||||||
|     <?php |     <?php | ||||||
|         session_start(); |         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 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_errors',1); | ||||||
| 	    ini_set('display_startup_errors',1); | 	    ini_set('display_startup_errors',1); | ||||||
| 	    error_reporting(E_ALL); | 	    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>
 |     <title><?php echo $site_name ?></title>
 | ||||||
|     <link rel="icon" href="<?php echo $site_image ?>"> |     <link rel="icon" href="<?php echo $site_image ?>"> | ||||||
| @ -67,6 +64,7 @@ | |||||||
|     <?php |     <?php | ||||||
|         if($isTree){ |         if($isTree){ | ||||||
|             echo <<< cardHead |             echo <<< cardHead | ||||||
|  |             <br /> | ||||||
|             <div class="card bg-dark text-white ml-4 mr-4"> |             <div class="card bg-dark text-white ml-4 mr-4"> | ||||||
|             <div class="card-header"> |             <div class="card-header"> | ||||||
|             cardHead; |             cardHead; | ||||||
| @ -96,6 +94,36 @@ | |||||||
|             echo '</div>'; |             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> | </body> | ||||||
| 
 | 
 | ||||||
| </html> | </html> | ||||||
|  | |||||||
							
								
								
									
										14
									
								
								listing.php
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								listing.php
									
									
									
									
									
								
							| @ -2,20 +2,18 @@ | |||||||
| <head> | <head> | ||||||
|     <?php |     <?php | ||||||
|         session_start(); |         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 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_errors',1); | ||||||
|             ini_set('display_startup_errors',1); |             ini_set('display_startup_errors',1); | ||||||
|             error_reporting(E_ALL);     |             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>
 |     <title><?php echo $site_name ?></title>
 | ||||||
|     <link rel="icon" href="<?php echo $site_image ?>"> |     <link rel="icon" href="<?php echo $site_image ?>"> | ||||||
|  | |||||||
| @ -79,6 +79,11 @@ | |||||||
|      * both the name of the folder, as well as the password. This does not use |      * both the name of the folder, as well as the password. This does not use | ||||||
|      * any databases |      * 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 |      * 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 |      * This will need to be known in order to access the folder | ||||||
|      * |      * | ||||||
| @ -167,6 +172,16 @@ | |||||||
|         ' is asking for help with their homework from ', |         ' 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
 |     //Be safe, check arrays
 | ||||||
|     if(empty($nav_names) or empty($nav_links)){ |     if(empty($nav_names) or empty($nav_links)){ | ||||||
|         $isNav = false; |         $isNav = false; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Clortox
						Clortox