Brush up access chapter

This commit is contained in:
Daniel Molkentin
2013-01-03 15:41:14 +01:00
parent dccdfc3138
commit 96589f2379

View File

@@ -1,36 +1,61 @@
public.php and remote.php
=========================
Granting Access to your App
===========================
public.php
----------
The public.php is used for public sharing like public file sharing, public gallery sharing and public calendar sharing.
ownCloud's architecture has two major interfaces for apps that need to deal
with access beyond the web browser or authenticated users: ``public.php``
and ``remote.php`` serve this purpose.
Register:
~~~~~~~~~
Public Sharing
--------------
To register an app for public.php you just have to put the following lines into your apps appinfo/info.xml.
The file ``public.php`` is used for *public sharing* like public file sharing,
public gallery sharing and public calendar sharing.
Example from our source code: ``<public> <calendar>share.php</calendar> <caldav>share.php</caldav> </public>``
To register an app for ``public.php`` you just have to put the following lines
into your apps ``appinfo/info.xml``.
Now you can reach the file /apps/calendar/share.php through /public.php?service=calendar and through /public.php?service=caldav
Example from our source code::
Example for syntax: ``<public> <servicename>phpfileforsharing.php</servicename> </public>``
<public>
<calendar>share.php</calendar>
<caldav>share.php</caldav>
</public>
Now you can reach the file */apps/appid/phpfileforsharing.php* through */public.php?service=servicename*
Now you can reach the file ``/apps/calendar/share.php`` through
``/public.php?service=calendar`` and through ``/public.php?service=caldav``.
In a more abstract description, given this snippet::
remote.php
----------
The remote.php is used for remote services like webdav, caldav, carddav and ampache.
<public>
<servicename>phpfileforsharing.php</servicename>
</public>
Register:
~~~~~~~~~
you can reach the file ``/apps/appid/phpfileforsharing.php`` by calling
``/public.php?service=servicename``.
To register an app for remote.php you just have to put the following lines into your apps appinfo/info.xml.
Remote Services
---------------
Example from our source code: ``<remote> <calendar>appinfo/remote.php</calendar> <caldav>appinfo/remote.php</caldav> </remote>``
Sometimes apps provide specific protocols that can be handled via HTTP, but are
meant to be used with native applications, such as WebDAV (file manager), CalDAV
(calendar), CardDAV (address book) and Ampache (media player) rather than the
web browser itself. Such services can be exposed via the ``remote.php``
interface.
Now you can reach the file /apps/calendar/appinfo/remote.php through /remote.php/calendar and through /remote.php/caldav/
To register an app for ``remote.php`` you just have use your app's
``appinfo/info.xml``, along the lines of the ``public.php`` syntax::
Example for syntax: ``<remote> <servicename>phpfileforremote.php</servicename> </remote>``
<remote>
<calendar>appinfo/remote.php</calendar>
<caldav>appinfo/remote.php</caldav>
</remote>
Now you can reach the file */apps/appid/phpfileforremote.php* through */remote.php/servicename/*
Now you can reach the file ``/apps/calendar/appinfo/remote.php`` through
``/remote.php/calendar`` and through ``/remote.php/caldav/``. Again, with
a more abstract syntax, this means that the snippet::
<remote>
<servicename>phpfileforremote.php</servicename>
</remote>
will grant access to ``/apps/appid/phpfileforremote.php`` through
``/remote.php/servicename/``.