1 restore.php | restore_access_denied_page() |
Renders a 403 access denied page for restore.php.
Return value
string: Rendered HTML warning with 403 status.
File
- core/
restore.php, line 214 - Administrative page for restoring backup database and configuration files.
Code
function restore_access_denied_page() {
backdrop_add_http_header('Status', '403 Forbidden');
watchdog('access denied', 'restore.php', NULL, WATCHDOG_WARNING);
backdrop_set_title(st('Access denied'));
$output = '';
$steps = array();
$output .= st('You are not authorized to access this page. Log in using either an account with the !permission permission, or the site maintenance account (the account you created during installation). If you cannot log in, you will have to edit !settings_file to bypass this access check. To do this:', array(
'!permission' => '<em>restore site backups</em>',
'!settings_file' => '<code>settings.php</code>',
));
$output = '<p>' . $output . '</p>';
$steps[] = st('Find the !settings_file file on your system, and open it with a text editor.', array(
'!settings_file' => '<code>settings.php</code>',
));
$steps[] = st('Find the line for !current_value. Change it to !new_value.', array(
'!settings_file' => '<code>settings.php</code>',
'!current_value' => '<code>$settings[\'restore_free_access\'] = FALSE;</code>',
'!new_value' => '<code>$settings[\'restore_free_access\'] = TRUE;</code>',
));
$steps[] = st('Reload this page. The site restore script should be able to run now.');
$steps[] = st('As soon as restoring a backup is complete, you must change the setting back to !value.', array(
'!value' => '<code>FALSE</code>',
));
$output .= theme('item_list', array('items' => $steps, 'type' => 'ol'));
return $output;
}