Commit 748c0310 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #2919 Fixed status HTML code being shown

parent 5335bff2
......@@ -883,9 +883,20 @@ class FakeAttribute extends Attribute
*/
class DisplayLDAPAttribute extends Attribute
{
protected $allowHTML = FALSE;
function renderFormInput ()
{
return htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8');
if ($this->allowHTML) {
return $this->getValue();
} else {
return htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8');
}
}
function setAllowHTML ($allowHTML)
{
$this->allowHTML = $allowHTML;
}
}
......
......@@ -97,6 +97,7 @@ class Step_Ldap extends setupStep
$this->update_strings();
$this->attributesAccess['base']->setSubmitForm(TRUE);
$this->attributesAccess['admin']->setLinearRendering(TRUE);
$this->attributesAccess['status']->setAllowHTML(TRUE);
$this->update_base_choices();
$this->status = $this->get_connection_status();
}
......@@ -161,8 +162,9 @@ class Step_Ldap extends setupStep
}
if (!$this->bind_id) {
$str = sprintf(_("Anonymous bind to server '%s' failed!"), $this->connection);
if (!empty($this->admin)) {
if (empty($this->admin)) {
$str = sprintf(_("Anonymous bind to server '%s' failed!"), $this->connection);
} else {
$str = sprintf(_("Bind as user '%s' failed!"), $this->admin, $this->connection);
}
return "<div style='color:red;'>".$str."</div>";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment