WebInstallerComplete.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along
  14. * with this program; if not, write to the Free Software Foundation, Inc.,
  15. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. * http://www.gnu.org/copyleft/gpl.html
  17. *
  18. * @file
  19. * @ingroup Deployment
  20. */
  21. class WebInstallerComplete extends WebInstallerPage {
  22. public function execute() {
  23. // Pop up a dialog box, to make it difficult for the user to forget
  24. // to download the file
  25. $lsUrl = $this->getVar( 'wgServer' ) . $this->parent->getUrl( [ 'localsettings' => 1 ] );
  26. if ( isset( $_SERVER['HTTP_USER_AGENT'] ) &&
  27. strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false
  28. ) {
  29. // JS appears to be the only method that works consistently with IE7+
  30. $this->addHTML( "\n<script>jQuery( function () { location.href = " .
  31. Xml::encodeJsVar( $lsUrl ) . "; } );</script>\n" );
  32. } else {
  33. $this->parent->request->response()->header( "Refresh: 0;url=$lsUrl" );
  34. }
  35. $this->startForm();
  36. $this->parent->disableLinkPopups();
  37. $location = $this->parent->getLocalSettingsLocation();
  38. $msg = 'config-install-done';
  39. if ( $location !== false ) {
  40. // config-install-done-path
  41. $msg .= '-path';
  42. }
  43. $this->addHTML(
  44. $this->parent->getInfoBox(
  45. new HtmlArmor( wfMessage( $msg,
  46. $lsUrl,
  47. $this->getVar( 'wgServer' ) .
  48. $this->getVar( 'wgScriptPath' ) . '/index.php',
  49. Message::rawParam( $this->parent->makeDownloadLinkHtml() ),
  50. $location ?: ''
  51. )->parse() ), 'tick-32.png'
  52. )
  53. );
  54. $this->addHTML( $this->parent->getInfoBox(
  55. wfMessage( 'config-extension-link' )->plain() ) );
  56. $this->parent->restoreLinkPopups();
  57. $this->endForm( false, false );
  58. return '';
  59. }
  60. }