Page callback: Dismisses the overlay accessibility message for this user.
A render array for a page containing a list of content.
overlay_user_dismiss_message_access()
function overlay_user_dismiss_message() {
global $user;
// @todo CSRF tokens are validated in page callbacks rather than access
// callbacks, because access callbacks are also invoked during menu link
// generation. Add token support to routing: http://drupal.org/node/755584.
$token = drupal_container()
->get('request')->query
->get('token');
if (!isset($token) || !drupal_valid_token($token, 'overlay')) {
throw new AccessDeniedHttpException();
}
drupal_container()
->get('user.data')
->set('overlay', $user->uid, 'message_dismissed', 1);
drupal_set_message(t('The message has been dismissed. You can change your overlay settings at any time by visiting your profile page.'));
// Destination is normally given. Go to the user profile as a fallback.
drupal_goto('user/' . $user->uid . '/edit');
}