BaseUser.ifPasswordHashMatches ( Requestable requestInstance  )  [inherited]

Checks if supplied password hash in request matches with the stored in database.

Parameters:
$requestInstance A requestable class instance
Returns:
$matches Wether the supplied password hash matches

Definition at line 222 of file class_BaseUser.php.

References BaseFrameworkSystem.$resultInstance, ObjectFactory.createObjectByConfiguredName(), UserDatabaseWrapper.DB_COLUMN_USERID, UserDatabaseWrapper.DB_COLUMN_USERNAME, Requestable.getRequestElement(), BaseFrameworkSystem.getResultInstance(), BaseUser.getUserName(), and BaseFrameworkSystem.setResultInstance().

00222                                                                              {
00223                 // By default nothing matches... ;)
00224                 $matches = false;
00225 
00226                 // Is a previous result there?
00227                 if (is_null($this->getResultInstance())) {
00228                         // Get a UserDatabaseWrapper instance
00229                         $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
00230 
00231                         // Create a search criteria
00232                         $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
00233 
00234                         // Add the username as a criteria and set limit to one entry
00235                         $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
00236                         $criteriaInstance->setLimit(1);
00237 
00238                         // Get a search result
00239                         $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
00240 
00241                         // Set the index "solver"
00242                         $resultInstance->solveResultIndex(UserDatabaseWrapper::DB_COLUMN_USERID, $wrapperInstance, array($this, 'setUserId'));
00243 
00244                         // And finally set it
00245                         $this->setResultInstance($resultInstance);
00246                 } // END - if
00247 
00248                 // Rewind it
00249                 $this->getResultInstance()->rewind();
00250 
00251                 // Search for it
00252                 if ($this->getResultInstance()->find('pass_hash')) {
00253                         // So does the hashes match?
00254                         //* DEBUG: */ echo $requestInstance->getRequestElement('pass_hash')."/".$entry['pass_hash'];
00255                         $matches = ($requestInstance->getRequestElement('pass_hash') === $this->getResultInstance()->getFoundValue());
00256                 } // END - if
00257 
00258                 // Return the status
00259                 return $matches;
00260         }

Here is the call graph for this function:


Generated on Mon Dec 8 01:18:27 2008 for Ship-Simulator by  doxygen 1.5.6