SF Feature #3122736 - HTTP authentication realm

This commit is contained in:
Marcel van Dorp 2011-04-29 12:46:49 +10:00 committed by Deon George
parent a35298e7f3
commit 880a86f666
3 changed files with 16 additions and 9 deletions

View File

@ -49,6 +49,9 @@
to a big random string. */ to a big random string. */
// $config->custom->session['blowfish'] = null; // $config->custom->session['blowfish'] = null;
/* If your auth_type is http, you can override your HTTP Authentication Realm. */
// $config->custom->session['http_realm'] = sprintf('%s %s',app_name(),'login');
/* The language setting. If you set this to 'auto', phpLDAPadmin will attempt /* The language setting. If you set this to 'auto', phpLDAPadmin will attempt
to determine your language automatically. Otherwise, available lanaguages to determine your language automatically. Otherwise, available lanaguages
are: 'ct', 'de', 'en', 'es', 'fr', 'it', 'nl', and 'ru' are: 'ct', 'de', 'en', 'es', 'fr', 'it', 'nl', and 'ru'

View File

@ -41,7 +41,7 @@ if ($app['server']->getAuthType() == 'http') {
die(); die();
} }
header(sprintf('WWW-Authenticate: Basic realm="%s %s"',app_name(),_('login'))); header(sprintf('WWW-Authenticate: Basic realm="%s"',$_SESSION[APPCONFIG]->getValue('session','http_realm')));
if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0') if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')
header('HTTP/1.0 401 Unauthorized'); // http 1.0 method header('HTTP/1.0 401 Unauthorized'); // http 1.0 method

View File

@ -477,14 +477,6 @@ class Config {
'desc'=>'Blowfish key to encrypt cookie details', 'desc'=>'Blowfish key to encrypt cookie details',
'default'=>null); 'default'=>null);
$this->default->session['memorylimit'] = array(
'desc'=>'Set the PHP memorylimit warning threshold.',
'default'=>24);
$this->default->session['timelimit'] = array(
'desc'=>'Set the PHP timelimit.',
'default'=>30);
/** Cookie Time /** Cookie Time
* If you used auth_type 'form' in the servers list, you can adjust how long the cookie will last * If you used auth_type 'form' in the servers list, you can adjust how long the cookie will last
* (default is 0 seconds, which expires when you close the browser) * (default is 0 seconds, which expires when you close the browser)
@ -493,6 +485,18 @@ class Config {
'desc'=>'Time in seconds for the life of cookies', 'desc'=>'Time in seconds for the life of cookies',
'default'=>0); 'default'=>0);
$this->default->session['http_realm'] = array(
'desc'=>'HTTP Authentication Realm',
'default'=>sprintf('%s %s',app_name(),_('login')));
$this->default->session['memorylimit'] = array(
'desc'=>'Set the PHP memorylimit warning threshold.',
'default'=>24);
$this->default->session['timelimit'] = array(
'desc'=>'Set the PHP timelimit.',
'default'=>30);
/** /**
* Session Menu * Session Menu
*/ */