Skip to content
Snippets Groups Projects
Commit d9d49d64 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Merge pull request #1552 from splitbrain/pregreplaceevalmodifier

preg_replace eval modifier
parents 9a9a364c f4208bec
No related branches found
No related tags found
No related merge requests found
......@@ -99,19 +99,23 @@ class adLDAPUtils {
* @author Port by Andreas Gohr <andi@splitbrain.org>
* @return string
*/
public function ldapSlashes($str){
return preg_replace('/([\x00-\x1F\*\(\)\\\\])/e',
'"\\\\\".join("",unpack("H2","$1"))',
$str);
protected function ldapSlashes($str) {
// see https://github.com/adldap/adLDAP/issues/22
return preg_replace_callback(
'/([\x00-\x1F\*\(\)\\\\])/',
function ($matches) {
return "\\".join("", unpack("H2", $matches[1]));
},
$str
);
}
/**
* Converts a string GUID to a hexdecimal value so it can be queried
*
*
* @param string $strGUID A string representation of a GUID
* @return string
*/
public function strGuidToHex($strGUID)
public function strGuidToHex($strGUID)
{
$strGUID = str_replace('-', '', $strGUID);
......
......@@ -275,6 +275,10 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
/**
* Definition of the function modifyUser in order to modify the password
*
* @param string $user nick of the user to be changed
* @param array $changes array of field/value pairs to be changed (password will be clear text)
* @return bool true on success, false on error
*/
function modifyUser($user,$changes){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment