summaryrefslogtreecommitdiffstats
path: root/lib/json.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/json.php')
-rw-r--r--lib/json.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/json.php b/lib/json.php
index f3bbe9ac899..dfc0a7b894e 100644
--- a/lib/json.php
+++ b/lib/json.php
@@ -42,6 +42,18 @@ class OC_JSON{
}
/**
+ * @brief Check an ajax get/post call if the request token is valid.
+ * @return json Error msg if not valid.
+ */
+ public static function callCheck(){
+ if( !OC_Util::isCallRegistered()){
+ $l = OC_L10N::get('core');
+ self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.') )));
+ exit();
+ }
+ }
+
+ /**
* Check if the user is a admin, send json error msg if not
*/
public static function checkAdminUser(){