Public page in a app

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Public page in a app

tharinduDG
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
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Public page in a app

Bernhard Posselt
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
> [hidden email]
> https://mail.kde.org/mailman/listinfo/owncloud

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Public page in a app

tharinduDG
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 <[hidden email]> 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
> [hidden email]
> https://mail.kde.org/mailman/listinfo/owncloud

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud


_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Public page in a app

Bernhard Posselt
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 <[hidden email]>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
>>> [hidden email]
>>> https://mail.kde.org/mailman/listinfo/owncloud
>> _______________________________________________
>> Owncloud mailing list
>> [hidden email]
>> https://mail.kde.org/mailman/listinfo/owncloud
>>
>
>
> _______________________________________________
> Owncloud mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/owncloud

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Public page in a app

tharinduDG
$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 <[hidden email]> 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 <[hidden email]>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
>>> [hidden email]
>>> https://mail.kde.org/mailman/listinfo/owncloud
>> _______________________________________________
>> Owncloud mailing list
>> [hidden email]
>> https://mail.kde.org/mailman/listinfo/owncloud
>>
>
>
> _______________________________________________
> Owncloud mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/owncloud

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud


_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Public page in a app

tharinduDG
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>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
>>> [hidden email]
>>> https://mail.kde.org/mailman/listinfo/owncloud
>> _______________________________________________
>> Owncloud mailing list
>> [hidden email]
>> https://mail.kde.org/mailman/listinfo/owncloud
>>
>
>
> _______________________________________________
> Owncloud mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/owncloud

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud



_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Public page in a app

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


On Wed, Jun 26, 2013 at 1:01 PM, Tharindu Dhananjaya Galappaththi <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>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
>>> [hidden email]
>>> https://mail.kde.org/mailman/listinfo/owncloud
>> _______________________________________________
>> Owncloud mailing list
>> [hidden email]
>> https://mail.kde.org/mailman/listinfo/owncloud
>>
>
>
> _______________________________________________
> Owncloud mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/owncloud

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud




_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Public page in a app

Roman Geber
On 06/28/2013 10:10 AM, Tharindu Dhananjaya Galappaththi wrote:

>
>     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"

Not sure if this will help you, but in my master checkout the getPath
stuff lives somewhere along the lines of line 715. Have you tried using
the latest master yet? Maybe something is missing in your dev setup.
Just a wild guess.

Is your app available somewhere so that I could run it?

cu
Roman


--
Roman Geber
Linux Consultant
Tel: +49-172-4430229
Mail: [hidden email]

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537


_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud

signature.asc (919 bytes) Download Attachment