Index: update.php =================================================================== RCS file: /cvs/drupal/drupal/update.php,v retrieving revision 1.151 diff -u -F^f -r1.151 update.php --- update.php 17 Aug 2005 00:49:36 -0000 1.151 +++ update.php 17 Aug 2005 00:56:24 -0000 @@ -40,58 +40,43 @@ function update_data($start) { return $output; } -function update_page() { - global $user, $sql_updates; +function update_selection_page() { + global $sql_updates; - if (isset($_POST['edit'])) { - $edit = $_POST['edit']; - } - if (isset($_POST['op'])) { - $op = $_POST['op']; + $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 = form_select("Perform updates from", "start", (isset($selected) ? $selected : -1), $dates, "This defaults to the first available update since the last update you performed."); + $form .= form_submit("Update"); + + drupal_set_title('Drupal database update'); + return form($form); +} - switch ($op) { - case "Update": - // make sure we have updates to run. - drupal_set_title('Drupal database update'); - $links[] = "main page"; - $links[] = "administration pages"; - $output = theme('item_list', $links); - // NOTE: we can't use l() here because the URL would point to 'update.php?q=admin'. - if ($edit["start"] == -1) { - $output .= 'No updates to perform.'; - } - else { - $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
.";
- }
- print theme('maintenance_page', $output);
- break;
-
- default:
- $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 = form_select("Perform updates from", "start", (isset($selected) ? $selected : -1), $dates, "This defaults to the first available update since the last update you performed.");
- $form .= form_submit("Update");
- drupal_set_title('Drupal database update');
- print theme('maintenance_page', form($form));
- break;
+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() {
+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.
'; $output .= "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;
.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;
.