SF Feature #2827191 - warnings for missing objectClass could be disabled
This commit is contained in:
parent
a5b9e43a57
commit
803a4c821a
@ -145,6 +145,9 @@ $config->custom->commands['script'] = array(
|
||||
/* Disable the default template. */
|
||||
// $config->custom->appearance['disable_default_template'] = false;
|
||||
|
||||
/* Hide the warnings for invalid objectClasses/attributes in templates. */
|
||||
// $config->custom->appearance['hide_template_warning'] = false;
|
||||
|
||||
/* Configure what objects are shown in left hand tree */
|
||||
// $config->custom->appearance['tree_filter'] = '(objectclass=*)';
|
||||
|
||||
|
@ -94,7 +94,7 @@ class Template extends xmlTemplate {
|
||||
if (is_object($soc) && ! in_array($soc->getName(),$objectclasses))
|
||||
array_push($objectclasses,$soc->getName(false));
|
||||
|
||||
elseif (! is_object($soc))
|
||||
elseif (! is_object($soc) && ! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
|
||||
system_message(array(
|
||||
'title'=>_('Automatically removed objectClass from template'),
|
||||
'body'=>sprintf('%s: <b>%s</b> %s',$this->getTitle(),$details,_('removed from template as it is not defined in the schema')),
|
||||
@ -1222,10 +1222,11 @@ class Template extends xmlTemplate {
|
||||
&& (! in_array_ignore_case('extensibleobject',$this->getObjectClasses()))) {
|
||||
unset($this->attributes[$index]);
|
||||
|
||||
system_message(array(
|
||||
'title'=>_('Automatically removed attribute from template'),
|
||||
'body'=>sprintf('%s: <b>%s</b> %s',$this->getTitle(),$attribute->getName(false),_('removed from template as it is not defined by an ObjectClass')),
|
||||
'type'=>'warn'));
|
||||
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
|
||||
system_message(array(
|
||||
'title'=>_('Automatically removed attribute from template'),
|
||||
'body'=>sprintf('%s: <b>%s</b> %s',$this->getTitle(),$attribute->getName(false),_('removed from template as it is not defined by an ObjectClass')),
|
||||
'type'=>'warn'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,6 +105,10 @@ class Config {
|
||||
'desc'=>'Hide the features that may provide sensitive debugging information to the browser',
|
||||
'default'=>true);
|
||||
|
||||
$this->default->appearance['hide_template_warning'] = array(
|
||||
'desc'=>'Hide template errors from being displayed',
|
||||
'default'=>false);
|
||||
|
||||
/** Language
|
||||
* The language setting. If you set this to 'auto', phpLDAPadmin will
|
||||
* attempt to determine your language automatically. Otherwise, set
|
||||
|
Loading…
Reference in New Issue
Block a user