<div dir="ltr">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. <br>
Is it possible to call functions in the FileSystem namespace with out having a active login to the owncloud instance? <br><br>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"<br>
<br>Thank You</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 26, 2013 at 10:41 AM, Tharindu Dhananjaya Galappaththi <span dir="ltr"><<a href="mailto:tdgalappaththi@gmail.com" target="_blank">tdgalappaththi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">$files = \OCA\CloudToCloud\CloudToCloudShare::getFiles($email,$dir); // this is called from the 'public' page<br>
<div><br></div><div><br></div><div><div><br></div><div> public static function getFiles($email,$dir){</div>
<div> $query = \OC_DB::prepare("SELECT * FROM *PREFIX*c2c_share WHERE `email`=? ORDER BY `stime`");</div><div> $result = $query->execute(array($email));</div><div> $files = array();</div>
<div><br></div><div> if($dir == ""){</div><div> while ($aFile = $result->fetchRow()) {</div><div> if($aFile['item_type'] == "file"){</div><div> $name = $aFile['file_target'];</div>
<div> $path = \OC\Files\Filesystem::getPath($aFile['item_source']);</div><div> $parent_path = substr($path,0,strrpos($path,'/')+1);</div><div> $dir_content = \OC\Files\Filesystem::getDirectoryContent($parent_path);</div>
<div><br></div><div> foreach($dir_content as $i){</div><div> if($i['name'] == $name && $i['type']=="file"){</div><div> $files[] = $i;</div>
<div> break;</div><div> }</div><div> }</div><div> }else{</div><div> $name = $aFile['file_target'];</div><div>
$path = \OC\Files\Filesystem::getPath($aFile['item_source']);</div>
<div> $parent_path = substr($path,0,strrpos($path,'/')+1);</div><div> $dir_content = \OC\Files\Filesystem::getDirectoryContent($parent_path);</div><div> foreach($dir_content as $i){</div>
<div> if($i['name'] == $name && $i['type']=="dir"){</div><div> $files[] = $i;</div><div> break;</div><div> }</div>
<div> }</div><div> }</div><div> }</div><div> }else{</div><div> while($aFile = $result->fetchRow()){</div><div> if($aFile['item_type'] == "dir" && $aFile['file_target'] == $dir){</div>
<div> $path = \OC\Files\Filesystem::getPath($aFile['item_source']);</div><div> $dir_content = \OC\Files\Filesystem::getDirectoryContent($path);</div><div> foreach($dir_content as $i){</div>
<div> $files[] = $i;</div><div> }</div><div> }</div><div> }</div><div><br></div><div> }</div><div> return $files;</div><div> }</div>
</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 26, 2013 at 3:26 AM, Bernhard Posselt <span dir="ltr"><<a href="mailto:nukeawhale@gmail.com" target="_blank">nukeawhale@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">File functions? Can you elaborate or show some code?<br>
<div><div><br>
On 06/25/2013 09:28 PM, Tharindu Dhananjaya Galappaththi wrote:<br>
> Without logging in to owncloud, I want to display some file info on the<br>
> public page. Is it possible to call file functions without logging in to<br>
> owncloud? It is giving me errors.<br>
> Please help<br>
><br>
><br>
> On Sun, Jun 23, 2013 at 4:37 PM, Bernhard Posselt <<a href="mailto:nukeawhale@gmail.com" target="_blank">nukeawhale@gmail.com</a>>wrote:<br>
><br>
>> Its very easy: use a guest template (<br>
>><br>
>> <a href="http://doc.owncloud.org/server/5.0/developer_manual/app/app/api/templates.html#OC_Template::printGuestPage" target="_blank">http://doc.owncloud.org/server/5.0/developer_manual/app/app/api/templates.html#OC_Template::printGuestPage</a><br>
>> )<br>
>> and dont check if the user is logged in<br>
>><br>
>> On 06/23/2013 10:29 AM, Tharindu Dhananjaya Galappaththi wrote:<br>
>>> Hi,<br>
>>> I'm trying to create a page in a app, that can be accessed with out<br>
>> logging<br>
>>> in to owncloud.<br>
>>> I followed the procedure mentioned in :<br>
>>> <a href="http://owncloud.org/apps/public-php-and-remote-php/" target="_blank">http://owncloud.org/apps/public-php-and-remote-php/</a> , but it is not<br>
>>> working.<br>
>>> Please help me with this.<br>
>>> Thank You<br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Owncloud mailing list<br>
>>> <a href="mailto:Owncloud@kde.org" target="_blank">Owncloud@kde.org</a><br>
>>> <a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
>> _______________________________________________<br>
>> Owncloud mailing list<br>
>> <a href="mailto:Owncloud@kde.org" target="_blank">Owncloud@kde.org</a><br>
>> <a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Owncloud mailing list<br>
> <a href="mailto:Owncloud@kde.org" target="_blank">Owncloud@kde.org</a><br>
> <a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
<br>
_______________________________________________<br>
Owncloud mailing list<br>
<a href="mailto:Owncloud@kde.org" target="_blank">Owncloud@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>