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