FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Nested PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Nested PHP [message #185318 is a reply to message #185317] Mon, 17 March 2014 23:31 Go to previous messageGo to previous message
Christoph Michael Bec is currently offline  Christoph Michael Bec
Messages: 207
Registered: June 2013
Karma:
Senior Member
The Natural Philosopher wrote:

> Consider the problem
>
> I have page called /aby/xyz that I want accessible to one user and
> totalluy invisible to another.
>
> At best htaccess makes it tricky and says 'not allowed' it wont ever say
> 'page doesn't exist'.
>
> My users already live in a proper relational database.What is easier
> than to write a slender shim that intercepts all access to the web
> server, analyses them and decides who they are and what they can then
> access? Using tables of privilege, proriory and area to give a
> multidimensional; matrix of access. And the ability to return 'access
> denied' or 'page not found' under my control if they try and access
> something I don't want them to?

Why not deploying the page controller pattern?

...
<?php
analyzeHit();
if (!userAuthorizedToViewThisPage()) {
header('HTTP/1.0 403 Forbidden');
exit;
}
?>
<!DOCTYPE html>
...

A front controller may be preferable (and it seems you're using
something like that), but that also doesn't require to store PHP code in
a database.

Actually, requiring authorization for delivering certain content is
quite common, but I doubt that there are (m)any sites storing PHP code
in a database for that reason. The only reason I can see for storing
PHP code in a DB, is to cater for user submitted code, what may be
useful for e.g. CMSs.

--
Christoph M. Becker
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Filling an array with random input doesn't quite work
Next Topic: string length
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 01:06:54 GMT 2024

Total time taken to generate the page: 0.04195 seconds