[Owncloud] Public page in a app

Tharindu Dhananjaya Galappaththi tdgalappaththi at gmail.com
Fri Jun 28 08:10:13 UTC 2013


Can someone help me with this.... :(


On Wed, Jun 26, 2013 at 1:01 PM, Tharindu Dhananjaya Galappaththi <
tdgalappaththi at gmail.com> wrote:

> my intention is to allow sharing files for external users and let them see
> a list of files after they have visited the public page. When the external
> visitor is prompted with the files list, there will not be a active login.
> Is it possible to call functions in the FileSystem namespace with out
> having a active login to the owncloud instance?
>
> I get a error saying, "[Wed Jun 26 00:13:45 2013] [error] [client
> 127.0.0.1] PHP Fatal error:  Call to a member function getPath() on a
> non-object in /var/www/owncloud5/lib/files/filesystem.php on line 638"
>
> Thank You
>
>
> On Wed, Jun 26, 2013 at 10:41 AM, Tharindu Dhananjaya Galappaththi <
> tdgalappaththi at gmail.com> wrote:
>
>> $files = \OCA\CloudToCloud\CloudToCloudShare::getFiles($email,$dir);  //
>> this is called from the 'public' page
>>
>>
>>
>>     public static function getFiles($email,$dir){
>>         $query = \OC_DB::prepare("SELECT * FROM *PREFIX*c2c_share WHERE
>> `email`=? ORDER BY `stime`");
>>         $result = $query->execute(array($email));
>>         $files = array();
>>
>>         if($dir == ""){
>>             while ($aFile = $result->fetchRow()) {
>>                 if($aFile['item_type'] == "file"){
>>                    $name = $aFile['file_target'];
>>                    $path =
>> \OC\Files\Filesystem::getPath($aFile['item_source']);
>>                    $parent_path = substr($path,0,strrpos($path,'/')+1);
>>                    $dir_content =
>> \OC\Files\Filesystem::getDirectoryContent($parent_path);
>>
>>                     foreach($dir_content as $i){
>>                         if($i['name'] == $name && $i['type']=="file"){
>>                             $files[] = $i;
>>                             break;
>>                         }
>>                     }
>>                 }else{
>>                     $name = $aFile['file_target'];
>>                     $path =
>> \OC\Files\Filesystem::getPath($aFile['item_source']);
>>                     $parent_path = substr($path,0,strrpos($path,'/')+1);
>>                     $dir_content =
>> \OC\Files\Filesystem::getDirectoryContent($parent_path);
>>                     foreach($dir_content as $i){
>>                         if($i['name'] == $name && $i['type']=="dir"){
>>                             $files[] = $i;
>>                             break;
>>                         }
>>                     }
>>                 }
>>             }
>>         }else{
>>             while($aFile = $result->fetchRow()){
>>                 if($aFile['item_type'] == "dir" && $aFile['file_target']
>> == $dir){
>>                     $path =
>> \OC\Files\Filesystem::getPath($aFile['item_source']);
>>                     $dir_content =
>> \OC\Files\Filesystem::getDirectoryContent($path);
>>                     foreach($dir_content as $i){
>>                             $files[] = $i;
>>                     }
>>                 }
>>             }
>>
>>         }
>>         return $files;
>>     }
>>
>>
>> On Wed, Jun 26, 2013 at 3:26 AM, Bernhard Posselt <nukeawhale at gmail.com>wrote:
>>
>>> File functions? Can you elaborate or show some code?
>>>
>>> On 06/25/2013 09:28 PM, Tharindu Dhananjaya Galappaththi wrote:
>>> > Without logging in to owncloud, I want to display some file info on the
>>> > public page. Is it possible to call file functions without logging in
>>> to
>>> > owncloud? It is giving me errors.
>>> > Please help
>>> >
>>> >
>>> > On Sun, Jun 23, 2013 at 4:37 PM, Bernhard Posselt <
>>> nukeawhale at gmail.com>wrote:
>>> >
>>> >> Its very easy: use a guest template (
>>> >>
>>> >>
>>> http://doc.owncloud.org/server/5.0/developer_manual/app/app/api/templates.html#OC_Template::printGuestPage
>>> >> )
>>> >> and dont check if the user is logged in
>>> >>
>>> >> On 06/23/2013 10:29 AM, Tharindu Dhananjaya Galappaththi wrote:
>>> >>> Hi,
>>> >>> I'm trying to create a page in a app, that can be accessed with out
>>> >> logging
>>> >>> in to owncloud.
>>> >>> I followed the procedure mentioned in :
>>> >>> http://owncloud.org/apps/public-php-and-remote-php/ , but it is not
>>> >>> working.
>>> >>> Please help me with this.
>>> >>> Thank You
>>> >>>
>>> >>>
>>> >>>
>>> >>> _______________________________________________
>>> >>> Owncloud mailing list
>>> >>> Owncloud at kde.org
>>> >>> https://mail.kde.org/mailman/listinfo/owncloud
>>> >> _______________________________________________
>>> >> Owncloud mailing list
>>> >> Owncloud at kde.org
>>> >> https://mail.kde.org/mailman/listinfo/owncloud
>>> >>
>>> >
>>> >
>>> > _______________________________________________
>>> > Owncloud mailing list
>>> > Owncloud at kde.org
>>> > https://mail.kde.org/mailman/listinfo/owncloud
>>>
>>> _______________________________________________
>>> Owncloud mailing list
>>> Owncloud at kde.org
>>> https://mail.kde.org/mailman/listinfo/owncloud
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20130628/1954b38e/attachment.html>


More information about the Owncloud mailing list