Password protected secure web application with design patterns

Probably you want to develop password protected web application using PHP…

Make a php driven web site with FrontController approach….

I think FrontController pattern has good solution for this type of problem…

If you follow Front Controller pattern u can easily restrict any pages
from your centralize controller….
for more reading
http://www.phppatterns.com/index.php/article/articleview/81/1/1/

let’s see how Front Controller will work with your user security

public interface PHPFrontController extends BaseController {
// .....
public function isAccessible();
public function getCurrentView();
// .....
}

etc…. you can fun…..

for instance while your index.php is running…
it will cosider:

// Singleton pattern
$frontController=PHPFrontController::newInstance();

// check valid user….
if($frontController->isAccessible()) {
View::generateView(View::HTML, $frontController->getCurrentView());
}

……..

For more details information…

// example implementation of accessible method....
public function isAccessible() {
$state=false;

try {
// you can check through your DAO
if($userDAO->isValideUser(
HttpRequest::getParam(
array(“txtUser”,”txtPassword”))))
$state=true;

}
catch($frameworkException ) {}

return $state;
}

Thank you..

Advertisement

3 responses to “Password protected secure web application with design patterns

  1. the man is blogging again, and smiling, and coding! great. nearly thought we had done something wrong to this bright young talent. so glad to see you in full swing, and also that you are visiting wonderland daily, in office time!

  2. Administrator

    Yea backed to my real world…

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

my tweets

 

August 2005
S S M T W T F
« Jul   Sep »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Flickr Photos



@kamalapur over bridge

@kamalapur station

cox's bazaar trip oct 09

cox's bazaar trip oct 09

More Photos
Follow

Get every new post delivered to your Inbox.