summaryrefslogtreecommitdiffstats
path: root/apps/remoteStorage/lib_remoteStorage.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/remoteStorage/lib_remoteStorage.php')
-rwxr-xr-xapps/remoteStorage/lib_remoteStorage.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/remoteStorage/lib_remoteStorage.php b/apps/remoteStorage/lib_remoteStorage.php
index b6a7a43b7b2..3e366ad29ea 100755
--- a/apps/remoteStorage/lib_remoteStorage.php
+++ b/apps/remoteStorage/lib_remoteStorage.php
@@ -13,6 +13,18 @@ class OC_remoteStorage {
return $ret;
}
+ public static function getTokenFor($appUrl, $categories) {
+ $user=OCP\USER::getUser();
+ $query=OCP\DB::prepare("SELECT token FROM *PREFIX*authtoken WHERE user=? AND appUrl=? AND category=? LIMIT 1");
+ $result=$query->execute(array($user, $appUrl, $categories));
+ $ret = array();
+ if($row=$result->fetchRow()) {
+ return $row['token'];
+ } else {
+ return false;
+ }
+ }
+
public static function getAllTokens() {
$user=OCP\USER::getUser();
$query=OCP\DB::prepare("SELECT token,appUrl,category FROM *PREFIX*authtoken WHERE user=? LIMIT 100");