} } catch (ServiceException $e) { Logger::exception($e); if ($output_type == "xml") { header('Content-Type: text/xml'); print "<error>"; $ec = new ReflectionClass("Error"); $constants = $ec->getConstants(); $constants = array_flip($constants); $code = $constants[$e->getCode()]; $message = $e->getMessage(); if (!$message) { $message = $code; } print "<code>{$code}</code>"; print "<message>{$message}</message>"; print "</error>"; } } catch (Exception $e) { Logger::exception($e); if ($output_type == "xml") { header('Content-Type: text/xml'); print "<error>"; print "<code>UNEXPECTED_ERROR</code>"; print "<message>" . $e->getMessage() . "</message>"; print "</error>"; } else { $_REQUEST['error_message'] = $e->getMessage(); $obj = ActionHandler::handleAction("ErrorPage"); } }
if ($userinfo['datum_anmeldung']) { $numberOfRegisteredDays = round(($website->getNowAsTimestamp() - $userinfo['datum_anmeldung']) / (3600 * 24)); BadgesDataService::awardBadgeIfApplicable($website, $db, $userId, 'membership_since_x_days', $numberOfRegisteredDays); } $_SESSION['badgechecked'] = 1; } // get page ID and parse it by router $pageId = $website->getRequestParameter(PARAM_PAGE); $pageId = PageIdRouter::getTargetPageId($website, $i18n, $pageId); $website->setPageId($pageId); $validationMessages = null; // handle action $actionId = $website->getRequestParameter(PARAM_ACTION); if ($actionId !== NULL) { try { $targetId = ActionHandler::handleAction($website, $db, $i18n, $actionId); if ($targetId != null) { $pageId = $targetId; } } catch (ValidationException $ve) { $validationMessages = $ve->getMessages(); $website->addFrontMessage(new FrontMessage(MESSAGE_TYPE_ERROR, $i18n->getMessage('validation_error_box_title'), $i18n->getMessage('validation_error_box_message'))); } catch (Exception $e) { $website->addFrontMessage(new FrontMessage(MESSAGE_TYPE_ERROR, $i18n->getMessage('errorpage_title'), $e->getMessage())); } } $website->setPageId($pageId); // get and set navigation items $navItems = NavigationBuilder::getNavigationItems($website, $i18n, $page, $pageId); $parameters['navItems'] = $navItems; // get and set breadcrumb