summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-04-15 16:07:01 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-04-15 16:07:01 +0000
commit3b364aa2f498b6ccfa5a93000e2d52be4cc54f50 (patch)
tree7ef4177ea7e2e75a47d54210830f53eab09a2c3f /roundcubemail/program
parent720d701f2783e98321a2ffef066208dd05b8623f (diff)
Add hook for request token creation (upon user request)
git-svn-id: https://svn.roundcube.net/trunk@4661 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/include/rcmail.php3
-rwxr-xr-xroundcubemail/program/include/rcube_template.php4
2 files changed, 5 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php
index d1e86c6ca..17b82198c 100644
--- a/roundcubemail/program/include/rcmail.php
+++ b/roundcubemail/program/include/rcmail.php
@@ -1108,7 +1108,8 @@ class rcmail
{
$sess_id = $_COOKIE[ini_get('session.name')];
if (!$sess_id) $sess_id = session_id();
- return md5('RT' . $this->task . $this->config->get('des_key') . $sess_id);
+ $plugin = $this->plugins->exec_hook('request_token', array('value' => md5('RT' . $this->task . $this->config->get('des_key') . $sess_id)));
+ return $plugin['value'];
}
diff --git a/roundcubemail/program/include/rcube_template.php b/roundcubemail/program/include/rcube_template.php
index f66b2904d..0a64d1cb1 100755
--- a/roundcubemail/program/include/rcube_template.php
+++ b/roundcubemail/program/include/rcube_template.php
@@ -69,7 +69,6 @@ class rcube_template extends rcube_html_page
//$this->framed = $framed;
$this->set_env('task', $task);
- $this->set_env('request_token', $this->app->get_request_token());
// load the correct skin (in case user-defined)
$this->set_skin($this->config['skin']);
@@ -342,6 +341,9 @@ class rcube_template extends rcube_html_page
else if ($unlock) {
array_unshift($this->js_commands, array('hide_message', $unlock));
}
+
+ $this->set_env('request_token', $this->app->get_request_token());
+
// write all env variables to client
$js = $this->framed ? "if(window.parent) {\n" : '';
$js .= $this->get_js_commands() . ($this->framed ? ' }' : '');