1.20.x update.php update_access_denied_page()

Renders a 403 access denied page for update.php.

Return value

Rendered HTML warning with 403 status.:

File

./update.php, line 343
Administrative page for handling updates from one Backdrop version to another.

Code

function update_access_denied_page() {
  backdrop_add_http_header('Status', '403 Forbidden');
  watchdog('access denied', 'update.php', NULL, WATCHDOG_WARNING);
  backdrop_set_title(t('Access denied'));

  $output = '';
  $steps = array();

  $output .= t('You are not authorized to access this page. Log in using either an account with the <em>administer software updates</em> permission, or the site maintenance account (the account you created during installation). If you cannot log in, you will have to edit <code>settings.php</code> to bypass this access check. To do this:');
  $output = '<p>' . $output . '</p>';

  $steps[] = t('Find the <code>settings.php</code> file on your system, and open it with a text editor.');
  $steps[] = t('There is a line inside your <code>settings.php</code> file that says <code>$settings[\'update_free_access\'] = FALSE</code>. Change it to <code>$settings[\'update_free_access\'] = TRUE</code>.');
  $steps[] = t('Reload this page. The database update script should be able to run now.');
  $steps[] = t('As soon as the update script is done, you must change the <code>update_free_access</code> setting in the <code>settings.php</code> file back to <code>FALSE</code>: <code>$settings[\'update_free_access\'] = FALSE;</code>.');

  $output .= theme('item_list', array('items' => $steps, 'type' => 'ol'));

  return $output;
}