Created
September 24, 2015 15:40
-
-
Save jonpugh/40a1bd77cd8dc1a59198 to your computer and use it in GitHub Desktop.
This drush file adds to aegir apache config, when a site is protected by http basic authentication, it grants access to the site's files folder without a password.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Implementation of hook_provision_apache_vhost_config() | |
*/ | |
function http_passwords_provision_apache_vhost_config($uri, $data) { | |
$lines = array(); | |
$user = d()->http_basic_auth_username; | |
$pass = d()->http_basic_auth_password; | |
if (!empty($user) && !empty($pass)) { | |
$root = d()->root; | |
$lines[] = " <Directory \"$root/sites/$uri/files\">"; | |
$lines[] = " Require all granted "; | |
$lines[] = " </Directory>"; | |
$lines[] = ""; | |
} | |
return implode("\n", $lines); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment