From: Roland Häder Date: Thu, 5 Jun 2008 13:01:51 +0000 (+0000) Subject: Missing directory db/user/ added, rules checkbox filter finished, directory for filte... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=dc97c9dc65dcbd007a4c5118674a03ff326a6dca;p=shipsimu.git Missing directory db/user/ added, rules checkbox filter finished, directory for filter decorators added --- diff --git a/.gitattributes b/.gitattributes index 70f8b4d..489064a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -329,6 +329,7 @@ inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php -text inc/classes/main/filter/class_ -text inc/classes/main/filter/class_AbstractFilterDecorator.php -text inc/classes/main/filter/class_FilterChain.php -text +inc/classes/main/filter/decorator/.htaccess -text inc/classes/main/filter/null/.htaccess -text inc/classes/main/filter/null/class_NullFilter.php -text inc/classes/main/filter/validator/.htaccess -text diff --git a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php index e10c7c9..5d48b9e 100644 --- a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php +++ b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php @@ -65,8 +65,29 @@ class RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable { * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Implement this! - $this->partialStub("Please implement this method."); + // Get the "rules" value from request + $rules = $requestInstance->getRequestElement('rules'); + + // Was the "rules" value found in form? And is it set? + if (is_null($rules)) { + // Not found in form so stop processing here + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('rules_unset'); + + // Abort here + return false; + } elseif ($rules != "1") { + // Not set, must be "1"! + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('rules_unchecked'); + + // Abort here + return false; + } } } diff --git a/inc/classes/main/filter/decorator/.htaccess b/inc/classes/main/filter/decorator/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/filter/decorator/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/response/class_HttpResponse.php b/inc/classes/main/response/class_HttpResponse.php index 26ddc88..9c04534 100644 --- a/inc/classes/main/response/class_HttpResponse.php +++ b/inc/classes/main/response/class_HttpResponse.php @@ -167,7 +167,7 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { $this->addHeader('Pragma:', 'no-cache'); // HTTP/1.0 // Define the charset to be used - $this->addHeader('Content-Type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->readConfig('header_charset'))); + //$this->addHeader('Content-Type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->readConfig('header_charset'))); foreach ($this->responseHeaders as $name=>$value) { header("{$name}: {$value}");