upgrade.php 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Page shell for upgrade script
  4. *
  5. * Displays an ajax loader until upgrade is complete
  6. *
  7. * @uses $vars['head'] Parameters for the <head> element
  8. * @uses $vars['body'] The main content of the page
  9. * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages()
  10. * @uses $var['forward'] A relative path to forward to after upgrade. Defaults to /admin
  11. */
  12. $forward = elgg_extract('forward', $vars, '/admin');
  13. if ($forward == '/admin' && !elgg_is_admin_logged_in()) {
  14. $forward = '/';
  15. }
  16. $refresh_url = elgg_http_add_url_query_elements(elgg_get_site_url() . 'upgrade.php', array(
  17. 'upgrade' => 'upgrade',
  18. 'forward' => $forward,
  19. // add the security code
  20. 'code' => get_input('code')
  21. ));
  22. $refresh_url = htmlspecialchars($refresh_url);
  23. // render content before head so that JavaScript and CSS can be loaded. See #4032
  24. $body = "<div style='margin-top:200px'>" . elgg_view('graphics/ajax_loader', array('hidden' => false)) . "</div>";
  25. $head = elgg_view('page/elements/head', $vars['head']);
  26. $head .= "<meta http-equiv='refresh' content='1;url=$refresh_url' />";
  27. echo elgg_view("page/elements/html", array("head" => $head, "body" => $body));