|
@@ 11-13 (lines=3) @@
|
| 8 |
|
|
| 9 |
|
require_once dirname(__FILE__) . '/vendor/autoload.php'; |
| 10 |
|
require dirname(__FILE__) . '/config_default.php'; |
| 11 |
|
if (file_exists(dirname(__FILE__) . '/config_local.php') && (php_sapi_name() !== 'cli')) { |
| 12 |
|
require dirname(__FILE__) . '/config_local.php'; |
| 13 |
|
} |
| 14 |
|
|
| 15 |
|
$remote_user = array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ''; |
| 16 |
|
// Clean username, only allow a-z, A-Z, 0-9, -_ chars |
|
@@ 19-21 (lines=3) @@
|
| 16 |
|
// Clean username, only allow a-z, A-Z, 0-9, -_ chars |
| 17 |
|
$remote_user = preg_replace( '/[^a-zA-Z0-9_-]/', '', $remote_user); |
| 18 |
|
$user_config_file = 'config_local.' . $remote_user . '.php'; |
| 19 |
|
if (file_exists(dirname(__FILE__) . '/' . $user_config_file) && (php_sapi_name() !== 'cli')) { |
| 20 |
|
require dirname(__FILE__) . '/' . $user_config_file; |
| 21 |
|
} |
| 22 |
|
|
| 23 |
|
if(!is_null($config['cops_basic_authentication']) && |
| 24 |
|
is_array($config['cops_basic_authentication'])) |