class_UserNameIsGuestFilter.php

Go to the documentation of this file.
00001 <?php
00025 class UserNameIsGuestFilter extends BaseFilter implements Filterable {
00031         protected function __construct () {
00032                 // Call parent constructor
00033                 parent::__construct(__CLASS__);
00034         }
00035 
00041         public final static function createUserNameIsGuestFilter () {
00042                 // Get a new instance
00043                 $filterInstance = new UserNameIsGuestFilter();
00044 
00045                 // Return the instance
00046                 return $filterInstance;
00047         }
00048 
00056         public function execute (Requestable $requestInstance, Responseable $responseInstance) {
00057                 // Get username from request
00058                 $userName = $requestInstance->getRequestElement('username');
00059 
00060                 // Does the user name match the guest login?
00061                 if ($userName == $this->getConfigInstance()->readConfig('guest_login_user')) {
00062                         // Then set the password to the configured password
00063                         $requestInstance->setRequestElement('pass1', $this->getConfigInstance()->readConfig('guest_login_passwd'));
00064                         $requestInstance->setRequestElement('pass2', $this->getConfigInstance()->readConfig('guest_login_passwd'));
00065                 } // END - if
00066         }
00067 }
00068 
00069 // [EOF]
00070 ?>

Generated on Mon Dec 8 01:06:45 2008 for Ship-Simulator by  doxygen 1.5.6