<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — require user to be logged in to view directory]]></title>
		<link>https://punbb.informer.com/forums/topic/9937/require-user-to-be-logged-in-to-view-directory/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/9937/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in require user to be logged in to view directory.]]></description>
		<lastBuildDate>Tue, 27 Dec 2005 16:56:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: require user to be logged in to view directory]]></title>
			<link>https://punbb.informer.com/forums/post/59308/#p59308</link>
			<description><![CDATA[<p>ok it works<br />just had to clear my cookies and it worked</p>]]></description>
			<author><![CDATA[null@example.com (raptrex)]]></author>
			<pubDate>Tue, 27 Dec 2005 16:56:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/59308/#p59308</guid>
		</item>
		<item>
			<title><![CDATA[Re: require user to be logged in to view directory]]></title>
			<link>https://punbb.informer.com/forums/post/59307/#p59307</link>
			<description><![CDATA[<p>You probably have the path wrong, change the <strong>include</strong> to <strong>require</strong> and see what it thinks.</p>]]></description>
			<author><![CDATA[null@example.com (Nibbler(cpg))]]></author>
			<pubDate>Tue, 27 Dec 2005 16:09:28 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/59307/#p59307</guid>
		</item>
		<item>
			<title><![CDATA[Re: require user to be logged in to view directory]]></title>
			<link>https://punbb.informer.com/forums/post/59306/#p59306</link>
			<description><![CDATA[<div class="codebox"><pre><code>&lt;?php
define(&#039;PUN_ROOT&#039;, &#039;./forums/&#039;);
include &#039;forums/include/common.php&#039;;

function login_menu() {
global $pun_user;

function directory($result) {  
     
     $handle=opendir(&quot;./files&quot;);  
     while ($file = readdir($handle)) {  
     if ($file == &quot;.&quot; || $file == &quot;..&quot; || $file == &quot;index.php&quot;) { } else { print &quot;&lt;a href=$file&gt;$file&lt;/a&gt;&lt;br&gt;\n&quot;; } 
       
     }  
     closedir($handle);  

return $result;  
}  

if ($pun_user[&#039;is_guest&#039;]) {
  echo &quot;&lt;br /&gt;Please &lt;a href=\&quot;http://animelink.be/forums/register.php\&quot;&gt;Register Here&lt;/a&gt; or &lt;a href=\&quot;http://animelink.be/forums/login.php\&quot;&gt;Login Here&lt;/a&gt;&lt;br /&gt;&quot;;
    }
else {
echo &quot;&lt;b&gt;Manga Downloader&lt;/b&gt;&lt;p&gt;&quot;;
echo directory($result);
echo &quot;&lt;p&gt;&lt;a href=\&quot;http://localhost/pantasia\&quot;&gt;Go Back To Pantasia&lt;/a&gt;&quot;;
}
}
login_menu();
?&gt;</code></pre></div><p>i put login_menu(); at the end of the script</p><p>but it will show the directory whether im logged in or not</p><p>this happens in firefox</p><p>in opera</p><p>it shows the 2 links whether im logged in or not</p>]]></description>
			<author><![CDATA[null@example.com (raptrex)]]></author>
			<pubDate>Tue, 27 Dec 2005 15:00:57 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/59306/#p59306</guid>
		</item>
		<item>
			<title><![CDATA[Re: require user to be logged in to view directory]]></title>
			<link>https://punbb.informer.com/forums/post/59304/#p59304</link>
			<description><![CDATA[<p>You need to call the function before anything will happen.</p><div class="codebox"><pre><code>login_menu();</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Nibbler(cpg))]]></author>
			<pubDate>Tue, 27 Dec 2005 10:39:48 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/59304/#p59304</guid>
		</item>
		<item>
			<title><![CDATA[require user to be logged in to view directory]]></title>
			<link>https://punbb.informer.com/forums/post/59293/#p59293</link>
			<description><![CDATA[<div class="codebox"><pre><code>&lt;?php
define(&#039;PUN_ROOT&#039;, &#039;./forums/&#039;);
include &#039;forums/include/common.php&#039;;

function login_menu() {
global $pun_user;

function directory($result) {  
     
     $handle=opendir(&quot;./files&quot;);  
     while ($file = readdir($handle)) {  
     if ($file == &quot;.&quot; || $file == &quot;..&quot; || $file == &quot;index.php&quot;) { } else { print &quot;&lt;a href=$file&gt;$file&lt;/a&gt;&lt;br&gt;\n&quot;; } 
       
     }  
     closedir($handle);  

return $result;  
}  

if ($pun_user[&#039;is_guest&#039;]) {
  echo &quot;&lt;br /&gt;Please &lt;a href=\&quot;http://animelink.be/forums/register.php\&quot;&gt;Register Here&lt;/a&gt; or &lt;a href=\&quot;http://animelink.be/forums/login.php\&quot;&gt;Login Here&lt;/a&gt;&lt;br /&gt;&quot;;
    }
else {
echo &quot;&lt;b&gt;Manga Downloader&lt;/b&gt;&lt;p&gt;&quot;;
echo directory($result);
echo &quot;&lt;p&gt;&lt;a href=\&quot;http://localhost/pantasia\&quot;&gt;Go Back To Pantasia&lt;/a&gt;&quot;;
}
}
?&gt;</code></pre></div><p>what this is suppose to do is, when the user is logged in, he can see the files in the directory<br />when the user is NOT logged in, he sees links to register and log in</p><p>i dont get any errors <br />but all i see is a blank screen<br />when im logged in and when im not logged in</p><p>i called it &quot;file.php&quot; and its like this in my directory:</p><p>file.php<br />/forums/&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;-punbb directory</p><p>can someone fix this?</p>]]></description>
			<author><![CDATA[null@example.com (raptrex)]]></author>
			<pubDate>Tue, 27 Dec 2005 03:09:24 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/59293/#p59293</guid>
		</item>
	</channel>
</rss>
