Enabled a param so that some calls to getValue() are not fatal
This commit is contained in:
parent
ea17aadef4
commit
640abcbf3b
@ -45,7 +45,7 @@ printf('<tr><td><b>%s:</b></td></tr>',
|
||||
($app['server']->getValue('login','attr') == 'dn' ? _('Login DN') : $_SESSION[APPCONFIG]->getFriendlyName($app['server']->getValue('login','attr'))));
|
||||
|
||||
printf('<tr><td><input type="text" id="login" name="login" size="40" value="%s" /></td></tr>',
|
||||
$app['server']->getValue('login','attr') == 'dn' ? $app['server']->getValue('login','bind_id') : '');
|
||||
$app['server']->getValue('login','attr',false) == 'dn' ? $app['server']->getValue('login','bind_id') : '');
|
||||
|
||||
echo '<tr><td colspan=2> </td></tr>';
|
||||
printf('<tr><td><b>%s:</b></td></tr>',_('Password'));
|
||||
|
@ -69,16 +69,18 @@ abstract class DS {
|
||||
/**
|
||||
* Return a configuration value
|
||||
*/
|
||||
public function getValue($key,$setting) {
|
||||
public function getValue($key,$setting,$fatal=true) {
|
||||
if (isset($this->custom->{$key}[$setting]))
|
||||
return $this->custom->{$key}[$setting];
|
||||
|
||||
elseif (isset($this->default->{$key}[$setting]) && array_key_exists('default',$this->default->{$key}[$setting]))
|
||||
return $this->default->{$key}[$setting]['default'];
|
||||
|
||||
else {
|
||||
elseif ($fatal)
|
||||
debug_dump_backtrace("Error trying to get a non-existant value ($key,$setting)",1);
|
||||
}
|
||||
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user