Hey b1randon, is it possible that you throw me an example. I understand the concept of what your saying but don't have a clue the process for implementation.
Oh gosh.. ok.. I don't have access to PHP right now and writing this kind of thing is rather lengthy so excuse the mistakes and brevity but here's the basics:
base class:
[PHP]
class Page {
var $content = "";
function write() {
echo $this->content;
}
function security(){
var $auth = check here();
if (!auth)
die("unauthorized");
}
//this guy here is the constructor
function Page(){
//these functions will be run when you instantiate the class
$this->security();
//if security didn't die it'll write
$this->write();
}
}
[/PHP]
here's a given page unsecured:
[PHP]
class WelcomePage extends Page {
var $content = "Welcome!";
function security() {
//Overloaded so everyone gets in!
}
}
[/PHP]
here's a secure one:
[PHP]
class SecurePage extends Page {
var $content = "Welcome to the secured page!";
//security was checked b/c parent security method was run
}
[/PHP]
Again, no access to PHP so I know that needs to be cleaned up and implemented and stuff, but that should illustrate the concept for ya.