aboutsummaryrefslogtreecommitdiff
path: root/views/default/input/securitytoken.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/input/securitytoken.php')
-rw-r--r--views/default/input/securitytoken.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/views/default/input/securitytoken.php b/views/default/input/securitytoken.php
new file mode 100644
index 000000000..b1461a2ce
--- /dev/null
+++ b/views/default/input/securitytoken.php
@@ -0,0 +1,20 @@
+<?php
+ /**
+ * CSRF security token view for use with secure forms.
+ *
+ * It is still recommended that you use input/form.
+ *
+ * @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/
+ */
+
+ $ts = time();
+ $token = generate_action_token($ts);
+
+ echo elgg_view('input/hidden', array('internalname' => '__elgg_token', 'value' => $token));
+ echo elgg_view('input/hidden', array('internalname' => '__elgg_ts', 'value' => $ts));
+?>