]> source.dussan.org Git - nextcloud-server.git/commitdiff
improve remote.php and create public.php
authorGeorg Ehrke <dev@georgswebsite.de>
Mon, 7 May 2012 13:39:17 +0000 (15:39 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Mon, 7 May 2012 13:39:17 +0000 (15:39 +0200)
apps/calendar/appinfo/app.php
apps/contacts/appinfo/app.php
apps/files/appinfo/app.php
apps/files_sharing/appinfo/app.php
apps/files_sharing/js/share.js
core/js/js.js
public.php [new file with mode: 0644]
remote.php

index 297d8e44b6723e746e9c413499390f95e93eb235..06fb92577359c5175923747fa3f524238e8c333d 100755 (executable)
@@ -23,4 +23,5 @@ OCP\App::addNavigationEntry( array(
   'name' => $l->t('Calendar')));
 OCP\App::registerPersonal('calendar', 'settings');
 OC_Search::registerProvider('OC_Search_Provider_Calendar');
-OCP\CONFIG::setAppValue('core', 'caldav', '/apps/calendar/appinfo/remote.php');
\ No newline at end of file
+OCP\CONFIG::setAppValue('core', 'remote_caldav', '/apps/calendar/appinfo/remote.php');
+OCP\CONFIG::setAppValue('core', 'public_calendar', '/apps/calendar/appinfo/share.php');
\ No newline at end of file
index 216e89d5c09db39ea70f3b52641b588b1570079d..7e196733064ddab8337f37498cbb4424125d2bba 100755 (executable)
@@ -25,4 +25,4 @@ OCP\App::addNavigationEntry( array(
 OCP\App::registerPersonal('contacts','settings');
 OCP\Util::addscript('contacts', 'loader');
 OC_Search::registerProvider('OC_Search_Provider_Contacts');
-OCP\CONFIG::setAppValue('core', 'carddav', '/apps/contacts/appinfo/remote.php');
\ No newline at end of file
+OCP\CONFIG::setAppValue('core', 'remote_carddav', '/apps/contacts/appinfo/remote.php');
\ No newline at end of file
index 2cc2d48602cb20661dd71b9c946cb76c5f13e378..e7358242ddbfaa896e128f3dbd3495337f255672 100755 (executable)
@@ -7,4 +7,4 @@ OCP\App::registerAdmin('files','admin');
 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');
-OCP\CONFIG::setAppValue('core', 'webdav', '/apps/files/appinfo/remote.php');
\ No newline at end of file
+OCP\CONFIG::setAppValue('core', 'remote_webdav', '/apps/files/appinfo/remote.php');
\ No newline at end of file
index bd81a45cc555408be0881f747c047fe0f1fb530a..b3b9776d2970f34d1044742924c6c345d963cc49 100755 (executable)
@@ -17,5 +17,5 @@ if ($dir != '/Shared' || OCP\Config::getAppValue('files_sharing', 'resharing', '
 OCP\Util::addscript("3rdparty", "chosen/chosen.jquery.min");
 OCP\Util::addStyle( 'files_sharing', 'sharing' );
 OCP\Util::addStyle("3rdparty", "chosen/chosen");
-
+OCP\CONFIG::setAppValue('core', 'public_files', '/apps/files_sharing/get.php');
 ?>
index 7bfaa1f0c69e0ead47f71bf3f723a83c143668c5..3dedde48c2707c5c0dd607bba5031861b77eab9c 100644 (file)
@@ -177,7 +177,7 @@ OC.Share={
        },
        showPrivateLink:function(item, token) {
                $('#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) {
                        link += '&file=' + item;
                } else {
index 7585d4b09d1064a0fd62858fc497631373e05cc5..44255ed66706810021ce5ad9f1a0f3156520b799 100644 (file)
@@ -33,7 +33,7 @@ OC={
        webroot:oc_webroot,
        appswebroot:oc_appswebroot,
        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
         * @param app the id of the app the file belongs to
diff --git a/public.php b/public.php
new file mode 100644 (file)
index 0000000..27a75ad
--- /dev/null
@@ -0,0 +1,10 @@
+<?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);
\ No newline at end of file
index db2d1756f7a89a851962143cb2ac64fcf8b7cf8b..2a7ab167d048c3dbe0b1060fddabf9a3c6207906 100644 (file)
@@ -7,10 +7,10 @@ if (!$pos = strpos($path_info, '/', 1)) {
        $pos = strlen($path_info);
 }
 $service=substr($path_info, 1, $pos-1);
-$file = OCP\CONFIG::getAppValue('core', $service);
+$file = OCP\CONFIG::getAppValue('core', 'remote_' . $service);
 if(is_null($file)){
-       //header('HTTP/1.0 404 Not Found');
+       header('HTTP/1.0 404 Not Found');
        exit;
 }
 $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
-require_once(OC::$APPSROOT . $file);
+require_once(OC::$APPSROOT . $file);
\ No newline at end of file