diff options
Diffstat (limited to 'apps/remoteStorage/lib_remoteStorage.php')
-rwxr-xr-x | apps/remoteStorage/lib_remoteStorage.php | 12 |
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"); |