From abb8bf6be9f5238f8a4552707bcb190f0dbf0b7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 5 Oct 2008 18:28:05 +0000 Subject: [PATCH] Payment introduced, minor rewrites - Payment system introduced (not finished) - Refill page prepared for payment system - Methods addCriteria() first parameter is now in ", not in ' - Minor improvements --- .gitattributes | 11 ++ application/blog/config.php | 26 +-- application/ship-simu/config.php | 20 ++- .../web/class_WebLoginRefillAction.php | 5 +- .../web/class_WebRefillFormCommand.php | 9 ++ .../goverment/class_SimplifiedGoverment.php | 4 +- .../class_ShipSimuRegistration.php | 2 +- .../user/extended/class_ShipSimuMember.php | 4 +- .../wrapper/class_CompanyDatabaseWrapper.php | 2 +- .../de/code/action_login_profile.ctp | 2 +- .../templates/de/code/action_login_refill.ctp | 10 +- application/shoutbox/config.php | 26 +-- application/todo/config.php | 26 +-- db/payments/.htaccess | 1 + inc/classes/interfaces/discovery/.htaccess | 1 + .../discovery/class_Discoverable.php | 35 ++++ .../main/class_BaseFrameworkSystem.php | 4 +- .../main/controller/class_BaseController.php | 31 ++-- .../wrapper/class_PaymentsDatabaseWrapper.php | 59 +++++++ .../main/debug/class_DebugConsoleOutput.php | 2 +- .../main/debug/class_DebugWebOutput.php | 2 +- inc/classes/main/discovery/.htaccess | 1 + inc/classes/main/discovery/class_ | 66 ++++++++ .../main/discovery/class_BaseDiscovery.php | 66 ++++++++ inc/classes/main/discovery/payment/.htaccess | 1 + .../payment/class_LocalPaymentDiscovery.php | 83 ++++++++++ inc/classes/main/filter/payment/.htaccess | 1 + .../payment/class_PaymentDiscoveryFilter.php | 153 ++++++++++++++++++ .../helper/web/forms/class_WebFormHelper.php | 3 +- .../main/output/class_ConsoleOutput.php | 2 +- inc/classes/main/output/class_WebOutput.php | 2 +- inc/classes/main/points/class_UserPoints.php | 2 +- .../main/reader/class_DefaultNewsReader.php | 2 +- .../action/class_BaseActionResolver.php | 2 +- .../main/response/class_BaseResponse.php | 11 ++ inc/classes/main/user/member/class_Member.php | 4 +- 36 files changed, 603 insertions(+), 78 deletions(-) create mode 100644 db/payments/.htaccess create mode 100644 inc/classes/interfaces/discovery/.htaccess create mode 100644 inc/classes/interfaces/discovery/class_Discoverable.php create mode 100644 inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php create mode 100644 inc/classes/main/discovery/.htaccess create mode 100644 inc/classes/main/discovery/class_ create mode 100644 inc/classes/main/discovery/class_BaseDiscovery.php create mode 100644 inc/classes/main/discovery/payment/.htaccess create mode 100644 inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php create mode 100644 inc/classes/main/filter/payment/.htaccess create mode 100644 inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php diff --git a/.gitattributes b/.gitattributes index e57ab49..fb12de8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -327,6 +327,7 @@ db/.htaccess -text db/company_user/.htaccess -text db/gov_user/.htaccess -text db/news/.htaccess -text +db/payments/.htaccess -text db/user/.htaccess -text db/user_points/.htaccess -text devel/.htaccess -text @@ -485,6 +486,8 @@ inc/classes/interfaces/database/middleware/.htaccess -text inc/classes/interfaces/database/middleware/class_DatabaseConnector.php -text inc/classes/interfaces/debug/.htaccess -text inc/classes/interfaces/debug/class_Debugger.php -text +inc/classes/interfaces/discovery/.htaccess -text +inc/classes/interfaces/discovery/class_Discoverable.php -text inc/classes/interfaces/filter/.htaccess -text inc/classes/interfaces/filter/class_Filterable.php -text inc/classes/interfaces/helper/.htaccess -text @@ -609,12 +612,18 @@ inc/classes/main/database/databases/.htaccess -text inc/classes/main/database/databases/class_LocalFileDatabase.php -text inc/classes/main/database/wrapper/.htaccess -text inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php -text +inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php -text inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php -text inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php -text inc/classes/main/debug/.htaccess -text inc/classes/main/debug/class_DebugConsoleOutput.php -text inc/classes/main/debug/class_DebugErrorLogOutput.php -text inc/classes/main/debug/class_DebugWebOutput.php -text +inc/classes/main/discovery/.htaccess -text +inc/classes/main/discovery/class_ -text +inc/classes/main/discovery/class_BaseDiscovery.php -text +inc/classes/main/discovery/payment/.htaccess -text +inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php -text inc/classes/main/factories/.htaccess -text inc/classes/main/factories/cache/.htaccess -text inc/classes/main/factories/cache/class_CacheFactory.php -text @@ -645,6 +654,8 @@ inc/classes/main/filter/news/class_NewsDownloadFilter.php -text inc/classes/main/filter/news/class_NewsProcessFilter.php -text inc/classes/main/filter/null/.htaccess -text inc/classes/main/filter/null/class_NullFilter.php -text +inc/classes/main/filter/payment/.htaccess -text +inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php -text inc/classes/main/filter/update/.htaccess -text inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php -text inc/classes/main/filter/update/class_UserUpdateFilter.php -text diff --git a/application/blog/config.php b/application/blog/config.php index 2335879..a2900e6 100644 --- a/application/blog/config.php +++ b/application/blog/config.php @@ -74,13 +74,13 @@ $cfg->setConfigEntry('chat_enabled_aol', "Y"); $cfg->setConfigEntry('chat_enabled_msn', "Y"); // CFG: USER-REGISTRATION -$cfg->setConfigEntry('user_registration_class', "ShipSimuRegistration"); +$cfg->setConfigEntry('user_registration_class', "BlogRegistration"); // CFG: USER-LOGIN-CLASS -$cfg->setConfigEntry('user_login_class', "ShipSimuUserLogin"); +$cfg->setConfigEntry('user_login_class', "BlogUserLogin"); // CFG: GUEST-LOGIN-CLASS -$cfg->setConfigEntry('guest_login_class', "ShipSimuGuestLogin"); +$cfg->setConfigEntry('guest_login_class', "BlogGuestLogin"); // CFG: USER-STATUS-REGISTER $cfg->setConfigEntry('user_status_unconfirmed', "UNCONFIRMED"); @@ -92,7 +92,7 @@ $cfg->setConfigEntry('user_status_guest', "GUEST"); $cfg->setConfigEntry('user_status_confirmed', "CONFIRMED"); // CFG: LOGIN-HELPER-CLASS -$cfg->setConfigEntry('login_helper_class', "ShipSimuLoginHelper"); +$cfg->setConfigEntry('login_helper_class', "BlogLoginHelper"); // CFG: AUTH-METHOD-CLASS $cfg->setConfigEntry('auth_method_class', "CookieAuth"); @@ -191,21 +191,21 @@ $cfg->setConfigEntry('guest_login_user', "guest"); $cfg->setConfigEntry('guest_login_passwd', "guest"); // CFG: LOGIN-WELCOME-ACTION-CLASS -$cfg->setConfigEntry('login_welcome_action_class', "ShipSimuLoginAction"); +$cfg->setConfigEntry('login_welcome_action_class', "BlogLoginAction"); // CFG: LOGIN-LOGOUT-ACTION-CLASS -$cfg->setConfigEntry('login_logout_action_class', "ShipSimuLogoutAction"); +$cfg->setConfigEntry('login_logout_action_class', "BlogLogoutAction"); // CFG: LOGIN-PROFILE-ACTION-CLASS -$cfg->setConfigEntry('login_profile_action_class', "ShipSimuProfileAction"); +$cfg->setConfigEntry('login_profile_action_class', "BlogProfileAction"); -// CFG: SHIPSIMU-REGISTER-CAPTCHA +// CFG: BLOG-REGISTER-CAPTCHA $cfg->setConfigEntry('blog_register_captcha', "GraphicalCodeCaptcha"); -// CFG: blog-USER-LOGIN-CAPTCHA +// CFG: BLOG-USER-LOGIN-CAPTCHA $cfg->setConfigEntry('blog_user_login_captcha', "GraphicalCodeCaptcha"); -// CFG: blog-GUEST-LOGIN-CAPTCHA +// CFG: BLOG-GUEST-LOGIN-CAPTCHA $cfg->setConfigEntry('blog_guest_login_captcha', "GraphicalCodeCaptcha"); // CFG: CAPTCHA-STRING-LENGTH @@ -217,13 +217,13 @@ $cfg->setConfigEntry('captcha_search_chars', "+/="); // CFG: RANDOM-STRING-LENGTH $cfg->setConfigEntry('random_string_length', 100); -// CFG: blog-REGISTER-CAPTCHA-SECURED +// CFG: BLOG-REGISTER-CAPTCHA-SECURED $cfg->setConfigEntry('blog_register_captcha_secured', "Y"); -// CFG: blog-USER-LOGIN-CAPTCHA-SECURED +// CFG: BLOG-USER-LOGIN-CAPTCHA-SECURED $cfg->setConfigEntry('blog_user_login_captcha_secured', "Y"); -// CFG: blog-GUEST-LOGIN-CAPTCHA-SECURED +// CFG: BLOG-GUEST-LOGIN-CAPTCHA-SECURED $cfg->setConfigEntry('blog_guest_login_captcha_secured', "Y"); // CFG: BLOCK-SHOWS-REGISTRATION diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php index 6e60c09..0240453 100644 --- a/application/ship-simu/config.php +++ b/application/ship-simu/config.php @@ -160,12 +160,18 @@ $cfg->setConfigEntry('captcha_register_verifier_filter', "GraphicalCodeCaptchaVe // CFG: CAPTCHA-REFILL-VERFIER-FILTER $cfg->setConfigEntry('captcha_refill_verifier_filter', "GraphicalCodeCaptchaVerifierFilter"); -// CFG: CONFIRM-CODE-VALIDATOR-FILTER +// CFG: CONFIRM-CODE-VERIFIER-FILTER $cfg->setConfigEntry('confirm_code_verifier_filter', "ConfirmCodeVerifierFilter"); // CFG: REFILL-PAGE-FILTER $cfg->setConfigEntry('refill_page_filter', "RefillPageFilter"); +// CFG: REFILL-REQUEST-CURRENCY-BOOK-FILTER +$cfg->setConfigEntry('refill_request_currency_book_filter', "RefillRequestCurrencyBookFilter"); + +// CFG: PAYMENT-DISCOVERY-FILTER +$cfg->setConfigEntry('payment_discovery_filter', "PaymentDiscoveryFilter"); + // CFG: NEWS-HOME-LIMIT $cfg->setConfigEntry('news_home_limit', 10); @@ -253,16 +259,19 @@ $cfg->setConfigEntry('company_db_wrapper_class', "CompanyDatabaseWrapper"); // CFG: USER-POINTS-DB-WRAPPER-CLASS $cfg->setConfigEntry('user_points_db_wrapper_class', "UserPointsDatabaseWrapper"); -// CFG: USER-GOVERMENT-WRAPPER +// CFG: USER-GOVERMENT-WRAPPER-CLASS $cfg->setConfigEntry('user_gov_wrapper_class', "UserGovermentDatabaseWrapper"); +// CFG: PAYMENT-DB-WRAPPER-CLASS +$cfg->setConfigEntry('payment_db_wrapper_class', "PaymentsDatabaseWrapper"); + // CFG EMAIl-TPL-RESEND-LINK $cfg->setConfigEntry('email_tpl_resend_link', "text"); -// CFG: MAIL-TEMPLATE-ENGINE +// CFG: MAIL-TEMPLATE-CLASS $cfg->setConfigEntry('mail_template_class', "MailTemplateEngine"); -// CFG: IMAGE-TEMPLATE-ENGINE +// CFG: IMAGE-TEMPLATE-CLASS $cfg->setConfigEntry('image_template_class', "ImageTemplateEngine"); // CFG: ADMIN-EMAIL @@ -298,5 +307,8 @@ $cfg->setConfigEntry('refill_page_active', "Y"); // CFG: REFILL-PAGE-MIN-CURRENCY-AMOUNT $cfg->setConfigEntry('refill_page_min_currency_amount', 1000); +// CFG: LOGIN-FILL-PAYMENT-DISCOVERY +$cfg->setConfigEntry('login_refill_payment_discovery', "LocalPaymentDiscovery"); + // [EOF] ?> diff --git a/application/ship-simu/main/actions/web/class_WebLoginRefillAction.php b/application/ship-simu/main/actions/web/class_WebLoginRefillAction.php index 3120fac..77f18f5 100644 --- a/application/ship-simu/main/actions/web/class_WebLoginRefillAction.php +++ b/application/ship-simu/main/actions/web/class_WebLoginRefillAction.php @@ -55,7 +55,7 @@ class WebLoginRefillAction extends BaseAction implements Commandable, Registerab * @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 add fetching company list of current user here? + * @todo 0% done */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Unfinished method @@ -74,6 +74,9 @@ class WebLoginRefillAction extends BaseAction implements Commandable, Registerab // Is the refill page active? $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter')); + + // Add payment discovery filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('payment_discovery_filter', array($this))); } } diff --git a/application/ship-simu/main/commands/web/class_WebRefillFormCommand.php b/application/ship-simu/main/commands/web/class_WebRefillFormCommand.php index 25869cf..5cae379 100644 --- a/application/ship-simu/main/commands/web/class_WebRefillFormCommand.php +++ b/application/ship-simu/main/commands/web/class_WebRefillFormCommand.php @@ -82,11 +82,20 @@ class WebRefillFormCommand extends BaseCommand implements Commandable { // Is the refill page active? $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter')); + // Verify password + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); + // Verify CAPTCHA code $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter')); // Verify refill request $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter')); + + // Prepare a filter based on the requested type we shall refill + $filterName = sprintf("refill_request_%s_book_filter", $requestInstance->getRequestElement('type')); + + // Now, try to load that filter + $controllerInstance->addPostFilter(ObjectFactory::createObjectByConfiguredName($filterName)); } } diff --git a/application/ship-simu/main/goverment/class_SimplifiedGoverment.php b/application/ship-simu/main/goverment/class_SimplifiedGoverment.php index 0f0c4ca..ccdc373 100644 --- a/application/ship-simu/main/goverment/class_SimplifiedGoverment.php +++ b/application/ship-simu/main/goverment/class_SimplifiedGoverment.php @@ -69,8 +69,8 @@ class SimplifiedGoverment extends BaseFrameworkSystem implements Registerable { // Now get a search criteria and set the user's name as criteria $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - $criteriaInstance->addCriteria('gov_uid', $this->getUserInstance()->getUserName()); - $criteriaInstance->addCriteria('gov_activity_status', self::STATUS_STARTER_HELP); + $criteriaInstance->addCriteria("gov_uid", $this->getUserInstance()->getUserName()); + $criteriaInstance->addCriteria("gov_activity_status", self::STATUS_STARTER_HELP); $criteriaInstance->setLimit(1); // Get a wrapper instance diff --git a/application/ship-simu/main/registration/class_ShipSimuRegistration.php b/application/ship-simu/main/registration/class_ShipSimuRegistration.php index 31e6e63..1ad9731 100644 --- a/application/ship-simu/main/registration/class_ShipSimuRegistration.php +++ b/application/ship-simu/main/registration/class_ShipSimuRegistration.php @@ -187,7 +187,7 @@ class ShipSimuRegistration extends BaseRegistration { $criteriaInstance->addConfiguredCriteria(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $configEntry); // Include registration timestamp - $criteriaInstance->addCriteria('registered', date("Y-m-d H:i:s", time())); + $criteriaInstance->addCriteria("registered", date("Y-m-d H:i:s", time())); } } diff --git a/application/ship-simu/main/user/extended/class_ShipSimuMember.php b/application/ship-simu/main/user/extended/class_ShipSimuMember.php index acbdb62..f2caaa8 100644 --- a/application/ship-simu/main/user/extended/class_ShipSimuMember.php +++ b/application/ship-simu/main/user/extended/class_ShipSimuMember.php @@ -145,8 +145,8 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember { $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class'); // And add our both entries - $updateInstance->addCriteria('last_activity', date("Y-m-d H:i:s", time())); - $updateInstance->addCriteria('last_action', $lastAction); + $updateInstance->addCriteria("last_activity", date("Y-m-d H:i:s", time())); + $updateInstance->addCriteria("last_action", $lastAction); // Add the search criteria for searching for the right entry $updateInstance->setSearchInstance($searchInstance); diff --git a/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php b/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php index 752e409..ea221b9 100644 --- a/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php +++ b/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php @@ -78,7 +78,7 @@ class CompanyDatabaseWrapper extends BaseDatabaseWrapper { $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); // Add the user primary key as a search criteria - $criteriaInstance->addCriteria('participant_id', $userInstance->getPrimaryKey()); + $criteriaInstance->addCriteria("participant_id", $userInstance->getPrimaryKey()); $criteriaInstance->setLimit(1); // Set company->user table diff --git a/application/ship-simu/templates/de/code/action_login_profile.ctp b/application/ship-simu/templates/de/code/action_login_profile.ctp index 4d8f3dd..bb78982 100644 --- a/application/ship-simu/templates/de/code/action_login_profile.ctp +++ b/application/ship-simu/templates/de/code/action_login_profile.ctp @@ -106,7 +106,7 @@ if ($helper->ifRulesHaveChanged()) { // Ask again for current account password $helper->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Änderungen dein derzeitiges Passwort ein."); -$helper->addFieldText('pass_old', "Altes Passwort:"); +$helper->addFieldText('pass_old', "Derzeitiges Passwort:"); $helper->addInputPasswordField('pass_old'); // Abschliessender Hinweis und Abschluss des Formulars diff --git a/application/ship-simu/templates/de/code/action_login_refill.ctp b/application/ship-simu/templates/de/code/action_login_refill.ctp index b31d356..136794f 100644 --- a/application/ship-simu/templates/de/code/action_login_refill.ctp +++ b/application/ship-simu/templates/de/code/action_login_refill.ctp @@ -2,6 +2,9 @@ // Neue Helper-Instanz holen $helper = WebFormHelper::createWebFormHelper($this, 'refill_form'); +// Pre-fetch payment types +$helper->prefetchValueInstance('payments'); + // Add form group $helper->addFormGroup('refill_form', "Bitte wähle aus, was du nachbestellen willst und gebe die Menge an."); @@ -25,6 +28,11 @@ $helper->addInputSelectField('type', ""); $helper->addFormSubGroup('amount', "Gebe hier in ganzen Zahlen die Menge an, die du nachbestellen willst."); $helper->addInputTextField('amount', 1000); +// Ask again for current account password +$helper->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Nachbestellung dein derzeitiges Passwort ein."); +$helper->addFieldText('pass_old', "Derzeitiges Passwort:"); +$helper->addInputPasswordField('pass_old'); + // CAPTCHA enbaled? if ($helper->ifFormSecuredWithCaptcha()) { $helper->addFormGroup('captcha_refill', "Bitte wiederhole den angezeigten Code:"); @@ -32,7 +40,7 @@ if ($helper->ifFormSecuredWithCaptcha()) { } // END - if // Submit button -$helper->addFormGroup('buttons_refill', "Mit Absenden des Formulars wird deine Nachbestellung rechtskräftig!"); +$helper->addFormGroup('buttons_refill', "Mit Absenden des Formulars wird deine Nachbestellung verbindlich!"); $helper->addInputResetButton("Eingaben löschen"); $helper->addInputSubmitButton("Nachbestellung verbindlich aufgeben"); $helper->flushContent(); diff --git a/application/shoutbox/config.php b/application/shoutbox/config.php index fa898c0..c77e1a3 100644 --- a/application/shoutbox/config.php +++ b/application/shoutbox/config.php @@ -74,13 +74,13 @@ $cfg->setConfigEntry('chat_enabled_aol', "Y"); $cfg->setConfigEntry('chat_enabled_msn', "Y"); // CFG: USER-REGISTRATION -$cfg->setConfigEntry('user_registration_class', "ShipSimuRegistration"); +$cfg->setConfigEntry('user_registration_class', "ShoutBoxRegistration"); // CFG: USER-LOGIN-CLASS -$cfg->setConfigEntry('user_login_class', "ShipSimuUserLogin"); +$cfg->setConfigEntry('user_login_class', "ShoutBoxUserLogin"); // CFG: GUEST-LOGIN-CLASS -$cfg->setConfigEntry('guest_login_class', "ShipSimuGuestLogin"); +$cfg->setConfigEntry('guest_login_class', "ShoutBoxGuestLogin"); // CFG: USER-STATUS-REGISTER $cfg->setConfigEntry('user_status_unconfirmed', "UNCONFIRMED"); @@ -92,7 +92,7 @@ $cfg->setConfigEntry('user_status_guest', "GUEST"); $cfg->setConfigEntry('user_status_confirmed', "CONFIRMED"); // CFG: LOGIN-HELPER-CLASS -$cfg->setConfigEntry('login_helper_class', "ShipSimuLoginHelper"); +$cfg->setConfigEntry('login_helper_class', "ShoutBoxLoginHelper"); // CFG: AUTH-METHOD-CLASS $cfg->setConfigEntry('auth_method_class', "CookieAuth"); @@ -191,21 +191,21 @@ $cfg->setConfigEntry('guest_login_user', "guest"); $cfg->setConfigEntry('guest_login_passwd', "guest"); // CFG: LOGIN-WELCOME-ACTION-CLASS -$cfg->setConfigEntry('login_welcome_action_class', "ShipSimuLoginAction"); +$cfg->setConfigEntry('login_welcome_action_class', "ShoutBoxLoginAction"); // CFG: LOGIN-LOGOUT-ACTION-CLASS -$cfg->setConfigEntry('login_logout_action_class', "ShipSimuLogoutAction"); +$cfg->setConfigEntry('login_logout_action_class', "ShoutBoxLogoutAction"); // CFG: LOGIN-PROFILE-ACTION-CLASS -$cfg->setConfigEntry('login_profile_action_class', "ShipSimuProfileAction"); +$cfg->setConfigEntry('login_profile_action_class', "ShoutBoxProfileAction"); -// CFG: SHIPSIMU-REGISTER-CAPTCHA +// CFG: SHOUTBOX-REGISTER-CAPTCHA $cfg->setConfigEntry('shoutbox_register_captcha', "GraphicalCodeCaptcha"); -// CFG: shoutbox-USER-LOGIN-CAPTCHA +// CFG: SHOUTBOX-USER-LOGIN-CAPTCHA $cfg->setConfigEntry('shoutbox_user_login_captcha', "GraphicalCodeCaptcha"); -// CFG: shoutbox-GUEST-LOGIN-CAPTCHA +// CFG: SHOUTBOX-GUEST-LOGIN-CAPTCHA $cfg->setConfigEntry('shoutbox_guest_login_captcha', "GraphicalCodeCaptcha"); // CFG: CAPTCHA-STRING-LENGTH @@ -217,13 +217,13 @@ $cfg->setConfigEntry('captcha_search_chars', "+/="); // CFG: RANDOM-STRING-LENGTH $cfg->setConfigEntry('random_string_length', 100); -// CFG: shoutbox-REGISTER-CAPTCHA-SECURED +// CFG: SHOUTBOX-REGISTER-CAPTCHA-SECURED $cfg->setConfigEntry('shoutbox_register_captcha_secured', "Y"); -// CFG: shoutbox-USER-LOGIN-CAPTCHA-SECURED +// CFG: SHOUTBOX-USER-LOGIN-CAPTCHA-SECURED $cfg->setConfigEntry('shoutbox_user_login_captcha_secured', "Y"); -// CFG: shoutbox-GUEST-LOGIN-CAPTCHA-SECURED +// CFG: SHOUTBOX-GUEST-LOGIN-CAPTCHA-SECURED $cfg->setConfigEntry('shoutbox_guest_login_captcha_secured', "Y"); // CFG: BLOCK-SHOWS-REGISTRATION diff --git a/application/todo/config.php b/application/todo/config.php index fcbf389..02f9e7b 100644 --- a/application/todo/config.php +++ b/application/todo/config.php @@ -74,13 +74,13 @@ $cfg->setConfigEntry('chat_enabled_aol', "Y"); $cfg->setConfigEntry('chat_enabled_msn', "Y"); // CFG: USER-REGISTRATION -$cfg->setConfigEntry('user_registration_class', "ShipSimuRegistration"); +$cfg->setConfigEntry('user_registration_class', "ToDoRegistration"); // CFG: USER-LOGIN-CLASS -$cfg->setConfigEntry('user_login_class', "ShipSimuUserLogin"); +$cfg->setConfigEntry('user_login_class', "ToDoUserLogin"); // CFG: GUEST-LOGIN-CLASS -$cfg->setConfigEntry('guest_login_class', "ShipSimuGuestLogin"); +$cfg->setConfigEntry('guest_login_class', "ToDoGuestLogin"); // CFG: USER-STATUS-REGISTER $cfg->setConfigEntry('user_status_unconfirmed', "UNCONFIRMED"); @@ -92,7 +92,7 @@ $cfg->setConfigEntry('user_status_guest', "GUEST"); $cfg->setConfigEntry('user_status_confirmed', "CONFIRMED"); // CFG: LOGIN-HELPER-CLASS -$cfg->setConfigEntry('login_helper_class', "ShipSimuLoginHelper"); +$cfg->setConfigEntry('login_helper_class', "ToDoLoginHelper"); // CFG: AUTH-METHOD-CLASS $cfg->setConfigEntry('auth_method_class', "CookieAuth"); @@ -191,21 +191,21 @@ $cfg->setConfigEntry('guest_login_user', "guest"); $cfg->setConfigEntry('guest_login_passwd', "guest"); // CFG: LOGIN-WELCOME-ACTION-CLASS -$cfg->setConfigEntry('login_welcome_action_class', "ShipSimuLoginAction"); +$cfg->setConfigEntry('login_welcome_action_class', "ToDoLoginAction"); // CFG: LOGIN-LOGOUT-ACTION-CLASS -$cfg->setConfigEntry('login_logout_action_class', "ShipSimuLogoutAction"); +$cfg->setConfigEntry('login_logout_action_class', "ToDoLogoutAction"); // CFG: LOGIN-PROFILE-ACTION-CLASS -$cfg->setConfigEntry('login_profile_action_class', "ShipSimuProfileAction"); +$cfg->setConfigEntry('login_profile_action_class', "ToDoProfileAction"); -// CFG: SHIPSIMU-REGISTER-CAPTCHA +// CFG: TODO-REGISTER-CAPTCHA $cfg->setConfigEntry('todo_register_captcha', "GraphicalCodeCaptcha"); -// CFG: todo-USER-LOGIN-CAPTCHA +// CFG: TODO-USER-LOGIN-CAPTCHA $cfg->setConfigEntry('todo_user_login_captcha', "GraphicalCodeCaptcha"); -// CFG: todo-GUEST-LOGIN-CAPTCHA +// CFG: TODO-GUEST-LOGIN-CAPTCHA $cfg->setConfigEntry('todo_guest_login_captcha', "GraphicalCodeCaptcha"); // CFG: CAPTCHA-STRING-LENGTH @@ -217,13 +217,13 @@ $cfg->setConfigEntry('captcha_search_chars', "+/="); // CFG: RANDOM-STRING-LENGTH $cfg->setConfigEntry('random_string_length', 100); -// CFG: todo-REGISTER-CAPTCHA-SECURED +// CFG: TODO-REGISTER-CAPTCHA-SECURED $cfg->setConfigEntry('todo_register_captcha_secured', "Y"); -// CFG: todo-USER-LOGIN-CAPTCHA-SECURED +// CFG: TODO-USER-LOGIN-CAPTCHA-SECURED $cfg->setConfigEntry('todo_user_login_captcha_secured', "Y"); -// CFG: todo-GUEST-LOGIN-CAPTCHA-SECURED +// CFG: TODO-GUEST-LOGIN-CAPTCHA-SECURED $cfg->setConfigEntry('todo_guest_login_captcha_secured', "Y"); // CFG: BLOCK-SHOWS-REGISTRATION diff --git a/db/payments/.htaccess b/db/payments/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/db/payments/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/interfaces/discovery/.htaccess b/inc/classes/interfaces/discovery/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/interfaces/discovery/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/interfaces/discovery/class_Discoverable.php b/inc/classes/interfaces/discovery/class_Discoverable.php new file mode 100644 index 0000000..8cc62fa --- /dev/null +++ b/inc/classes/interfaces/discovery/class_Discoverable.php @@ -0,0 +1,35 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface Discoverable extends FrameworkInterface { + /** + * Discovers the request + * + * @param $requestInstance An instance of a Requestable class + * @return void + */ + function discover (Requestable $requestInstance); +} + +// +?> diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 006a6b4..3dc4aad 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -815,9 +815,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ public function debugBackTrace () { // Sorry, there is no other way getting this nice backtrace - print "
\n";
+		print("
\n");
 		debug_print_backtrace();
-		print "
"; + print("
"); exit; } diff --git a/inc/classes/main/controller/class_BaseController.php b/inc/classes/main/controller/class_BaseController.php index 1c4d442..69fa4d1 100644 --- a/inc/classes/main/controller/class_BaseController.php +++ b/inc/classes/main/controller/class_BaseController.php @@ -25,14 +25,9 @@ */ class BaseController extends BaseFrameworkSystem implements Registerable { /** - * Pre filter chain instance + * Generic filter chains */ - private $preFilterChain = null; - - /** - * Post filter chain instance - */ - private $postFilterChain = null; + private $filterChains = array(); /** * Protected constructor @@ -49,13 +44,23 @@ class BaseController extends BaseFrameworkSystem implements Registerable { $this->removeSystemArray(); // Initialize both filter chains - $this->preFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class'); - $this->postFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class'); + $this->initFilterChain('pre'); + $this->initFilterChain('post'); // Add this controller to the registry Registry::getRegistry()->addInstance('controller', $this); } + /** + * Private method to initialize a given filter chain + * + * @param $filterChain Name of the filter chain + * @return void + */ + private function initFilterChain ($filterChain) { + $this->filterChains[$filterChain] = ObjectFactory::createObjectByConfiguredName('filter_chain_class'); + } + /** * Adds a filter to the pre filter chain * @@ -64,7 +69,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { */ public function addPreFilter (Filterable $filterInstance) { // Add the pre filter - $this->preFilterChain->addFilter($filterInstance); + $this->filterChains['pre']->addFilter($filterInstance); } /** @@ -75,7 +80,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { */ public function addPostFilter (Filterable $filterInstance) { // Add the post filter - $this->postFilterChain->addFilter($filterInstance); + $this->filterChains['post']->addFilter($filterInstance); } /** @@ -87,7 +92,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { */ protected function executePreFilters (Requestable $requestInstance, Responseable $responseInstance) { // Execute all pre filters - $this->preFilterChain->processFilters($requestInstance, $responseInstance); + $this->filterChains['pre']->processFilters($requestInstance, $responseInstance); } /** @@ -99,7 +104,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { */ protected function executePostFilters (Requestable $requestInstance, Responseable $responseInstance) { // Execute all post filters - $this->postFilterChain->processFilters($requestInstance, $responseInstance); + $this->filterChains['post']->processFilters($requestInstance, $responseInstance); } } diff --git a/inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php new file mode 100644 index 0000000..52f3646 --- /dev/null +++ b/inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php @@ -0,0 +1,59 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class PaymentsDatabaseWrapper extends BaseDatabaseWrapper { + // Constants for exceptions + const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0x180; + + // Constants for database table names + const DB_TABLE_PAYMENTS = "payments"; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct() { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this database wrapper by a provided user class + * + * @return $wrapperInstance An instance of the created wrapper class + */ + public final static function createPaymentsDatabaseWrapper () { + // Get a new instance + $wrapperInstance = new PaymentsDatabaseWrapper(); + + // Set (primary!) table name + $wrapperInstance->setTableName(self::DB_TABLE_PAYMENTS); + + // Return the instance + return $wrapperInstance; + } +} + +// [EOF] +?> diff --git a/inc/classes/main/debug/class_DebugConsoleOutput.php b/inc/classes/main/debug/class_DebugConsoleOutput.php index b9db256..08e6d42 100644 --- a/inc/classes/main/debug/class_DebugConsoleOutput.php +++ b/inc/classes/main/debug/class_DebugConsoleOutput.php @@ -52,7 +52,7 @@ class DebugConsoleOutput extends BaseFrameworkSystem implements Debugger, Output * @return void */ public final function outputStream ($output) { - print(html_entity_decode(strip_tags($output))); + print(html_entity_decode(strip_tags(stripslashes($output)))); } /** diff --git a/inc/classes/main/debug/class_DebugWebOutput.php b/inc/classes/main/debug/class_DebugWebOutput.php index 268738a..433f68e 100644 --- a/inc/classes/main/debug/class_DebugWebOutput.php +++ b/inc/classes/main/debug/class_DebugWebOutput.php @@ -54,7 +54,7 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre public final function outputStream ($output) { // Strip out
$output = str_replace("
", "", $output); - print($output."
\n"); + print(stripslashes($output)."
\n"); } /** diff --git a/inc/classes/main/discovery/.htaccess b/inc/classes/main/discovery/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/discovery/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/discovery/class_ b/inc/classes/main/discovery/class_ new file mode 100644 index 0000000..05a2063 --- /dev/null +++ b/inc/classes/main/discovery/class_ @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ???Discovery extends BaseDiscovery implements Discoverable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Create an instance of this class + * + * @return $discoveryInstance An instance of this discovery class + */ + public final static function create???Discovery () { + // Get an instance of this class + $discoveryInstance = new ???Discovery(); + + // Return the prepared instance + return $discoveryInstance; + } + + /** + * Discovers the request + * + * @param $requestInstance An instance of a Requestable class + * @return void + */ + public function discover (Requestable $requestInstance) { + $this->partialStub("Please implement this method."); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/discovery/class_BaseDiscovery.php b/inc/classes/main/discovery/class_BaseDiscovery.php new file mode 100644 index 0000000..48164e1 --- /dev/null +++ b/inc/classes/main/discovery/class_BaseDiscovery.php @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseDiscovery extends BaseFrameworkSystem { + /** + * Action name for payment discovery + */ + private $actionName = ""; + + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Protected setter for action name + * + * @param $actionName Action name to set + * @return void + */ + protected final function setActionName ($actionName) { + $this->actionName = (string) $actionName; + } + + /** + * Private getter for action name + * + * @return $actionName Action name to set + */ + protected final function getActionName () { + return $this->actionName; + } +} + +// [EOF] +?> diff --git a/inc/classes/main/discovery/payment/.htaccess b/inc/classes/main/discovery/payment/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/discovery/payment/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php new file mode 100644 index 0000000..1c46a4f --- /dev/null +++ b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php @@ -0,0 +1,83 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Create an instance of this class + * + * @param $filterInstance An instance of a filter + * @return $discoveryInstance An instance of this discovery class + */ + public final static function createLocalPaymentDiscovery (Filterable $filterInstance) { + // Get an instance of this class + $discoveryInstance = new LocalPaymentDiscovery(); + + // Set the action from filter + $discoveryInstance->setActionName($filterInstance->getActionName()); + + // Return the prepared instance + return $discoveryInstance; + } + + /** + * Discovers the request + * + * @param $requestInstance An instance of a Requestable class + * @return void + */ + public function discover (Requestable $requestInstance) { + // Now get a search criteria and set app name and payment action as search critera + $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); + $criteriaInstance->addCriteria("app_name", $requestInstance->getRequestElement('app')); + $criteriaInstance->addCriteria("payment_action", $this->getActionName().'_action'); + $criteriaInstance->setLimit(1); + + // Get a wrapper instance + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('payment_db_wrapper_class'); + + // Get result back + $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance); + + // Set the result instance + $this->setResultInstance($resultInstance); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/filter/payment/.htaccess b/inc/classes/main/filter/payment/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/filter/payment/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php b/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php new file mode 100644 index 0000000..3fc1d3d --- /dev/null +++ b/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php @@ -0,0 +1,153 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class PaymentDiscoveryFilter extends BaseFrameworkSystem implements Filterable { + /** + * Action name for payment discovery + */ + private $actionName = ""; + + /** + * Instance of a discovery class + */ + private $discoveryInstance = null; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Creates an instance of this filter class + * + * @param $actionInstance A performable action + * @return $filterInstance An instance of this filter class + * @throws NullPointerException If the resolver is not set + */ + public final static function createPaymentDiscoveryFilter (PerformableAction $actionInstance) { + // Get a new instance + $filterInstance = new PaymentDiscoveryFilter(); + + // Get resolver from action + $resolverInstance = $actionInstance->getResolverInstance(); + + // Is the resolver set? + if (is_null($resolverInstance)) { + // Throw an exception here + throw new NullPointerException($filterInstance, self::EXCEPTION_IS_NULL_POINTER); + } // END - if + + // Get the action name from resolver + $actionName = $resolverInstance->getActionName(); + + // Store it away in this class + $filterInstance->setActionName($actionName); + + // Return the instance + return $filterInstance; + } + + /** + * Protected setter for action name + * + * @param $actionName Action name to set + * @return void + */ + protected final function setActionName ($actionName) { + $this->actionName = (string) $actionName; + } + + /** + * Getter for action name + * + * @return $actionName Action name to set + */ + public final function getActionName () { + return $this->actionName; + } + + /** + * Protected setter for discovery instance + * + * @param $discoveryInstance A discovery instance + * @return void + */ + protected final function setDiscoveryInstance (Discoverable $discoveryInstance) { + $this->discoveryInstance = $discoveryInstance; + } + + /** + * Protected getter for discovery instance + * + * @return $discoveryInstance A discovery instance + */ + public final function getDiscoveryInstance () { + return $this->discoveryInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @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 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Try to get real discovery class + try { + // Get an instance from the object factory + $discoveryInstance = ObjectFactory::createObjectByConfiguredName($this->getActionName().'_payment_discovery', array($this)); + + // Call the discovery method + $discoveryInstance->discover($requestInstance); + + // Remember this instance if all wents fine + $this->setDiscoveryInstance($discoveryInstance); + } catch (FrameworkException $e) { + // Something bad happend + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('payment_error'); + $responseInstance->addFatalMessagePlain($e->getMessage()); + + // Abort here + return false; + } + } +} + +// [EOF] +?> diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php index 2f3502c..a188251 100644 --- a/inc/classes/main/helper/web/forms/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/forms/class_WebFormHelper.php @@ -634,8 +634,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { } // END - if // Render the content - $content = sprintf("\n", - $subName, + $content = sprintf("\n", $subName, $subValue ); diff --git a/inc/classes/main/output/class_ConsoleOutput.php b/inc/classes/main/output/class_ConsoleOutput.php index bcc1fc5..51f5dca 100644 --- a/inc/classes/main/output/class_ConsoleOutput.php +++ b/inc/classes/main/output/class_ConsoleOutput.php @@ -95,7 +95,7 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer { } } else { // Output it to the console - printf("%s\n", trim(html_entity_decode(strip_tags($outStream)))); + printf("%s\n", trim(html_entity_decode(strip_tags(stripslashes($outStream))))); } } diff --git a/inc/classes/main/output/class_WebOutput.php b/inc/classes/main/output/class_WebOutput.php index 7a50805..e82c0b7 100644 --- a/inc/classes/main/output/class_WebOutput.php +++ b/inc/classes/main/output/class_WebOutput.php @@ -84,7 +84,7 @@ class WebOutput extends BaseFrameworkSystem implements OutputStreamer, Registera * @return void */ public final function output ($outStream=false) { - print($outStream); + print(stripslashes($outStream)); } } diff --git a/inc/classes/main/points/class_UserPoints.php b/inc/classes/main/points/class_UserPoints.php index 17c22e2..fb0f169 100644 --- a/inc/classes/main/points/class_UserPoints.php +++ b/inc/classes/main/points/class_UserPoints.php @@ -72,7 +72,7 @@ class UserPoints extends BaseFrameworkSystem implements Registerable { // Now get a search criteria and set the user's name as criteria $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - $criteriaInstance->addCriteria('points_uid', $this->getUserInstance()->getUserName()); + $criteriaInstance->addCriteria("points_uid", $this->getUserInstance()->getUserName()); $criteriaInstance->setLimit(1); // Get result back diff --git a/inc/classes/main/reader/class_DefaultNewsReader.php b/inc/classes/main/reader/class_DefaultNewsReader.php index 4e5dbb1..b0dbac6 100644 --- a/inc/classes/main/reader/class_DefaultNewsReader.php +++ b/inc/classes/main/reader/class_DefaultNewsReader.php @@ -70,7 +70,7 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); // Add the page as criteria to it at lease - $criteriaInstance->addCriteria('page', $page); + $criteriaInstance->addCriteria("page", $page); // Add limitation from config $criteriaInstance->setLimit($this->getConfigInstance()->readConfig("news_{$page}_limit")); diff --git a/inc/classes/main/resolver/action/class_BaseActionResolver.php b/inc/classes/main/resolver/action/class_BaseActionResolver.php index 0c7f268..eef7b46 100644 --- a/inc/classes/main/resolver/action/class_BaseActionResolver.php +++ b/inc/classes/main/resolver/action/class_BaseActionResolver.php @@ -68,7 +68,7 @@ class BaseActionResolver extends BaseResolver { * * @return $actionName Last validated action name */ - protected final function getActionName () { + public final function getActionName () { return $this->actionName; } diff --git a/inc/classes/main/response/class_BaseResponse.php b/inc/classes/main/response/class_BaseResponse.php index 2ecfaa2..0c3a4c7 100644 --- a/inc/classes/main/response/class_BaseResponse.php +++ b/inc/classes/main/response/class_BaseResponse.php @@ -132,6 +132,17 @@ class BaseResponse extends BaseFrameworkSystem { $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId); } + /** + * Adds a plain fatal message id to the response + * + * @param $message The plain message we shall add + * @return void + */ + public final function addFatalMessagePlain ($message) { + // Adds the resolved message id to the fatal message list + $this->fatalMessages[] = $message; + } + /** * Flushs the cached HTTP response to the outer world * diff --git a/inc/classes/main/user/member/class_Member.php b/inc/classes/main/user/member/class_Member.php index 141f1de..726e850 100644 --- a/inc/classes/main/user/member/class_Member.php +++ b/inc/classes/main/user/member/class_Member.php @@ -144,8 +144,8 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class'); // And add our both entries - $updateInstance->addCriteria('last_activity', date("Y-m-d H:i:s", time())); - $updateInstance->addCriteria('last_action', $lastAction); + $updateInstance->addCriteria("last_activity", date("Y-m-d H:i:s", time())); + $updateInstance->addCriteria("last_action", $lastAction); // Add the search criteria for searching for the right entry $updateInstance->setSearchInstance($searchInstance); -- 2.30.2