diff options
author | Jan-Christoph Borchardt <jan@unhosted.org> | 2011-10-04 10:07:46 +0200 |
---|---|---|
committer | Jan-Christoph Borchardt <jan@unhosted.org> | 2011-10-04 10:07:46 +0200 |
commit | 79da90bb08a7bb0dd1c4d29136dd18b27501888e (patch) | |
tree | 0933df4f7234b66783b2c944b42a61966d588a89 | |
parent | 77e12a15b1cffcaf3c152bf394fd15eb61d24ace (diff) | |
download | nextcloud-server-79da90bb08a7bb0dd1c4d29136dd18b27501888e.tar.gz nextcloud-server-79da90bb08a7bb0dd1c4d29136dd18b27501888e.zip |
renamed unhosted to remoteStorage (needs to be updated with coming protocol version)
-rw-r--r-- | apps/remoteStorage/appinfo/app.php | 5 | ||||
-rw-r--r-- | apps/remoteStorage/appinfo/database.xml (renamed from apps/unhosted/appinfo/database.xml) | 2 | ||||
-rw-r--r-- | apps/remoteStorage/appinfo/info.xml | 10 | ||||
-rw-r--r-- | apps/remoteStorage/compat.php (renamed from apps/unhosted/compat.php) | 24 | ||||
-rw-r--r-- | apps/remoteStorage/lib_remoteStorage.php (renamed from apps/unhosted/lib_unhosted.php) | 4 | ||||
-rw-r--r-- | apps/remoteStorage/oauth_ro_auth.php (renamed from apps/unhosted/oauth_ro_auth.php) | 0 | ||||
-rw-r--r-- | apps/unhosted/appinfo/app.php | 5 | ||||
-rw-r--r-- | apps/unhosted/appinfo/info.xml | 10 | ||||
-rw-r--r-- | apps/user_webfinger/activate.php | 7 | ||||
-rw-r--r-- | apps/user_webfinger/appinfo/info.xml | 2 | ||||
-rw-r--r-- | apps/user_webfinger/webfinger.php | 2 |
11 files changed, 32 insertions, 39 deletions
diff --git a/apps/remoteStorage/appinfo/app.php b/apps/remoteStorage/appinfo/app.php new file mode 100644 index 00000000000..ac1ecde5082 --- /dev/null +++ b/apps/remoteStorage/appinfo/app.php @@ -0,0 +1,5 @@ +<?php +OC_App::register( array( + 'order' => 10, + 'id' => 'remoteStorage', + 'name' => 'remoteStorage compatibility' )); diff --git a/apps/unhosted/appinfo/database.xml b/apps/remoteStorage/appinfo/database.xml index db25657085b..b4e1ac7d8af 100644 --- a/apps/unhosted/appinfo/database.xml +++ b/apps/remoteStorage/appinfo/database.xml @@ -43,7 +43,7 @@ <length>64</length> </field> <index> - <name>a_app_unhostedweb_user</name> + <name>a_app_remotestorage_user</name> <unique>true</unique> <field> <name>user</name> diff --git a/apps/remoteStorage/appinfo/info.xml b/apps/remoteStorage/appinfo/info.xml new file mode 100644 index 00000000000..a20c6ff4cd4 --- /dev/null +++ b/apps/remoteStorage/appinfo/info.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<info> + <id>remoteStorage</id> + <name>remoteStorage compatibility</name> + <description>Enables your users to use ownCloud as their remote storage for unhosted applications.</description> + <version>0.1</version> + <licence>AGPL</licence> + <author>Michiel de Jong</author> + <require>2</require> +</info> diff --git a/apps/unhosted/compat.php b/apps/remoteStorage/compat.php index a514018f71a..d383e879510 100644 --- a/apps/unhosted/compat.php +++ b/apps/remoteStorage/compat.php @@ -30,16 +30,16 @@ $RUNTIME_NOSETUPFS = true; require_once('../../lib/base.php'); -OC_Util::checkAppEnabled('unhosted'); +OC_Util::checkAppEnabled('remoteStorage'); require_once('Sabre/autoload.php'); -require_once('lib_unhosted.php'); +require_once('lib_remoteStorage.php'); require_once('oauth_ro_auth.php'); ini_set('default_charset', 'UTF-8'); #ini_set('error_reporting', ''); @ob_clean(); -//allow use as unhosted storage for other websites +//allow use as remote storage for other websites if(isset($_SERVER['HTTP_ORIGIN'])) { header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']); header('Access-Control-Max-Age: 3600'); @@ -53,12 +53,12 @@ $path = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["SCRIPT_NAME"])); $pathParts = explode('/', $path); // for webdav: // 0/ 1 / 2 / 3 / 4 / 5 / 6 / 7 -// /$ownCloudUser/unhosted/webdav/$userHost/$userName/$dataScope/$key +// /$ownCloudUser/remoteStorage/webdav/$userHost/$userName/$dataScope/$key // for oauth: // 0/ 1 / 2 / 3 / 4 -// /$ownCloudUser/unhosted/oauth/auth +// /$ownCloudUser/remoteStorage/oauth/auth -if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted' && $pathParts[3] == 'webdav') { +if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'remoteStorage' && $pathParts[3] == 'webdav') { list($dummy0, $ownCloudUser, $dummy2, $dummy3, $userHost, $userName, $dataScope) = $pathParts; OC_Util::setupFS($ownCloudUser); @@ -68,10 +68,10 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted' $server = new Sabre_DAV_Server($publicDir); // Path to our script - $server->setBaseUri(OC::$WEBROOT."/apps/unhosted/compat.php/$ownCloudUser"); + $server->setBaseUri(OC::$WEBROOT."/apps/remoteStorage/compat.php/$ownCloudUser"); // Auth backend - $authBackend = new OC_Connector_Sabre_Auth_ro_oauth(OC_UnhostedWeb::getValidTokens($ownCloudUser, $userName.'@'.$userHost, $dataScope)); + $authBackend = new OC_Connector_Sabre_Auth_ro_oauth(OC_remoteStorage::getValidTokens($ownCloudUser, $userName.'@'.$userHost, $dataScope)); $authPlugin = new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud');//should use $validTokens here $server->addPlugin($authPlugin); @@ -83,7 +83,7 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted' // And off we go! $server->exec(); -} else if(count($pathParts) >= 4 && $pathParts[0] == '' && $pathParts[2] == 'unhosted' && $pathParts[3] == 'oauth2' && $pathParts[4] = 'auth') { +} else if(count($pathParts) >= 4 && $pathParts[0] == '' && $pathParts[2] == 'remoteStorage' && $pathParts[3] == 'oauth2' && $pathParts[4] = 'auth') { if(isset($_POST['allow'])) { //TODO: input checking. these explodes may fail to produces the desired arrays: $ownCloudUser = $pathParts[1]; @@ -98,8 +98,8 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted' } if(OC_User::getUser() == $ownCloudUser) { //TODO: check if this can be faked by editing the cookie in firebug! - $token=OC_UnhostedWeb::createDataScope($appUrl, $userAddress, $dataScope); - header('Location: '.$_GET['redirect_uri'].'#access_token='.$token.'&token_type=unhosted'); + $token=OC_remoteStorage::createDataScope($appUrl, $userAddress, $dataScope); + header('Location: '.$_GET['redirect_uri'].'#access_token='.$token.'&token_type=remoteStorage'); } else { if($_SERVER['HTTPS']){ $url = "https://"; @@ -107,7 +107,7 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted' $url = "http://"; } $url .= $_SERVER['SERVER_NAME']; - $url .= substr($_SERVER['SCRIPT_NAME'], 0, -strlen('apps/unhosted/compat.php')); + $url .= substr($_SERVER['SCRIPT_NAME'], 0, -strlen('apps/remoteStorage/compat.php')); die('Please ' .'<input type="submit" onclick="' ."window.open('$url','Close me!','height=600,width=300');" diff --git a/apps/unhosted/lib_unhosted.php b/apps/remoteStorage/lib_remoteStorage.php index 484f469f0ed..259efb0da69 100644 --- a/apps/unhosted/lib_unhosted.php +++ b/apps/remoteStorage/lib_remoteStorage.php @@ -1,6 +1,6 @@ <?php -class OC_UnhostedWeb { +class OC_remoteStorage { public static function getValidTokens($ownCloudUser, $userAddress, $dataScope) { $query=OC_DB::prepare("SELECT token,appUrl FROM *PREFIX*authtoken WHERE user=? AND userAddress=? AND dataScope=? LIMIT 100"); $result=$query->execute(array($user,$userAddress,$dataScope)); @@ -66,7 +66,7 @@ class OC_UnhostedWeb { //TODO: input checking on $userAddress and $dataScope list($userName, $userHost) = explode('@', $userAddress); OC_Util::setupFS(OC_User::getUser()); - $scopePathParts = array('unhosted', 'webdav', $userHost, $userName, $dataScope); + $scopePathParts = array('remoteStorage', 'webdav', $userHost, $userName, $dataScope); for($i=0;$i<=count($scopePathParts);$i++){ $thisPath = '/'.implode('/', array_slice($scopePathParts, 0, $i)); if(!OC_Filesystem::file_exists($thisPath)) { diff --git a/apps/unhosted/oauth_ro_auth.php b/apps/remoteStorage/oauth_ro_auth.php index b785d85fead..b785d85fead 100644 --- a/apps/unhosted/oauth_ro_auth.php +++ b/apps/remoteStorage/oauth_ro_auth.php diff --git a/apps/unhosted/appinfo/app.php b/apps/unhosted/appinfo/app.php deleted file mode 100644 index 84e07304534..00000000000 --- a/apps/unhosted/appinfo/app.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php -OC_App::register( array( - 'order' => 10, - 'id' => 'unhosted', - 'name' => 'Unhosted Web' )); diff --git a/apps/unhosted/appinfo/info.xml b/apps/unhosted/appinfo/info.xml deleted file mode 100644 index 359620f4578..00000000000 --- a/apps/unhosted/appinfo/info.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0"?> -<info> - <id>unhosted</id> - <name>Unhosted Web</name> - <description>On websites that allow unhosted accounts, use your owncloud as the storage for your user data</description> - <version>0.1</version> - <licence>AGPL</licence> - <author>Michiel de Jong</author> - <require>2</require> -</info> diff --git a/apps/user_webfinger/activate.php b/apps/user_webfinger/activate.php index 547c8e54d32..50257232ae4 100644 --- a/apps/user_webfinger/activate.php +++ b/apps/user_webfinger/activate.php @@ -1,11 +1,4 @@ <?php - -// comment out this line: - die("This feature is still experimental. Please comment out this line in the code, then try again\n"); -// - - - $ownCloudBaseUri = substr($_SERVER['REQUEST_URI'],0, -(strlen('/apps/user_webfinger/activate.php'))); $thisAppDir = __DIR__; $appsDir = dirname($thisAppDir); diff --git a/apps/user_webfinger/appinfo/info.xml b/apps/user_webfinger/appinfo/info.xml index b5e79bd6762..a4071dae172 100644 --- a/apps/user_webfinger/appinfo/info.xml +++ b/apps/user_webfinger/appinfo/info.xml @@ -2,7 +2,7 @@ <info> <id>user_webfinger</id> <name>Webfinger</name> - <description>Provide webfinger for all users, so that they can use their ownCloud account as their remote storage on the web. If you don't run owncloud in the root of your domain, for instance if you run it on http://example.com/owncloud/, then makes sure you link http://example.com/.well-known/ to http://example.com/owncloud/apps/user_webfinger/ - for instance by running something like "ln -s /var/www/owncloud/apps/user_webfinger /var/www/.well-known". Only enable this app if you run this owncloud installation on a public web address, not if you run it on an intranet or on localhost.</description> + <description>Provide WebFinger for all users so they get a user address like user@owncloudinstance which can be used for unhosted applications. If you don't run ownCloud in the root of your domain, for instance if you run it on example.com/owncloud/, then make sure you link example.com/.well-known/ to example.com/owncloud/apps/user_webfinger/ - by running something like "ln -s /var/www/owncloud/apps/user_webfinger /var/www/.well-known". Only enable this app if you run this ownCloud installation on a public web address, not if you run it on an intranet or on localhost.</description> <version>0.1</version> <licence>AGPL</licence> <author>Michiel de Jong</author> diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php index 269bb4758ed..afb53689682 100644 --- a/apps/user_webfinger/webfinger.php +++ b/apps/user_webfinger/webfinger.php @@ -20,5 +20,5 @@ echo "<"; ?xml version="1.0" encoding="UTF-8"?> <XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0"> <hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME'] ?></hm:Host> - <Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/apps/unhosted/compat.php/<?php echo $userName ?>/unhosted/" /> + <Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/apps/remoteStorage/compat.php/<?php echo $userName ?>/remoteStorage/" /> </XRD> |