Enabled a param so that some calls to getValue() are not fatal
This commit is contained in:
parent
8e8db2e4ed
commit
db2e8861fa
@ -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'))));
|
($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>',
|
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>';
|
echo '<tr><td colspan=2> </td></tr>';
|
||||||
printf('<tr><td><b>%s:</b></td></tr>',_('Password'));
|
printf('<tr><td><b>%s:</b></td></tr>',_('Password'));
|
||||||
|
@ -69,16 +69,18 @@ abstract class DS {
|
|||||||
/**
|
/**
|
||||||
* Return a configuration value
|
* Return a configuration value
|
||||||
*/
|
*/
|
||||||
public function getValue($key,$setting) {
|
public function getValue($key,$setting,$fatal=true) {
|
||||||
if (isset($this->custom->{$key}[$setting]))
|
if (isset($this->custom->{$key}[$setting]))
|
||||||
return $this->custom->{$key}[$setting];
|
return $this->custom->{$key}[$setting];
|
||||||
|
|
||||||
elseif (isset($this->default->{$key}[$setting]) && array_key_exists('default',$this->default->{$key}[$setting]))
|
elseif (isset($this->default->{$key}[$setting]) && array_key_exists('default',$this->default->{$key}[$setting]))
|
||||||
return $this->default->{$key}[$setting]['default'];
|
return $this->default->{$key}[$setting]['default'];
|
||||||
|
|
||||||
else {
|
elseif ($fatal)
|
||||||
debug_dump_backtrace("Error trying to get a non-existant value ($key,$setting)",1);
|
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