summaryrefslogtreecommitdiffstats
path: root/lib/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api.php')
-rw-r--r--lib/api.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/api.php b/lib/api.php
index cf699f547f3..a11dde1c6b8 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -121,4 +121,15 @@ class OC_API {
}
}
+ /**
+ * check if the user is authenticated
+ */
+ public static function checkLoggedIn(){
+ // Check OAuth
+ if(!OC_OAuth::isAuthorised()){
+ OC_Response::setStatus(401);
+ die();
+ }
+ }
+
}