From 2965a981b7ec22866fbdf2d567d87e2d068d3617 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Fri, 31 Jul 2015 16:04:08 -0400
Subject: [PATCH] Allow to search and import missing PGP pubkeys from keyservers using Publickey.js
---
program/include/rcmail_output_json.php | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/program/include/rcmail_output_json.php b/program/include/rcmail_output_json.php
index def6ee4..91262ac 100644
--- a/program/include/rcmail_output_json.php
+++ b/program/include/rcmail_output_json.php
@@ -23,7 +23,7 @@
/**
* View class to produce JSON responses
*
- * @package Core
+ * @package Webmail
* @subpackage View
*/
class rcmail_output_json extends rcmail_output
@@ -181,6 +181,11 @@
*/
public function raise_error($code, $message)
{
+ if ($code == 403) {
+ header('HTTP/1.1 403 Forbidden');
+ die("Invalid Request");
+ }
+
$this->show_message("Application Error ($code): $message", 'error');
$this->remote_response();
exit;
@@ -227,6 +232,13 @@
if (!empty($this->callbacks))
$response['callbacks'] = $this->callbacks;
+ // trigger generic hook where plugins can put additional content to the response
+ $hook = $this->app->plugins->exec_hook("render_response", array('response' => $response));
+
+ // save some memory
+ $response = $hook['response'];
+ unset($hook['response']);
+
echo self::json_serialize($response);
}
--
Gitblit v1.9.1