Skip to content

Instantly share code, notes, and snippets.

@jbroadway
Last active August 29, 2015 14:06
Show Gist options
  • Save jbroadway/9a18f84ad6be671eb22d to your computer and use it in GitHub Desktop.
Save jbroadway/9a18f84ad6be671eb22d to your computer and use it in GitHub Desktop.
Bootstrap file for the Elefant CMS to hide a site behind HTTP Basic auth.
<?php
/**
* Implements HTTP Basic auth to hide your site
* until it's ready to go live. Based on:
*
* https://gist.github.com/jbroadway/9a18f84ad6be671eb22d
*/
if (! $controller->cli) {
conf ('General', 'master_username', 'USERNAME');
conf ('General', 'master_password', 'PASSWORD');
if (! simple_auth ()) {
die ('Unauthorized');
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment