Browse Source

improve remote.php and create public.php

tags/v4.0.0beta
Georg Ehrke 12 years ago
parent
commit
936c8ba1cc

+ 2
- 1
apps/calendar/appinfo/app.php View File

'name' => $l->t('Calendar'))); 'name' => $l->t('Calendar')));
OCP\App::registerPersonal('calendar', 'settings'); OCP\App::registerPersonal('calendar', 'settings');
OC_Search::registerProvider('OC_Search_Provider_Calendar'); OC_Search::registerProvider('OC_Search_Provider_Calendar');
OCP\CONFIG::setAppValue('core', 'caldav', '/apps/calendar/appinfo/remote.php');
OCP\CONFIG::setAppValue('core', 'remote_caldav', '/apps/calendar/appinfo/remote.php');
OCP\CONFIG::setAppValue('core', 'public_calendar', '/apps/calendar/appinfo/share.php');

+ 1
- 1
apps/contacts/appinfo/app.php View File

OCP\App::registerPersonal('contacts','settings'); OCP\App::registerPersonal('contacts','settings');
OCP\Util::addscript('contacts', 'loader'); OCP\Util::addscript('contacts', 'loader');
OC_Search::registerProvider('OC_Search_Provider_Contacts'); OC_Search::registerProvider('OC_Search_Provider_Contacts');
OCP\CONFIG::setAppValue('core', 'carddav', '/apps/contacts/appinfo/remote.php');
OCP\CONFIG::setAppValue('core', 'remote_carddav', '/apps/contacts/appinfo/remote.php');

+ 1
- 1
apps/files/appinfo/app.php View File

OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") )); OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") ));


OC_Search::registerProvider('OC_Search_Provider_File'); OC_Search::registerProvider('OC_Search_Provider_File');
OCP\CONFIG::setAppValue('core', 'webdav', '/apps/files/appinfo/remote.php');
OCP\CONFIG::setAppValue('core', 'remote_webdav', '/apps/files/appinfo/remote.php');

+ 1
- 1
apps/files_sharing/appinfo/app.php View File

OCP\Util::addscript("3rdparty", "chosen/chosen.jquery.min"); OCP\Util::addscript("3rdparty", "chosen/chosen.jquery.min");
OCP\Util::addStyle( 'files_sharing', 'sharing' ); OCP\Util::addStyle( 'files_sharing', 'sharing' );
OCP\Util::addStyle("3rdparty", "chosen/chosen"); OCP\Util::addStyle("3rdparty", "chosen/chosen");
OCP\CONFIG::setAppValue('core', 'public_files', '/apps/files_sharing/get.php');
?> ?>

+ 1
- 1
apps/files_sharing/js/share.js View File

}, },
showPrivateLink:function(item, token) { showPrivateLink:function(item, token) {
$('#privateLinkCheckbox').attr('checked', true); $('#privateLinkCheckbox').attr('checked', true);
var link = parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token;
var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=files&token='+token;
if (token.indexOf('&path=') == -1) { if (token.indexOf('&path=') == -1) {
link += '&file=' + item; link += '&file=' + item;
} else { } else {

+ 1
- 1
core/js/js.js View File

webroot:oc_webroot, webroot:oc_webroot,
appswebroot:oc_appswebroot, appswebroot:oc_appswebroot,
currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false, currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false,
coreApps:['admin','log','search','settings','core','3rdparty'],
coreApps:['', 'admin','log','search','settings','core','3rdparty'],
/** /**
* get an absolute url to a file in an appen * get an absolute url to a file in an appen
* @param app the id of the app the file belongs to * @param app the id of the app the file belongs to

+ 10
- 0
public.php View File

<?php
$RUNTIME_NOSETUPFS = true;
//$RUNTIME_NOAPPS = TRUE;
require_once('lib/base.php');
$file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($_GET['service']));
if(is_null($file)){
header('HTTP/1.0 404 Not Found');
exit;
}
require_once(OC::$APPSROOT . $file);

+ 3
- 3
remote.php View File

$pos = strlen($path_info); $pos = strlen($path_info);
} }
$service=substr($path_info, 1, $pos-1); $service=substr($path_info, 1, $pos-1);
$file = OCP\CONFIG::getAppValue('core', $service);
$file = OCP\CONFIG::getAppValue('core', 'remote_' . $service);
if(is_null($file)){ if(is_null($file)){
//header('HTTP/1.0 404 Not Found');
header('HTTP/1.0 404 Not Found');
exit; exit;
} }
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
require_once(OC::$APPSROOT . $file);
require_once(OC::$APPSROOT . $file);

Loading…
Cancel
Save