From 798a70658a7e399c4d349cd3a58f48b585d25aaa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 1 Jun 2008 11:06:03 +0000 Subject: [PATCH] Fixed check of username --- .../commands/web/class_WebShipsimuRegisterCommand.php | 2 +- .../main/io/class_FrameworkDirectoryPointer.php | 10 +++++----- inc/classes/main/user/class_User.php | 8 ++++---- inc/config.php | 3 +++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php index 86b9526..3680159 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php @@ -59,7 +59,7 @@ class WebShipsimuRegisterCommand extends BaseCommand implements Commandable { $controllerInstance = $resolverInstance->getControllerInstance(); // @TODO Add some more pre/post filters to the controller - $controllerInstance->addPreFilter(ObjectFactory::createObjectByName('UserNameValidatorFilter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator')); // Return the prepared instance return $commandInstance; diff --git a/inc/classes/main/io/class_FrameworkDirectoryPointer.php b/inc/classes/main/io/class_FrameworkDirectoryPointer.php index 7ce3c4e..f0f2dd8 100644 --- a/inc/classes/main/io/class_FrameworkDirectoryPointer.php +++ b/inc/classes/main/io/class_FrameworkDirectoryPointer.php @@ -67,11 +67,11 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem { * Create a directory pointer based on the given path. The path will also * be verified here. * - * @param $pathName The path name we shall pass + * @param $pathName The path name we shall pass * to opendir() - * @param $inConstructor If we are in de/con-structor + * @param $inConstructor If we are in de/con-structor * or from somewhere else - * @throws PathIsEmptyException If the provided path name + * @throws PathIsEmptyException If the provided path name * is empty * @throws InvalidPathStringException If the provided path name is * not a string @@ -79,9 +79,9 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem { * not valid * @throws PathReadProtectedException If the provided path name is * read-protected - * @throws DirPointerNotOpened If opendir() returns not a + * @throws DirPointerNotOpened If opendir() returns not a * directory resource - * @return $pointerInstance A prepared instance of + * @return $pointerInstance A prepared instance of * FrameworkDirectoryPointer */ public final static function createFrameworkDirectoryPointer ($pathName, $inConstructor = false) { diff --git a/inc/classes/main/user/class_User.php b/inc/classes/main/user/class_User.php index 280adec..ad4498c 100644 --- a/inc/classes/main/user/class_User.php +++ b/inc/classes/main/user/class_User.php @@ -121,10 +121,10 @@ class User extends BaseFrameworkSystem implements ManageableUser { $result = $wrapperInstance->doSelectByCriteria($criteriaInstance); // Search for it - if ($result->next()) { - // Entry found, so all is fine - $exists = true; - } + if (!$result->next()) { + // Entry not found + $exists = false; + } // END - if // Return the status return $exists; diff --git a/inc/config.php b/inc/config.php index e918a66..835e34e 100644 --- a/inc/config.php +++ b/inc/config.php @@ -162,5 +162,8 @@ $cfg->setConfigEntry('file_input_stream', "FileIoStream"); // CFG: FILE-OUTPUT-STREAM $cfg->setConfigEntry('file_output_stream', "FileIoStream"); +// CFG: USERNAME-VALIDATOR +$cfg->setConfigEntry('username_validator', "UserNameValidatorFilter"); + // [EOF] ?> -- 2.39.5