summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-02-08 21:01:09 +0100
committerRobin Appelman <icewind@owncloud.com>2012-02-08 21:01:09 +0100
commit24748ee10fb6d165f51a3c99277a22106787696c (patch)
tree6abaf912e69fc523393425494ffe8988a6b3c824
parentc4a6b998146c29289794c1e15b71f1cfcfb4229a (diff)
downloadnextcloud-server-24748ee10fb6d165f51a3c99277a22106787696c.tar.gz
nextcloud-server-24748ee10fb6d165f51a3c99277a22106787696c.zip
add convinience function to get filesystem view for app storage
-rw-r--r--lib/app.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/app.php b/lib/app.php
index 37a99823e3d..22d18b17eec 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -403,4 +403,22 @@ class OC_App{
include OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/update.php';
}
}
+
+ /**
+ * @param string appid
+ * @return OC_FilesystemView
+ */
+ public static function getStorage($appid){
+ if(OC_App::isEnabled($appid)){//sanity check
+ if(OC_User::isLoggedIn()){
+ return new OC_FilesystemView('/'.OC_User::getUser().'/'.$appid);
+ }else{
+ OC_Log::write('core','Can\'t get app storage, app, user not logged in',OC_Log::ERROR);
+ return false;
+ }
+ }else{
+ OC_Log::write('core','Can\'t get app storage, app '.$appid.' not enabled',OC_Log::ERROR);
+ false;
+ }
+ }
}