roundcube 1.3 support

master
inpos 2017-12-10 16:46:25 +03:00
parent 2afdc83164
commit 61e9aed4be
1 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ class defense extends rcube_plugin {
*/ */
private function debug($string) { private function debug($string) {
if (!$this->debugEnabled) { return; } if (!$this->debugEnabled) { return; }
write_log($this->logfile, $this->ipaddr . " # " . $string); rcube::write_log($this->logfile, $this->ipaddr . " # " . $string);
} }
/** /**
* Check if IP is matched against all IPs in array, * Check if IP is matched against all IPs in array,
@ -148,7 +148,7 @@ class defense extends rcube_plugin {
// I can't seem to try/catch database entries so I have no details regarding error // I can't seem to try/catch database entries so I have no details regarding error
$string = "Error communicating with database."; $string = "Error communicating with database.";
$this->debug($string); $this->debug($string);
write_log('error', 'plugin::defense: ' . $string); rcube::write_log('error', 'plugin::defense: ' . $string);
} }
/** /**
* Return true if IP matches config whitelist * Return true if IP matches config whitelist
@ -258,7 +258,7 @@ class defense extends rcube_plugin {
$this->debugEnabled = $this->rc->config->get('defense_debug_enabled', false); $this->debugEnabled = $this->rc->config->get('defense_debug_enabled', false);
// set client ip // set client ip
$this->ipaddr = rcmail_remote_ip(); $this->ipaddr = rcube_utils::remote_ip();
// Roundcube event hooks // Roundcube event hooks
$this->add_hook('template_object_loginform', array($this, 'hookLoginForm')); $this->add_hook('template_object_loginform', array($this, 'hookLoginForm'));