From 4c35e8280767c1e33832097060e39a32b80ffd01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 21 Jun 2008 17:15:22 +0000 Subject: [PATCH] Class/method doc-tags fixed --- .../main/actions/class_ShipSimuLoginAction.php | 2 +- .../web/class_WebShipsimuGuestLoginCommand.php | 3 ++- .../commands/web/class_WebShipsimuProfileCommand.php | 11 ++++++++++- .../commands/web/class_WebShipsimuRegisterCommand.php | 2 +- .../web/class_WebShipsimuUserLoginCommand.php | 3 ++- .../ship-simu/main/login/class_ShipSimuUserLogin.php | 7 ++++--- .../main/commands/web/class_WebLoginAreaCommand.php | 2 +- .../controller/default/class_WebLoginController.php | 2 +- .../database/databases/class_LocalFileDatabase.php | 2 +- .../main/filter/news/class_NewsProcessFilter.php | 2 +- .../main/filter/update/class_UserUpdateFilter.php | 3 +-- inc/classes/main/helper/web/class_WebFormHelper.php | 4 ++-- inc/classes/main/response/class_HttpResponse.php | 8 ++++---- inc/classes/main/rng/class_RandomNumberGenerator.php | 4 ++-- inc/classes/main/template/class_TemplateEngine.php | 4 ++-- 15 files changed, 35 insertions(+), 24 deletions(-) diff --git a/application/ship-simu/main/actions/class_ShipSimuLoginAction.php b/application/ship-simu/main/actions/class_ShipSimuLoginAction.php index 2e06ecc..d019a3b 100644 --- a/application/ship-simu/main/actions/class_ShipSimuLoginAction.php +++ b/application/ship-simu/main/actions/class_ShipSimuLoginAction.php @@ -57,9 +57,9 @@ class ShipSimuLoginAction extends BaseAction implements PerformableAction { * @param $requestInstance An instance of a class with an Requestable interface * @param $responseInstance An instance of a class with an Responseable interface * @return void + * @todo Maybe we need to do something later here */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { - /* @todo Maybe we need to do something later here */ } } diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php index e244d1e..9d747de 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php @@ -100,6 +100,7 @@ class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable { * @param $controllerInstance A controller instance * @param $requestInstance An instance of a class with an Requestable interface * @return void + * @todo Add more filters */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Which login type do we have? @@ -117,7 +118,7 @@ class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable { break; } - /* @todo Add more filters */ + // Add password verifier filter $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_class')); } } diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php index 72ad467..107d093 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php @@ -122,16 +122,25 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable { * @param $controllerInstance A controller instance * @param $requestInstance An instance of a class with an Requestable interface * @return void + * @todo Add some more pre/post filters to the controller */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add user auth filter (we don't need an update of the user here because it will be redirected) $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_class')); - /* @todo Add some more pre/post filters to the controller */ + // User status filter $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class')); + + // Updated rules accepted $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class')); + + // Account password validation $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_class')); + + // Email changed $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_class')); + + // Password changed $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_class')); } } diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php index d671f8b..b7c240f 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php @@ -97,9 +97,9 @@ class WebShipsimuRegisterCommand extends BaseCommand implements Commandable { * @param $controllerInstance A controller instance * @param $requestInstance An instance of a class with an Requestable interface * @return void + * @todo Add some more pre/post filters to the controller */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - /* @todo Add some more pre/post filters to the controller */ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_class')); $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_class')); $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_class')); diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php index 855f62c..a1f4c10 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php @@ -100,6 +100,7 @@ class WebShipsimuUserLoginCommand extends BaseCommand implements Commandable { * @param $controllerInstance A controller instance * @param $requestInstance An instance of a class with an Requestable interface * @return void + * @todo Add more filters */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Which login type do we have? @@ -117,7 +118,7 @@ class WebShipsimuUserLoginCommand extends BaseCommand implements Commandable { break; } - /* @todo Add more filters */ + // Password verifier filter $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_class')); } } diff --git a/application/ship-simu/main/login/class_ShipSimuUserLogin.php b/application/ship-simu/main/login/class_ShipSimuUserLogin.php index 64aeaff..1e094cb 100644 --- a/application/ship-simu/main/login/class_ShipSimuUserLogin.php +++ b/application/ship-simu/main/login/class_ShipSimuUserLogin.php @@ -74,6 +74,9 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { * User class * @throws UserPasswordMismatchException If the supplied password did not * match with the stored password + * @todo We need to add something here which will make more than one + * @todo guest logins, users who are online but based on the same + * @todo user account. */ public function doLogin (Requestable $requestInstance, Responseable $responseInstance) { // By default no method is selected @@ -118,9 +121,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { throw new UserPasswordMismatchException(array($this, $userInstance), User::EXCEPTION_USER_PASS_MISMATCH); } // END - if - /* @todo We need to add something here which will make more than one */ - /* @todo guest logins, users who are online but based on the same */ - /* @todo user account. */ + // ToDo place // Now do the real login. This can be cookie- or session-based login // which depends on the admins setting then on the user's taste. diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php index c6bb772..148b72a 100644 --- a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php @@ -70,9 +70,9 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { * Prepares some general data which shall be displayed on every page * * @return void + * @todo Add some stuff here: Some personal data, app/game related data */ protected function prepareCommand () { - /* @todo Add some stuff here: Some personal data, app/game related data */ } /** diff --git a/inc/classes/main/controller/default/class_WebLoginController.php b/inc/classes/main/controller/default/class_WebLoginController.php index 09a0115..95a984a 100644 --- a/inc/classes/main/controller/default/class_WebLoginController.php +++ b/inc/classes/main/controller/default/class_WebLoginController.php @@ -44,6 +44,7 @@ class WebLoginController extends BaseController implements Controller { * * @param $resolverInstance An instance of a command resolver class * @return $controllerInstance A prepared instance of this class + * @todo Add some filters to this controller */ public final static function createWebLoginController (CommandResolver $resolverInstance) { // Create the instance @@ -52,7 +53,6 @@ class WebLoginController extends BaseController implements Controller { // Set the command resolver $controllerInstance->setResolverInstance($resolverInstance); - /* @todo Add some filters to this controller */ // Return the prepared instance return $controllerInstance; diff --git a/inc/classes/main/database/databases/class_LocalFileDatabase.php b/inc/classes/main/database/databases/class_LocalFileDatabase.php index d7a579a..b3ee46e 100644 --- a/inc/classes/main/database/databases/class_LocalFileDatabase.php +++ b/inc/classes/main/database/databases/class_LocalFileDatabase.php @@ -353,9 +353,9 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend * Makes sure that the database connection is alive * * @return void + * @todo Do some checks on the database directory and files here */ public function connectToDatabase () { - /* @todo Do some checks on the database directory and files here */ } /** diff --git a/inc/classes/main/filter/news/class_NewsProcessFilter.php b/inc/classes/main/filter/news/class_NewsProcessFilter.php index 1f468fe..8fc5409 100644 --- a/inc/classes/main/filter/news/class_NewsProcessFilter.php +++ b/inc/classes/main/filter/news/class_NewsProcessFilter.php @@ -58,9 +58,9 @@ class NewsProcessFilter extends BaseFilter implements Filterable { * @param $requestInstance An instance of a class with an Requestable interface * @param $responseInstance An instance of a class with an Responseable interface * @return void + * @todo Unfinished stub, add functionality here */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { - /* @todo Unfinished stub, add functionality here */ } } diff --git a/inc/classes/main/filter/update/class_UserUpdateFilter.php b/inc/classes/main/filter/update/class_UserUpdateFilter.php index 47eee38..ac0d8a1 100644 --- a/inc/classes/main/filter/update/class_UserUpdateFilter.php +++ b/inc/classes/main/filter/update/class_UserUpdateFilter.php @@ -62,6 +62,7 @@ class UserUpdateFilter extends BaseFrameworkSystem implements Filterable { * @param $requestInstance An instance of a class with an Requestable interface * @param $responseInstance An instance of a class with an Responseable interface * @return void + * @todo Add more user updates here */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Get user instance from registry @@ -74,8 +75,6 @@ class UserUpdateFilter extends BaseFrameworkSystem implements Filterable { $authInstance = Registry::getRegistry()->getInstance('auth'); $authInstance->updateAuthData(); - /* @todo Add more user updates here */ - // Write all updates to the database $userInstance->flushUpdates(); } diff --git a/inc/classes/main/helper/web/class_WebFormHelper.php b/inc/classes/main/helper/web/class_WebFormHelper.php index 79de813..c8c7448 100644 --- a/inc/classes/main/helper/web/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/class_WebFormHelper.php @@ -128,6 +128,7 @@ class WebFormHelper extends BaseHelper { * @param $formId Id of the form (attribute "id"; default: false) * @return void * @throws InvalidFormNameException If the form name is invalid (=false) + * @todo Add some unique PIN here to bypass problems with some browser and/or extensions */ public function addFormTag ($formName = false, $formId = false) { // When the form is not yet opened at least form name must be valid @@ -174,7 +175,6 @@ class WebFormHelper extends BaseHelper { $this->addFormGroup("", ""); } // END - if - /* @todo Add some unique PIN here to bypass problems with some browser and/or extensions */ // Simply close it $this->formOpened = false; } @@ -659,9 +659,9 @@ class WebFormHelper extends BaseHelper { * Checks wether the rules has been updated * * @return $rulesUpdated Wether rules has been updated + * @todo Implement check if rules have been changed */ public function ifRulesHaveChanged () { - /* @todo Implement check if rules have been changed */ return false; } diff --git a/inc/classes/main/response/class_HttpResponse.php b/inc/classes/main/response/class_HttpResponse.php index deff1a8..46979c7 100644 --- a/inc/classes/main/response/class_HttpResponse.php +++ b/inc/classes/main/response/class_HttpResponse.php @@ -246,6 +246,10 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { * @param $expires Timestamp of expiration (default: configured) * @return void * @throws ResponseHeadersAlreadySentException If headers are already sent + * @todo Encryption of cookie data not yet supported. + * @todo Why are these parameters conflicting? + * @todo If the return statement is removed and setcookie() commented out, + * @todo this will send only one cookie out, the first one. */ public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) { // Are headers already sent? @@ -256,7 +260,6 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { // Shall we encrypt the cookie? if ($encrypted === true) { - /* @todo Encryption of cookie data not yet supported */ } // END - if // For slow browsers set the cookie array element first @@ -271,15 +274,12 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { $domain = $this->getConfigInstance()->readConfig('cookie_domain'); setcookie($cookieName, $cookieValue, $expires); - /* @todo Why are these parameters conflicting? */ //, $path, $domain, (isset($_SERVER['HTTPS'])) return; - /* @todo This will send only one cookie out, the first one. */ // Now construct the full header $cookieString = $cookieName . "=" . $cookieValue . "; "; $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT"; - /* @todo Why are these parameters conflicting? */ // $cookieString .= "; path=".$path."; domain=".$domain; // Set the cookie as a header diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index 5decb85..9177393 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -88,6 +88,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { * Initializes the random number generator * * @return void + * @todo Add site key for stronger salt! */ protected function initRng () { // Seed mt_rand() @@ -113,7 +114,6 @@ class RandomNumberGenerator extends BaseFrameworkSystem { $this->fixedSalt = sha1($serverIp . ":" . serialize($this->getDatabaseInstance()->getConnectionData())); // One-way data we need for "extra-salting" the random number - /* @todo Add site key for stronger salt! */ $this->extraSalt = sha1($this->fixedSalt . ":" . getenv('SERVER_SOFTWARE') . ":" . $this->getConfigInstance()->readConfig('date_key')); // Get config entry for max salt length @@ -149,9 +149,9 @@ class RandomNumberGenerator extends BaseFrameworkSystem { * @param $min Min value to generate * @param $max Max value to generate * @return $num Pseudo-random number + * @todo I had a better random number generator here but now it is somewhere lost :( */ public function randomNumnber ($min, $max) { - /* @todo I had a better random number generator here but now it is somewhere lost :( */ return mt_rand($min, $max); } diff --git a/inc/classes/main/template/class_TemplateEngine.php b/inc/classes/main/template/class_TemplateEngine.php index f2e78db..23ac8b4 100644 --- a/inc/classes/main/template/class_TemplateEngine.php +++ b/inc/classes/main/template/class_TemplateEngine.php @@ -771,6 +771,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate * * @param $varMatches An array full of variable/value pairs. * @return void + * @todo Unfinished work or don't die here. */ private function assignAllVariables (array $varMatches) { // Search for all variables @@ -788,7 +789,6 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate $this->assignVariable($var, $varMatches[3][$key]); } elseif (!empty($varMatches[2][$key])) { // Non-string found so we need some deeper analysis... - /* @todo Unfinished work or don't die here. */ die("Deeper analysis not yet implemented!"); } @@ -952,6 +952,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate * Compile all variables by inserting their respective values * * @return void + * @todo Make this code some nicer... */ public final function compileVariables () { // Initialize the $content array @@ -992,7 +993,6 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate ); // This loop does remove the backslashes (\) in PHP parameters - /* @todo Make this some nicer... */ while (strpos($eval, "