summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-04-17 09:34:02 +0000
committeralecpl <alec@alec.pl>2011-04-17 09:34:02 +0000
commit8ffd08a7398d044dc7e9f5deecc76a29c6aa270e (patch)
treea4fb7dedbd3c8e7cb51c9db80d7f8c1c2480e867 /program/include
parentd3105370870a8c51aaeb6a18f561311202da3356 (diff)
- Aplied fixes from trunk
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_smtp.php9
-rwxr-xr-xprogram/include/rcube_template.php26
2 files changed, 23 insertions, 12 deletions
diff --git a/program/include/rcube_smtp.php b/program/include/rcube_smtp.php
index 81f212dcf..62168389c 100644
--- a/program/include/rcube_smtp.php
+++ b/program/include/rcube_smtp.php
@@ -105,7 +105,7 @@ class rcube_smtp
$this->conn = new Net_SMTP($smtp_host, $smtp_port, $helo_host);
- if($RCMAIL->config->get('smtp_debug'))
+ if ($RCMAIL->config->get('smtp_debug'))
$this->conn->setDebug(true, array($this, 'debug_handler'));
// try to connect to server and exit on failure
@@ -118,6 +118,13 @@ class rcube_smtp
return false;
}
+ // workaround for timeout bug in Net_SMTP 1.5.[0-1] (#1487843)
+ if (method_exists($this->conn, 'setTimeout')
+ && ($timeout = ini_get('default_socket_timeout'))
+ ) {
+ $this->conn->setTimeout($timeout);
+ }
+
$smtp_user = str_replace('%u', $_SESSION['username'], $CONFIG['smtp_user']);
$smtp_pass = str_replace('%p', $RCMAIL->decrypt($_SESSION['password']), $CONFIG['smtp_pass']);
$smtp_auth_type = empty($CONFIG['smtp_auth_type']) ? NULL : $CONFIG['smtp_auth_type'];
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index 5806d5185..5c69290c5 100755
--- a/program/include/rcube_template.php
+++ b/program/include/rcube_template.php
@@ -373,16 +373,19 @@ class rcube_template extends rcube_html_page
private function parse($name = 'main', $exit = true)
{
$skin_path = $this->config['skin_path'];
- $plugin = false;
+ $plugin = false;
+ $realname = $name;
+ $temp = explode('.', $name, 2);
$this->plugin_skin_path = null;
- $temp = explode(".", $name, 2);
if (count($temp) > 1) {
- $plugin = $temp[0];
- $name = $temp[1];
- $skin_dir = $plugin . '/skins/' . $this->config['skin'];
+ $plugin = $temp[0];
+ $name = $temp[1];
+ $skin_dir = $plugin . '/skins/' . $this->config['skin'];
$skin_path = $this->plugin_skin_path = $this->app->plugins->dir . $skin_dir;
- if (!is_dir($skin_path)) { // fallback to default skin
+
+ // fallback to default skin
+ if (!is_dir($skin_path)) {
$skin_dir = $plugin . '/skins/default';
$skin_path = $this->plugin_skin_path = $this->app->plugins->dir . $skin_dir;
}
@@ -390,12 +393,13 @@ class rcube_template extends rcube_html_page
$path = "$skin_path/templates/$name.html";
- if (!is_readable($path) && $this->deprecated_templates[$name]) {
- $path = "$skin_path/templates/".$this->deprecated_templates[$name].".html";
+ if (!is_readable($path) && $this->deprecated_templates[$realname]) {
+ $path = "$skin_path/templates/".$this->deprecated_templates[$realname].".html";
if (is_readable($path))
raise_error(array('code' => 502, 'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
- 'message' => "Using deprecated template '".$this->deprecated_templates[$name]."' in ".$this->config['skin_path']."/templates. Please rename to '".$name."'"),
+ 'message' => "Using deprecated template '".$this->deprecated_templates[$realname]
+ ."' in ".$this->config['skin_path']."/templates. Please rename to '".$realname."'"),
true, false);
}
@@ -406,7 +410,7 @@ class rcube_template extends rcube_html_page
'type' => 'php',
'line' => __LINE__,
'file' => __FILE__,
- 'message' => 'Error loading template for '.$name
+ 'message' => 'Error loading template for '.$realname
), true, true);
return false;
}
@@ -422,7 +426,7 @@ class rcube_template extends rcube_html_page
$output = $this->parse_xml($output);
// trigger generic hook where plugins can put additional content to the page
- $hook = $this->app->plugins->exec_hook("render_page", array('template' => $name, 'content' => $output));
+ $hook = $this->app->plugins->exec_hook("render_page", array('template' => $realname, 'content' => $output));
// add debug console
if ($this->config['debug_level'] & 8) {