diff options
author | Michiel@unhosted <michiel@unhosted.org> | 2011-09-02 15:25:04 +0200 |
---|---|---|
committer | Michiel@unhosted <michiel@unhosted.org> | 2011-09-02 15:25:04 +0200 |
commit | e798c32375dd01ec578ccd6fd9420c72a22e4fc4 (patch) | |
tree | 22fa25be6cea077c9eddf498d5fb7a4d78f3a08d /apps | |
parent | 71205b8b07be83c0a1ced3ce5dfe92629c7a5cc3 (diff) | |
download | nextcloud-server-e798c32375dd01ec578ccd6fd9420c72a22e4fc4.tar.gz nextcloud-server-e798c32375dd01ec578ccd6fd9420c72a22e4fc4.zip |
renaming core_unhosted app to just unhosted, and cleaning up unused files in it
Diffstat (limited to 'apps')
-rw-r--r-- | apps/core_unhosted/admin.php | 50 | ||||
-rw-r--r-- | apps/core_unhosted/ajax/deletetoken.php | 12 | ||||
-rw-r--r-- | apps/core_unhosted/ajax/link.php | 49 | ||||
-rw-r--r-- | apps/core_unhosted/css/admin.css | 2 | ||||
-rw-r--r-- | apps/core_unhosted/img/island.png | bin | 3674 -> 0 bytes | |||
-rw-r--r-- | apps/core_unhosted/js/admin.js | 16 | ||||
-rw-r--r-- | apps/core_unhosted/templates/admin.php | 19 | ||||
-rw-r--r-- | apps/core_unhosted/templates/breadcrumb.php | 4 | ||||
-rw-r--r-- | apps/core_unhosted/templates/files.php | 9 | ||||
-rw-r--r-- | apps/unhosted/appinfo/app.php | 5 | ||||
-rw-r--r-- | apps/unhosted/appinfo/database.xml (renamed from apps/core_unhosted/appinfo/database.xml) | 0 | ||||
-rw-r--r-- | apps/unhosted/appinfo/info.xml (renamed from apps/core_unhosted/appinfo/info.xml) | 2 | ||||
-rw-r--r-- | apps/unhosted/compat.php (renamed from apps/core_unhosted/compat.php) | 0 | ||||
-rw-r--r-- | apps/unhosted/lib_unhosted.php (renamed from apps/core_unhosted/lib_unhosted.php) | 0 | ||||
-rw-r--r-- | apps/unhosted/oauth_ro_auth.php (renamed from apps/core_unhosted/oauth_ro_auth.php) | 0 |
15 files changed, 6 insertions, 162 deletions
diff --git a/apps/core_unhosted/admin.php b/apps/core_unhosted/admin.php deleted file mode 100644 index 8a4f9f9a2e0..00000000000 --- a/apps/core_unhosted/admin.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/** -* ownCloud app for using your OwnCloud on the unhosted web -* -* @author Michiel de Jong -* Some parts are from the files_publiclink app, and thus: -* @copyright 2010 Robin Appelman icewind1991@gmail.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either -* version 3 of the License, or any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Affero General Public -* License along with this library. If not, see <http://www.gnu.org/licenses/>. -* -*/ - - -// Init owncloud -require_once('../../lib/base.php'); -require_once( 'lib_unhosted.php' ); -require( 'template.php' ); - -// Check if we are a user -if( !OC_USER::isLoggedIn()){ -//var_export($_COOKIE); -//var_export($_SESSION); -//die('get a cookie!'); - header( "Location: ".OC_HELPER::linkTo( "index.php" )); - exit(); -} - -OC_APP::setActiveNavigationEntry( "unhosted_web_administration" ); - -OC_UTIL::addStyle( 'unhosted_web', 'admin' ); -OC_UTIL::addScript( 'unhosted_web', 'admin' ); - -// return template -$tmpl = new OC_TEMPLATE( "unhosted_web", "admin", "admin" ); -$tmpl->assign( 'tokens', OC_UnhostedWeb::getAllTokens()); -$tmpl->printPage(); - -?> diff --git a/apps/core_unhosted/ajax/deletetoken.php b/apps/core_unhosted/ajax/deletetoken.php deleted file mode 100644 index 3e3668188bd..00000000000 --- a/apps/core_unhosted/ajax/deletetoken.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -$RUNTIME_NOAPPS=true; //no need to load the apps - -require_once '../../../lib/base.php'; - -require_once '../lib_unhosted.php'; - -$token=$_GET['token']; -if(OC_User::isLoggedIn()) { - OC_UnhostedWeb::deleteToken($token); -} -?> diff --git a/apps/core_unhosted/ajax/link.php b/apps/core_unhosted/ajax/link.php deleted file mode 100644 index 9f479cbd510..00000000000 --- a/apps/core_unhosted/ajax/link.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -// We send json data -header( "Content-Type: application/jsonrequest" ); -header("Access-Control-Allow-Origin: https://myfavouritesandwich.org"); -header('Access-Control-Max-Age: 3600'); -header('Access-Control-Allow-Methods: OPTIONS, POST'); - -try { - if($_POST['secret'] && $_POST['userAddress'] && $_POST['dataScope'] && $_POST['secret']=='XRlc2FuZHdpY2gub3JnIiwiZW1haWwiOiJhc2RmYXNkZkB1b') { - // Init owncloud - require_once('../../../lib/base.php'); - require_once('../lib_unhosted.php'); - - $ownCloudDetails = array( - 'url' => 'https://myfavouritesandwich.org:444/', - 'usr' => $_POST['userAddress'],//this is not necessarily the case, you could also use one owncloud user and many user addresses on it - 'pwd' => OC_User::generatePassword(), - ); - $storage = array( - 'dataScope' => $_POST['dataScope'], - 'storageType' => 'http://unhosted.org/spec/dav/0.1', - 'davUrl' => 'https://myfavouritesandwich.org:444/apps/unhosted_web/compat.php/'.$ownCloudDetails['usr'].'/unhosted/', - 'userAddress' => $_POST['userAddress'],//here, it refers to the user sent to DAV in the basic auth - ); - if(OC_User::userExists($ownCloudDetails['usr'])){ - $message = 'account reopened'; - $result = OC_User::setPassword($ownCloudDetails['usr'], $ownCloudDetails['pwd']); - } else { - $message = 'account created'; - $result = OC_User::createUser($ownCloudDetails['usr'], $ownCloudDetails['pwd']); - } - if($result) { - $storage['davToken'] = OC_UnhostedWeb::createDataScope( - 'https://myfavouritesandwich.org/', - $ownCloudDetails['usr'], $storage['dataScope']); - echo json_encode(array('ownCloudDetails' => $ownCloudDetails, 'storage' => $storage)); - exit(); - } else { - echo json_encode( array( "status" => "error", "data" => "couldn't ", "ownCloudDetails" => $ownCloudDetails)); - exit(); - } - } else { - echo json_encode( array( "status" => "error", "data" => "post not ok")); - } -} catch(Exception $e) { - echo json_encode( array( "status" => "error", "data" => $e)); -} -echo json_encode( array( "status" => "error", "data" => array( "message" => "Computer says 'no'" ))); -?> diff --git a/apps/core_unhosted/css/admin.css b/apps/core_unhosted/css/admin.css deleted file mode 100644 index f21b289f043..00000000000 --- a/apps/core_unhosted/css/admin.css +++ /dev/null @@ -1,2 +0,0 @@ -td.path{min-width:200px} -td.expire{width:120px}
\ No newline at end of file diff --git a/apps/core_unhosted/img/island.png b/apps/core_unhosted/img/island.png Binary files differdeleted file mode 100644 index 8536e508e34..00000000000 --- a/apps/core_unhosted/img/island.png +++ /dev/null diff --git a/apps/core_unhosted/js/admin.js b/apps/core_unhosted/js/admin.js deleted file mode 100644 index bf578c0b547..00000000000 --- a/apps/core_unhosted/js/admin.js +++ /dev/null @@ -1,16 +0,0 @@ -$(document).ready(function() { - $("button.revoke").live('click', function( event ) { - event.preventDefault(); - var token=$(this).attr('data-token'); - var data="token="+token; - $.ajax({ - type: 'GET', - url: 'ajax/deletetoken.php', - cache: false, - data: data, - success: function(){ - $('#'+token).remove(); - } - }); - }); -}); diff --git a/apps/core_unhosted/templates/admin.php b/apps/core_unhosted/templates/admin.php deleted file mode 100644 index 5ad76cc17c8..00000000000 --- a/apps/core_unhosted/templates/admin.php +++ /dev/null @@ -1,19 +0,0 @@ -<table id='tokenlist'> - <thead> - <tr> - <td class='appUrl'><?php echo $l->t( 'App-Url' ); ?></td> - <td class='userAddress'><?php echo $l->t( 'User-Address' ); ?></td> - <td class='token'><?php echo $l->t( 'Token' ); ?></td> - </tr> - </thead> - <tbody> - <?php foreach($_['tokens'] as $token=>$details):?> - <tr class='token' id='<?php echo $token;?>'> - <td class='appUrl'><?php echo $details['appUrl'];?></td> - <td class='userAddress'><?php echo $details['userAddress'];?></td> - <td class='token'><?php echo $token;?></td> - <td><button class='revoke fancybutton' data-token='<?php echo $token;?>'><?php echo $l->t( 'Revoke' ); ?></button></td> - </tr> - <?php endforeach;?> - </tbody> -</table> diff --git a/apps/core_unhosted/templates/breadcrumb.php b/apps/core_unhosted/templates/breadcrumb.php deleted file mode 100644 index 733531d9e10..00000000000 --- a/apps/core_unhosted/templates/breadcrumb.php +++ /dev/null @@ -1,4 +0,0 @@ - <a href="<?php echo link_to("files_publiclink", "get.php?token=".$_['token']); ?>"><img src="<?php echo image_path("", "actions/go-home.png"); ?>" alt="Root" /></a> - <?php foreach($_["breadcrumb"] as $crumb): ?> - <a href="<?php echo link_to("files_publiclink", "get.php?token=".$_['token']."&path=".$crumb["dir"]); ?>"><?php echo htmlspecialchars($crumb["name"]); ?></a> - <?php endforeach; ?>
\ No newline at end of file diff --git a/apps/core_unhosted/templates/files.php b/apps/core_unhosted/templates/files.php deleted file mode 100644 index b4ae17656c3..00000000000 --- a/apps/core_unhosted/templates/files.php +++ /dev/null @@ -1,9 +0,0 @@ - <?php foreach($_["files"] as $file): ?> - <tr> - <td class="selection"><input type="checkbox" /></td> - <td class="filename"><a style="background-image:url(<?php if($file["type"] == "dir") echo mimetype_icon("dir"); else echo mimetype_icon($file["mime"]); ?>)" href="<?php if($file["type"] == "dir") echo link_to("files_publiclink", "get.php?token=".$_['token']."&path=".$file["directory"]."/".$file["name"]); else echo link_to("files_publiclink", "get.php?token=".$_['token']."&path=".$file["directory"]."/".$file["name"]); ?>" title=""><?php echo htmlspecialchars($file["name"]); ?></a></td> - <td class="filesize"><?php echo human_file_size($file["size"]); ?></td> - <td class="date"><?php if($file["type"] != "dir") echo $file["date"]; ?></td> - <td class="fileaction"><a href="" title=""><img src="images/drop-arrow.png" alt="+" /></a></td> - </tr> - <?php endforeach; ?>
\ No newline at end of file diff --git a/apps/unhosted/appinfo/app.php b/apps/unhosted/appinfo/app.php new file mode 100644 index 00000000000..84e07304534 --- /dev/null +++ b/apps/unhosted/appinfo/app.php @@ -0,0 +1,5 @@ +<?php +OC_App::register( array( + 'order' => 10, + 'id' => 'unhosted', + 'name' => 'Unhosted Web' )); diff --git a/apps/core_unhosted/appinfo/database.xml b/apps/unhosted/appinfo/database.xml index db25657085b..db25657085b 100644 --- a/apps/core_unhosted/appinfo/database.xml +++ b/apps/unhosted/appinfo/database.xml diff --git a/apps/core_unhosted/appinfo/info.xml b/apps/unhosted/appinfo/info.xml index dccbd3b8245..359620f4578 100644 --- a/apps/core_unhosted/appinfo/info.xml +++ b/apps/unhosted/appinfo/info.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <info> - <id>core_unhosted</id> + <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> diff --git a/apps/core_unhosted/compat.php b/apps/unhosted/compat.php index 88dac5e7b55..88dac5e7b55 100644 --- a/apps/core_unhosted/compat.php +++ b/apps/unhosted/compat.php diff --git a/apps/core_unhosted/lib_unhosted.php b/apps/unhosted/lib_unhosted.php index 304759c521c..304759c521c 100644 --- a/apps/core_unhosted/lib_unhosted.php +++ b/apps/unhosted/lib_unhosted.php diff --git a/apps/core_unhosted/oauth_ro_auth.php b/apps/unhosted/oauth_ro_auth.php index b785d85fead..b785d85fead 100644 --- a/apps/core_unhosted/oauth_ro_auth.php +++ b/apps/unhosted/oauth_ro_auth.php |