-
-
Save shalaby/dd7be8ec89e014659bdd to your computer and use it in GitHub Desktop.
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 | |
// located in the /app/filters.php | |
/* some original code */ | |
Route::filter('statistics.auth.basic', function() { | |
$user = Request::getUser(); | |
$password = Request::getPassword(); | |
if (!App::environment('development') && | |
( | |
(!$user || !$password) || | |
($user != Config::get('statistics-auth-basic.user') || $password != Config::get('statistics-auth-basic.password') | |
)) { | |
$response = Response::make('Not authorized', 401); | |
$response->header('WWW-Authenticate', 'Basic realm="statistics"'); | |
return $response; | |
} | |
}); | |
/* some original code */ |
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 | |
// located in the /app/config/statistics-auth-basic.php | |
return array( | |
'user' => 'user', | |
'password' => 'password' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment