note 71742 added to function.opendir
| From: | phpguy at mailstop dot yogelements dot omitme dot com | Date: | Wed, 13 Dec 2006 21:40:51 +0000 |
| Subject: | note 71742 added to function.opendir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120592@lists.php.net to get a copy of this message | ||
An issue that I ran into is that opendir() could care less if you've got server authentication
set on sub directories and so any such authentication is bypassed completely when accesses in this
way. I did solve it for my application of a pretty file manager, by redirecting to all sub
directories thusly:
$fdir = "./subdirectory_I_want_to_visit/";
if ($fdir != './') { //basically where we are or the parent
//redirect the browser to force authentication check on any subdirectories
header("Location: http://my.domain.com".dirname($_SERVER["PHP_SELF"]).substr($fdir,2));
exit;
} else {
$dir = opendir($fdir);
}
----
Server IP: 216.194.113.175
Probable Submitter: 68.104.0.227
----
Manual Page -- http://www.php.net/manual/en/function.opendir.php
Edit -- https://master.php.net/note/edit/71742
Del: integrated -- https://master.php.net/note/delete/71742/integrated
Del: useless -- https://master.php.net/note/delete/71742/useless
Del: bad code -- https://master.php.net/note/delete/71742/bad+code
Del: spam -- https://master.php.net/note/delete/71742/spam
Del: non-english -- https://master.php.net/note/delete/71742/non-english
Del: in docs -- https://master.php.net/note/delete/71742/in+docs
Del: other reasons-- https://master.php.net/note/delete/71742
Reject -- https://master.php.net/note/reject/71742
Search -- https://master.php.net/manage/user-notes.php