function farm_theme_page_alter in farmOS 7
Implements hook_page_alter().
File
- themes/
farm_theme/ template.php, line 397 - Farm theme template.php.
Code
function farm_theme_page_alter(&$page) {
// If an access denied page is displayed and the user is not logged in...
global $user;
$status = drupal_get_http_header('status');
if ($status == '403 Forbidden' && empty($user->uid)) {
// Display a link to the user login page, and redirect back to this page.
$page['content']['system_main']['login'] = array(
'#type' => 'markup',
'#markup' => '<p>' . l('Login to farmOS', 'user', array(
'query' => array(
'destination' => current_path(),
),
)) . '</p>',
);
}
}