mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-21 21:10:00 +01:00
Add 'hideIf403' option.
This commit is contained in:
parent
25d84fe3df
commit
dfa72936f2
@ -9,6 +9,7 @@
|
||||
* adds icons from [Evolvere Icon Theme](http://franksouza183.deviantart.com/art/Evolvere-Icon-theme-440718295)
|
||||
* adds PHP variant to calc folder sizes
|
||||
* adds scroll position reset on location change (issue #279)
|
||||
* adds "hide if 403" option
|
||||
* updates H5BP to 4.3.0
|
||||
* updates jQuery to 2.1.1
|
||||
* updates json2.js to 2014-02-04
|
||||
|
@ -41,6 +41,7 @@ Options
|
||||
- ignore: don't list items matching these regular expressions
|
||||
- smartBrowsing: use History API if available (no need to reload the whole page)
|
||||
- extInNewWindow: open non-h5ai links in new window/tab
|
||||
- hideIf403: hide files and folders that are not readable by the server
|
||||
*/
|
||||
"view": {
|
||||
"modes": ["details", "grid", "icons"],
|
||||
@ -52,7 +53,8 @@ Options
|
||||
"indexFiles": ["index.html", "index.htm", "index.php"],
|
||||
"ignore": ["^\\.", "^_{{pkg.name}}"],
|
||||
"smartBrowsing": true,
|
||||
"extInNewWindow": false
|
||||
"extInNewWindow": false,
|
||||
"hideIf403": true
|
||||
},
|
||||
|
||||
|
||||
|
@ -80,9 +80,14 @@ class App {
|
||||
if (is_dir($path)) {
|
||||
if ($dir = opendir($path)) {
|
||||
while (($name = readdir($dir)) !== false) {
|
||||
if (!$this->is_ignored($name) && !$this->is_ignored($this->to_url($path) . $name)) {
|
||||
$names[] = $name;
|
||||
if (
|
||||
$this->is_ignored($name)
|
||||
|| $this->is_ignored($this->to_url($path) . $name)
|
||||
|| (!is_readable($path .'/'. $name) && $this->options["view"]["hideIf403"])
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$names[] = $name;
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user