| @@ 579-588 (lines=10) @@ | ||
| 576 | * @param string $folder |
|
| 577 | * @return bool |
|
| 578 | */ |
|
| 579 | public static function add_htaccess_deny_from_all($folder = '') |
|
| 580 | { |
|
| 581 | $folder = EEH_File::standardise_and_end_with_directory_separator($folder); |
|
| 582 | if (! EEH_File::exists($folder . '.htaccess')) { |
|
| 583 | if (! EEH_File::write_to_file($folder . '.htaccess', 'deny from all', '.htaccess')) { |
|
| 584 | return false; |
|
| 585 | } |
|
| 586 | } |
|
| 587 | ||
| 588 | return true; |
|
| 589 | } |
|
| 590 | ||
| 591 | ||
| @@ 598-606 (lines=9) @@ | ||
| 595 | * @param string $folder |
|
| 596 | * @return boolean |
|
| 597 | */ |
|
| 598 | public static function add_index_file($folder) |
|
| 599 | { |
|
| 600 | $folder = EEH_File::standardise_and_end_with_directory_separator($folder); |
|
| 601 | if (! EEH_File::exists($folder . 'index.php')) { |
|
| 602 | if (! EEH_File::write_to_file( |
|
| 603 | $folder . 'index.php', |
|
| 604 | 'You are not permitted to read from this folder', |
|
| 605 | '.php' |
|
| 606 | )) { |
|
| 607 | return false; |
|
| 608 | } |
|
| 609 | } |
|