summaryrefslogtreecommitdiffstats
path: root/lib/api.php
diff options
context:
space:
mode:
authorTom Needham <tom@owncloud.com>2012-08-01 13:37:00 +0000
committerTom Needham <tom@owncloud.com>2012-08-01 13:37:00 +0000
commit2afe5f9b2b59094b632e79e0a0fec0cd70509273 (patch)
treeaf85092aaa873b76b2f236c84dee3549b92493fd /lib/api.php
parent75dbed22080850b850e2e4befafc6ced557bdba9 (diff)
downloadnextcloud-server-2afe5f9b2b59094b632e79e0a0fec0cd70509273.tar.gz
nextcloud-server-2afe5f9b2b59094b632e79e0a0fec0cd70509273.zip
API: add OC_API::checkLoggedIn()
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();
+ }
+ }
+
}