diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-04-09 17:18:25 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-04-09 17:18:25 +0000 |
commit | 01d229aa16f6514da35701ff0a811f592be6ef97 (patch) | |
tree | 1d04306478c10fe9ce6ce43fe6d70b12339b42e8 | |
parent | eeb7616c61cc38af026a39bf9a6932801675c0c9 (diff) | |
download | elgg-01d229aa16f6514da35701ff0a811f592be6ef97.tar.gz elgg-01d229aa16f6514da35701ff0a811f592be6ef97.tar.bz2 |
Introducing actionurl.php (Refs #749)
git-svn-id: https://code.elgg.org/elgg/trunk@3201 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | views/default/output/actionurl.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/views/default/output/actionurl.php b/views/default/output/actionurl.php new file mode 100644 index 000000000..172d38af1 --- /dev/null +++ b/views/default/output/actionurl.php @@ -0,0 +1,33 @@ +<?php
+
+ /**
+ * Elgg Action URL display
+ * This is identical to the output/url view except that it also adds action gatekeeper tokens, making + * it suitable for calling actions.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.org/
+ *
+ * @uses $vars['value'] The URL to display
+ *
+ */
+
+ $val = trim($vars['value']);
+ if (!empty($val)) {
+ + // Generate token + $ts = time(); + $token = generate_action_token($ts); + + $sep = "?"; + if (strpos($val, '?')>0) $sep = "&"; + $val = "$val{$sep}__elgg_token=$token&__elgg_ts=$ts"; + + echo elgg_view('output/url', array('value' => $val));
+ }
+
+?>
\ No newline at end of file |