summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcmail.php
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-06-20 10:40:01 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-06-20 10:40:01 +0000
commit0a36d15be96a97059bc7792073bbfc3f5334b314 (patch)
tree2ee62a298054f7263a080a6fcaf7b1bbe1d1c19d /roundcubemail/program/include/rcmail.php
parent2e81a5e6e7be614b87098f6c0b254e8b96e49fd7 (diff)
Store compose parameters in session and redirect to a unique URL
git-svn-id: https://svn.roundcube.net/trunk@1562 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcmail.php')
-rw-r--r--roundcubemail/program/include/rcmail.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php
index 009ad0448..7c12ef779 100644
--- a/roundcubemail/program/include/rcmail.php
+++ b/roundcubemail/program/include/rcmail.php
@@ -139,7 +139,7 @@ class rcmail
$task = 'mail';
$this->task = $task;
- $this->comm_path = './?_task=' . $task;
+ $this->comm_path = $this->url(array('task' => $task));
if ($this->output)
$this->output->set_env('task', $task);
@@ -820,6 +820,26 @@ class rcmail
return preg_replace('/\x00/', '', $pass);
}
+
+ /**
+ * Build a valid URL to this instance of RoundCube
+ *
+ * @param mixed Either a string with the action or url parameters as key-value pairs
+ * @return string Valid application URL
+ */
+ public function url($p)
+ {
+ if (!is_array($p))
+ $p = array('action' => @func_get_arg(0));
+
+ $url = $p['task'] ? './?_task=' . $p['task'] : $this->comm_path;
+ unset($p['task']);
+
+ foreach ($p as $par => $val)
+ $url .= sprintf('&%s=%s', urlencode($par), urlencode($val));
+
+ return $url;
+ }
}