diff --git a/plugins/password/drivers/ldap_ppolicy.php b/plugins/password/drivers/ldap_ppolicy.php index 0b2b02282..27aca340b 100644 --- a/plugins/password/drivers/ldap_ppolicy.php +++ b/plugins/password/drivers/ldap_ppolicy.php @@ -28,15 +28,25 @@ class rcube_ldap_ppolicy_password $bindPW = $rcmail->config->get('password_ldap_searchPW'); $cafile = $rcmail->config->get('password_ldap_cafile'); + $log_dir = null; + if (self::$instance) { + $log_dir = self::$instance->config->get('log_dir'); + } + + if (empty($log_dir)) { + $log_dir = RCUBE_INSTALL_PATH . 'logs'; + } + + // try to open specific log file for writing + $logfile = $log_dir.'/ldap_ppolicy.err'; + $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to - 2 => array("file", "logs/ldap_ppolicy.err", "a") // stderr is a file to write to + 2 => array("file", $logfile, "a") // stderr is a file to write to ); - $cwd = 'plugins/password/drivers/'; - $cmd = $cwd.$cmd; - $this->_debug('CWD: '. $cwd); + $cmd = 'plugins/password/helpers/'. $cmd; $this->_debug("parameters:\ncmd:$cmd\nuri:$uri\nbaseDN:$baseDN\nfilter:$filter"); $process = proc_open($cmd, $descriptorspec, $pipes);