// Our own exception handler
function __exceptionHandler (FrameworkException $e) {
// Call the app_die() method
- ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> (<strong>%s</strong>) has been terminated due to a thrown exception: <strong>%s: <span id=\"debug_exception\">%s</em></strong>. Backtrace: <div id=\"debug_backtrace\">%s</div>",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> (<strong>%s</strong>) has been terminated due to a thrown exception: <strong>%s[%s]: <span id=\"debug_exception\">%s</em></strong>. Backtrace: <div id=\"debug_backtrace\">%s</div>",
ApplicationHelper::getInstance()->getAppName(),
ApplicationHelper::getInstance()->getAppShortName(),
$e->__toString(),
+ $e->getHexCode(),
$e->getMessage(),
$e->getPrintableBackTrace()
));
// Set the resolver instance
$commandInstance->setResolverInstance($resolverInstance);
- // Get the controller instance from the resolver (breaks MVC pattern again)
- $controllerInstance = $resolverInstance->getControllerInstance();
-
- switch ($commandInstance->getConfigInstance()->readConfig('login_type')) {
- case "username": // Login via username
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_class'));
- break;
-
- case "email": // Login via email
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_class'));
- break;
-
- default: // Wether username or email is set
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_class'));
- break;
- }
-
- /* @TODO Add more filters */
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_class'));
-
// Return the prepared instance
return $commandInstance;
}
* @return void
*/
function addExtraFilters (Controller $controllerInstance) {
- // Empty for now
+ // Which login type do we have?
+ switch ($commandInstance->getConfigInstance()->readConfig('login_type')) {
+ case "username": // Login via username
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_class'));
+ break;
+
+ case "email": // Login via email
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_class'));
+ break;
+
+ default: // Wether username or email is set
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_class'));
+ break;
+ }
+
+ /* @TODO Add more filters */
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_class'));
}
}
// Set the resolver instance
$commandInstance->setResolverInstance($resolverInstance);
- // Get the controller instance from the resolver (breaks MVC pattern again)
- $controllerInstance = $resolverInstance->getControllerInstance();
-
- /* @TODO Add some more pre/post filters to the controller */
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_class'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_class'));
-
// Return the prepared instance
return $commandInstance;
}
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Make sure only allowed values are comming through
foreach ($this->allowedData as $alias=>$element) {
+ // Get data
+ $data = $requestInstance->getRequestElement($element);
+
+ // Skip empty fields
+ if (empty($data)) continue;
+
// Do we have an alias?
if (is_string($alias)) {
// Yes, so use it
- $this->requestData[$alias] = $requestInstance->getRequestElement($element);
+ $this->requestData[$alias] = $data;
} else {
// No, default entry
- $this->requestData[$element] = $requestInstance->getRequestElement($element);
+ $this->requestData[$element] = $data;
}
} // END - foreach
function addExtraFilters (Controller $controllerInstance) {
// 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 */
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_class'));
}
}
// Set the resolver instance
$commandInstance->setResolverInstance($resolverInstance);
- // Get the controller instance from the resolver (breaks MVC pattern again)
- $controllerInstance = $resolverInstance->getControllerInstance();
-
- /* @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'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_class'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class'));
-
// Return the prepared instance
return $commandInstance;
}
* @return void
*/
function addExtraFilters (Controller $controllerInstance) {
- // Empty for now
+ /* @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'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class'));
}
}
// Set the resolver instance
$commandInstance->setResolverInstance($resolverInstance);
- // Get the controller instance from the resolver (breaks MVC pattern again)
- $controllerInstance = $resolverInstance->getControllerInstance();
-
- switch ($commandInstance->getConfigInstance()->readConfig('login_type')) {
- case "username": // Login via username
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_class'));
- break;
-
- case "email": // Login via email
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_class'));
- break;
-
- default: // Wether username or email is set
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_class'));
- break;
- }
-
- /* @TODO Add more filters */
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_class'));
-
// Return the prepared instance
return $commandInstance;
}
* @return void
*/
function addExtraFilters (Controller $controllerInstance) {
- // Empty for now
+ // Which login type do we have?
+ switch ($commandInstance->getConfigInstance()->readConfig('login_type')) {
+ case "username": // Login via username
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_class'));
+ break;
+
+ case "email": // Login via email
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_class'));
+ break;
+
+ default: // Wether username or email is set
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_class'));
+ break;
+ }
+
+ /* @TODO Add more filters */
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_class'));
}
}