diff --git a/config.php b/config.php index 58faff5..e8ef669 100644 --- a/config.php +++ b/config.php @@ -76,46 +76,42 @@ if ($request->post_array() >= count($strings) + count($numbers)) } foreach ($numbers as $setting) { - if (!isset($_POST[$setting])) + if ($request->is_not_set_post($setting)) { die(simple_display('Required setting ' . htmlentities($setting) . ' not set.')); } - if ($_POST[$setting] == '') + if ($request->is_empty_post($setting)) { $output .= "$setting\t0\n"; continue; } - if ($_POST[$setting] < 0) + if ($request->post($setting) < 0) { - die(simple_display('The setting ' . htmlentities($setting) . ' should not be a negitive number.')); + die(simple_display('The setting ' . htmlentities($setting) . ' should not be a negative number.')); } - //$request->recursive_set_var($setting, (string)((float)$request->post($setting)), false); - $_POST[$setting] = (string)((float)$_POST[$setting]); - $output .= "$setting\t{$_POST[$setting]}\n"; + $request->recursive_set_var($setting, (string)((float)$request->post($setting)), false); + $output .= "$setting\t{$request->post($setting)}\n"; } $output .= "\n*/\n\n?>"; - if (!isset($_POST['force_download'])) + if ($request->is_not_set_post('force_download')) { - if (preg_match('#^(/|[a-z]\:)#i', $_POST['base_dir'])) + if (preg_match('#^(/|[a-z]\:)#i', $request->post('base_dir'))) { - die(simple_display('It seems you are using an absolute path for the Base Directory.' - . '
This means you must check the "Pipe downloaded files though the PHP script" box.')); + die(simple_display('It seems you are using an absolute path for the Base Directory.' . '
This means you must check the "Pipe downloaded files though the PHP script" box.')); } - if ((int)$_POST['bandwidth_limit'] !== 0) + if ((int)$request->post('bandwidth_limit') !== 0) { - die(simple_display('For the Bandwidth Limit feature to work, the "force download" feature needs to be on.' - . '
This means you must check the "Pipe downloaded files though the PHP script" box.')); + die(simple_display('For the Bandwidth Limit feature to work, the "force download" feature needs to be on.' . '
This means you must check the "Pipe downloaded files though the PHP script" box.')); } } - if (isset($_POST['must_login_to_download']) && !isset($_POST['use_login_system'])) + if ($request->is_set_post('must_login_to_download') && $request->is_not_set_post('use_login_system')) { - die(simple_display('To enable must_login_to_download, the ' - . 'use_login_system option must also be turned on.')); + die(simple_display('To enable must_login_to_download, the ' . 'use_login_system option must also be turned on.')); } foreach (array('base_dir', 'template') as $valid) { - if (!@is_dir($_POST[$valid])) + if (!@is_dir($request->post($valid))) { //die(simple_display(htmlentities($valid) . ' setting is not a valid directory.')); } @@ -191,11 +187,15 @@ if ($request->post_array() >= count($strings) + count($numbers)) -
-

Write successful!
AutoIndex configuration is finished.

-

Continue.

-
- + + +

Write successful!
AutoIndex configuration is finished.

+

Continue.

+ + + + + $data) { - $settings[$key] = $config -> __get($key); + $settings[$key] = $config->__get($key); } } //begin display of main configuration page: @@ -289,7 +289,7 @@ echo ''; -
+

AutoIndex PHP Script @@ -302,233 +302,286 @@ echo '';

-
-Base Directory: -

- This is the folder that will be the root of the directory listing. -
This will be the starting point for the script. Nothing above this directory can be viewed, but its subfolders can. -
Make sure to use a path relative to this index.php file if you can. -

-
- + + + + +
+ Base Directory: +

+ This is the folder that will be the root of the directory listing. +
This will be the starting point for the script. Nothing above this directory can be viewed, but its subfolders can. +
Make sure to use a path relative to this index.php file if you can. +

+

-
-Assets Path: -

- This is the path to the assets files (the path web browsers will access them from). -
The included assets are cookie consent, ion icons, font awesome, and jquery. -

-
- + + + + +
Assets Path: +

+ This is the path to the assets files (the path web browsers will access them from). +
The included assets are cookie consent, ion icons, font awesome, and jquery. +

+

-
-Icon Path: -

- This is the path to the icon image files (the path web browsers will access them from). -
The included icon sets are apache, kde, osx, and winxp. -
You can leave it blank to not show icons. -

-
- + + + + +
+ Icon Path: +

+ This is the path to the icon image files (the path web browsers will access them from). +
The included icon sets are apache, kde, osx, and winxp. +
You can leave it blank to not show icons. +

+

-
-Flag Path: -

- This is the path to the flag image files (the path web browsers will access them from). -
The included icon sets are country, language. -
You can leave it blank to not show icons. -

-
- + + + + +
+ Flag Path: +

+ This is the path to the flag image files (the path web browsers will access them from). +
The included icon sets are country, language. +
You can leave it blank to not show icons. +

+

-
- /> Show Directory Size -

- If this box is checked, the total size of directories will be shown under size (all the folder's contents will be added up). -
Otherwise, it will display "[dir]" under size. -
NOTE: If you are trying to index many files (meaning a few thousand), you will notice a speed improvement with this turned off. -

-
- + + + + +
+ /> Show Directory Size +

+ If this box is checked, the total size of directories will be shown under size (all the folder's contents will be added up). +
Otherwise, it will display "[dir]" under size. +
NOTE: If you are trying to index many files (meaning a few thousand), you will notice a speed improvement with this turned off. +

+

- + +
+ + +
/> Enable Searching

If this box is checked, people will be able to search for a file or folder by its filename.
It will search the folder you are currently in, and all subfolders.
Searching is not case sensitive.

-
- +

-
-Template Directory: -

- This is the path where the *.tpl template files are located (relative to this index.php file). -

-
- + + + + +
+ Template Directory: +

+ This is the path where the *.tpl template files are located (relative to this index.php file). +

+

-
- /> Enable Login System -
/> Users must login to view/download -
User List: -

- User List contains the path to the text file where the usernames and encrypted passwords are stored. -
Make sure the file is chmod'ed so PHP can read and write to it. -
(User List is only needed if the login system is enabled.) -
-
The default accounts are: -
username: admin -
password: admin -
-
username: user -
password: user -
-
Be sure to create new accounts, then delete these default ones if you enable the login system! -

-
- + + + + +
+ /> Enable Login System +
/> Users must login to view/download +
User List: +

+ User List contains the path to the text file where the usernames and encrypted passwords are stored. +
Make sure the file is chmod'ed so PHP can read and write to it. +
(User List is only needed if the login system is enabled.) +
+
The default accounts are: +
username: admin +
password: admin +
+
username: user +
password: user +
+
Be sure to create new accounts, then delete these default ones if you enable the login system! +

+

-
-Age for "New" Icon: days -

- This contains the number of days old a file can be and still have [New] written next to it. -
If it is set to 0, this feature will be disabled. -

-
- + + + + +
+ Age for "New" Icon: days +

+ This contains the number of days old a file can be and still have [New] written next to it. +
If it is set to 0, this feature will be disabled. +

+

-
-Number of file entires per page: -

- This contains the number of files or folders to display on a single page. - If there are more files or folders, the display will be separated into different - pages with Previous and Next buttons. -
If it is set to 0, everything will be displayed on one page. -

-
- + + + + +
+ Number of file entires per page: +

+ This contains the number of files or folders to display on a single page. + If there are more files or folders, the display will be separated into different + pages with Previous and Next buttons. +
If it is set to 0, everything will be displayed on one page. +

+

-
-Image Thumbnail Height: pixels -

- This is a feature that will show thumbnails next to images. (NOTE: GDlib 2.0.1 or higher is required) -
Setting it to 0 will disable this feature, and setting it to any other number will set the size of the thumbnail. -
(100 is a good setting to start with.) -

-
- + + + + +
+ Image Thumbnail Height: pixels +

+ This is a feature that will show thumbnails next to images. (NOTE: GDlib 2.0.1 or higher is required) +
Setting it to 0 will disable this feature, and setting it to any other number will set the size of the thumbnail. +
(100 is a good setting to start with.) +

+

-
- /> Pipe downloaded files though the PHP script -

Bandwidth Limit: KB/s

-

- This contains the max download speed for files. The above checkbox needs to be checked for this to work. -
If it is set to 0, the script will not limit download speed. -

-
- + + + + +
+ /> Pipe downloaded files though the PHP script +

Bandwidth Limit: KB/s

+

+ This contains the max download speed for files. The above checkbox needs to be checked for this to work. +
If it is set to 0, the script will not limit download speed. +

+

-
-

/> Anti-Leech

-

- When downloading a file, this will check to make sure the referrer the browser sends matches the website's URL. -
Since some people turn off referrer sending in their browser, this option is not recommended. -

-
- + + + + +
+

/> Anti-Leech

+

+ When downloading a file, this will check to make sure the referrer the browser sends matches the website's URL. +
Since some people turn off referrer sending in their browser, this option is not recommended. +

+

- + +
+ + +
+

+ The following items contain the path and filename to the file where the data for that feature will be stored. +
Leave it blank to turn off that feature. +

+

Hidden Files List: +
+ Any file or folder matched to an item in this list will be kept hidden. +
The contents of the list are editable when you login as an admin. +
+

-

- The following items contain the path and filename to the file where the data for that feature will be stored. -
Leave it blank to turn off that feature. -

+

Access Log File: +
+ The file to write the access log. +
If this is enabled, you will be able to view the contents of the logfile +
and generate statistics when you login as an admin. +

-

Hidden Files List: -
- Any file or folder matched to an item in this list will be kept hidden. -
The contents of the list are editable when you login as an admin. -

+

File/Folder Description File: +
+ The file to write the file descriptions to. +
File/Folder descriptions are editable when you login as an admin. +

-

Access Log File: -
- The file to write the access log. -
If this is enabled, you will be able to view the contents of the logfile -
and generate statistics when you login as an admin. -

- -

File/Folder Description File: -
- The file to write the file descriptions to. -
File/Folder descriptions are editable when you login as an admin. -

- -

Download Count File: -
- The file to write the file download counts to. -
The count is automatically increased when a file is downloaded. -

- -

Banned User List: -
- The file to write IP addresses and hostnames that are blocked from accessing this script. -
The contents of the list are editable when you login as an admin. -

-
+

Download Count File: +
+ The file to write the file download counts to. +
The count is automatically increased when a file is downloaded. +

+

Banned User List: +
+ The file to write IP addresses and hostnames that are blocked from accessing this script. +
The contents of the list are editable when you login as an admin. +

+

-
- /> Allow folder archive downloading -

- If this box is checked, users will be able to download the folder's contents as a tar archive file. -

-
- + + + + +
+ /> Allow folder archive downloading +

+ If this box is checked, users will be able to download the folder's contents as a tar archive file. +

+

-
- /> Parse .htaccess files -

- If this box is checked, .htaccess files will be parsed and used by AutoIndex. -

-
- + + + + +
+ /> Parse .htaccess files +

+ If this box is checked, .htaccess files will be parsed and used by AutoIndex. +

+

-
-

MD5 calculation max size: MB

-

- Setting this to 0 will disable this feature, and setting it to any other number will set the maximum size of a file to allow users to find the md5sum of (in megabytes). -
(10 is a good setting to start with.) -

-
- + + + + +
+

MD5 calculation max size: MB

+

+ Setting this to 0 will disable this feature, and setting it to any other number will set the maximum size of a file to allow users to find the md5sum of (in megabytes). +
(10 is a good setting to start with.) +

+
+

+ + + + +
+ Default Language: +

+ The user's browser's default language is used, unless that language is + not available in AutoIndex. In that case, the language selected here is + used. +

+
+

+


-
-Default Language: -

- The user's browser's default language is used, unless that language is - not available in AutoIndex. In that case, the language selected here is - used. -

-
- -


-

@@ -538,12 +591,10 @@ Default Language: