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..

day with SWT (Standard Widget Toolkit)

Yeap i was never happy with Swing or AWT… they are abstract system for Java UI implementation…. They are resource hungry by default… and less productive for complex UI because they requires more memory…. much reason why Java UI could not attract my attention… don’t know may be my fault….

By the way when i get to know about SWT i really surprised because of my need.. I dont need anything more except the current OS native widgets… and SWT is faster than Swing/AWT and It provides many build in feature like System Tray, System Modal.. Widget for Mobile.. etc….

SWT could not perform well with big List because it first copy all data in Java object and copy again in Native object… so it takes some time…. But it’s really cool and it’s cooler when I use GCJ to compile my Java application to native binary….

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

cast ur vote!

More Photos
Follow

Get every new post delivered to your Inbox.