index f37347fd32f96a7756442d1dd8e51b9b4381b429..4d47e5019a9ca387ae9613613a07da1a88a9416a 100644 (file)
$attrs["cn"] = "$name";
$ldap->add($attrs);
if (!$ldap->success()){
- msg_dialog::display(_("Internal error"), sprintf(_("Adding a lock failed.")."<br><br>"._('LDAP server returned: %s'), "<br><br><i>".$ldap->get_error()."</i>"), ERROR_DIALOG);
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "cn=$name,".$config->current['CONFIG'], 0, ERROR_DIALOG));
return;
}
}
function back_to_main()
{
$string= '<br><p class="plugbottom"><input type=submit name="password_back" value="'.
- _("Back").'"></p><input type="hidden" name="ignore">';
+ msgPool::backButton().'"></p><input type="hidden" name="ignore">';
return ($string);
}
@@ -2703,25 +2703,14 @@ function send_binary_content($data,$name,$type = "application/octet-stream")
}
+/*! \brief Encode special string characters so we can use the string in \
+ HTML output, without breaking quotes.
+ @param The String we want to encode.
+ @return The encoded String
+*/
function xmlentities($str)
{
- static $asc2uni= array();
-
- if (!count($asc2uni)){
- for($i=128;$i<256;$i++){
- $asc2uni[chr($i)] = "&#x".dechex($i).";";
- }
- }
-
- $str = str_replace("&", "&", $str);
- $str = str_replace("<", "<", $str);
- $str = str_replace(">", ">", $str);
- $str = str_replace("'", "'", $str);
- $str = str_replace("\"", """, $str);
- $str = str_replace("\r", "", $str);
- $str = strtr($str,$asc2uni);
-
- return $str;
+ return (htmlentities($str,ENT_QUOTES));
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: