Make ldap_ppolicy to log debug into 'ldap.log' file

pull/6832/head
Aleksander Machniak 5 years ago
parent 4e9aca2f27
commit 9d5e2219f8

@ -43,7 +43,15 @@ class rcube_ldap_ppolicy_password
); );
$cmd = 'plugins/password/helpers/'. $cmd; $cmd = 'plugins/password/helpers/'. $cmd;
$this->_debug("parameters:\ncmd:$cmd\nuri:$uri\nbaseDN:$baseDN\nfilter:$filter");
$this->_debug('Policy request: ' . json_encode(array(
'user' => $username,
'cmd' => $cmd,
'uri' => $uri,
'baseDN' => $baseDN,
'filter' => $filter,
)));
$process = proc_open($cmd, $descriptorspec, $pipes); $process = proc_open($cmd, $descriptorspec, $pipes);
if (is_resource($process)) { if (is_resource($process)) {
@ -66,7 +74,7 @@ class rcube_ldap_ppolicy_password
$result = stream_get_contents($pipes[1]); $result = stream_get_contents($pipes[1]);
fclose($pipes[1]); fclose($pipes[1]);
$this->_debug('Result:'.$result); $this->_debug('Policy result: ' . $result);
switch ($result) { switch ($result) {
case "OK": case "OK":
@ -91,7 +99,7 @@ class rcube_ldap_ppolicy_password
private function _debug($str) private function _debug($str)
{ {
if ($this->debug) { if ($this->debug) {
rcube::write_log('password_ldap_ppolicy', $str); rcube::write_log('ldap', $str);
} }
} }
} }

Loading…
Cancel
Save