| +-----------------------------------------------------------------------+ */ class rcmail_action_utils_error extends rcmail_action { /** * Request handler. * * @param array $args Arguments from the previous step(s) */ public function run($args = []) { $rcmail = rcmail::get_instance(); $ERROR_CODE = !empty($args['code']) ? $args['code'] : 500; $ERROR_MESSAGE = !empty($args['message']) ? $args['message'] : null; // authorization error if ($ERROR_CODE == 401) { $__error_title = mb_strtoupper($rcmail->gettext('errauthorizationfailed')); $__error_text = nl2br($rcmail->gettext('errunauthorizedexplain') . "\n" . $rcmail->gettext('errcontactserveradmin')); } // forbidden due to request check else if ($ERROR_CODE == 403) { if ($_SERVER['REQUEST_METHOD'] == 'GET' && $rcmail->request_status == rcube::REQUEST_ERROR_URL) { $url = $rcmail->url($_GET, true, false, true); $add = html::a($url, $rcmail->gettext('clicktoresumesession')); } else { $add = $rcmail->gettext('errcontactserveradmin'); } $__error_title = mb_strtoupper($rcmail->gettext('errrequestcheckfailed')); $__error_text = nl2br($rcmail->gettext('errcsrfprotectionexplain')) . '
' . $add . '
'; } // failed request (wrong step in URL) else if ($ERROR_CODE == 404) { $request_url = htmlentities($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); $__error_title = mb_strtoupper($rcmail->gettext('errnotfound')); $__error_text = nl2br($rcmail->gettext('errnotfoundexplain') . "\n" . $rcmail->gettext('errcontactserveradmin')); $__error_text .= '' . $rcmail->gettext('errfailedrequest') . ": $request_url
"; } // browser is not compatible with this application else if ($ERROR_CODE == 409) { $user_agent = htmlentities($_SERVER['HTTP_USER_AGENT']); $__error_title = 'Your browser does not suit the requirements for this application'; $__error_text = "Required features: JavaScript enabled and XMLHTTPRequest support." . "Your configuration:
$user_agent
' . html::a($url, $rcmail->gettext('clicktocompose')) . '
'; } // database connection error else if ($ERROR_CODE == 601) { $__error_title = "CONFIGURATION ERROR"; $__error_text = nl2br($ERROR_MESSAGE) . "| ' . $__page_content . ' |