$func) { $output .= '
'; $ret = $func(); foreach ($ret as $return) { $output .= $return[1]; } variable_set("update_start", $date); $output .= "\n"; } db_query('DELETE FROM {cache}'); return $output; } function update_selection_page() { global $sql_updates; $start = variable_get("update_start", 0); $i = 1; foreach ($sql_updates as $date => $sql) { $dates[$i++] = $date; if ($date == $start) { $selected = $i; } } $dates[$i] = "No updates available"; // make update form and output it. $form['start'] = array( '#type' => 'select', '#title' => t('Perform updates from'), '#default_value' => (isset($selected) ? $selected : -1), '#options' => $dates, '#description' => t('This defaults to the first available update since the last update you performed.') ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Update') ); drupal_set_title('Drupal database update'); return drupal_get_form('update_script_selection_form', $form); } function update_do_updates() { $edit = $_POST['edit']; drupal_set_title('Drupal database update'); // NOTE: we can't use l() here because the URL would point to 'update.php?q=admin'. $links[] = "main page"; $links[] = "administration pages"; $output = theme('item_list', $links); $output .= update_data($edit['start']); $output .= '
Updates were attempted. If you see no failures above, you may proceed happily to the administration pages. Otherwise, you may need to update your database manually.
'; if ($GLOBALS['access_check'] == FALSE) { $output .= "Reminder: don't forget to set the \$access_check
value at the top of update.php
back to TRUE
.";
}
return $output;
}
function update_info_page() {
drupal_set_title('Drupal database update');
$output = "
For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.
'; return $output; } function update_access_denied_page() { drupal_set_title('Access denied'); return 'Access denied. You are not authorized to access this page. Please log in as the admin user (the first user you created). If you cannot log in, you will have to edit update.php
to bypass this access check. To do this:
$access_check = TRUE;
. Change it to $access_check = FALSE;
.$access_check = TRUE;
.