NYCPHP Meetup

[nycphp-talk] Single-Logon User Authentication, PHP and viewingnon-ASCII

Phil Powell soazine at erols.com
Mon Aug 18 15:51:16 EDT 2003


I have that already:

if (!($dirID = opendir($ACTUAL_STARTPATH . '/content/')) && $hasCookie) {
   $html .= $font . '<font color=cc0000><li>Could not open files in content
folder</li></font></font><p>';
  } else if ($hasCookie) {

   clearstatcache(); // CLEAR THE STATUS CACHE FOR is_file() TO PROPERLY
DETERMINE FILE STATUS
   $html .= $font . 'Contents: <p>';
   while (($file = readdir($dirID)) !== false) {
    if (is_file($file) || !preg_match('/^\./', $file)) {
     $html .= "\n<br><a href=/content/" . substr($file, strrpos('/', $file),
strlen($file)) .
              '>' . substr($file, strrpos('/', $file), strlen($file)) .
"</a><p>\n";
    }
   }
  }

However, this only works if the directory has permissions of at least 755
and each file at 777.  But that's not what the client wants, he wants it to
be set to permissions that the "outside world" can't view unless they log in
and are authenticated beforehand.

Phil
----- Original Message ----- 
From: "Chris Snyder" <csnyder at chxo.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Monday, August 18, 2003 3:33 PM
Subject: Re: [nycphp-talk] Single-Logon User Authentication, PHP and
viewingnon-ASCII


> Check out the directory() functions.
>
>
> Phil Powell wrote:
>
> >I looked up fpassthru online and how to set the headers.  Your solution
> >sounds fine for hopefully viewing a single file, but how about producing
a
> >list of files for display?
> >
> >Thanx
> >Phil
> >
> >
> >
> >
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk




More information about the talk mailing list