Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

OneClickDone.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * Piwik - free/libre analytics platform
  4. *
  5. * @link http://piwik.org
  6. * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
  7. *
  8. */
  9. namespace Piwik\View;
  10. /**
  11. * Post-update view
  12. *
  13. * During a Piwik software update, there will be instances of old classes
  14. * loaded in memory. This is problematic as we will start to instantiate
  15. * new classes which may not be backward compatible. This class provides
  16. * a clean bridge/transition by forcing a new request.
  17. *
  18. * This class needs to be self-contained, with no external dependencies.
  19. *
  20. */
  21. class OneClickDone
  22. {
  23. /**
  24. * @var string
  25. */
  26. private $tokenAuth;
  27. /**
  28. * @var string
  29. */
  30. public $coreError;
  31. /**
  32. * @var array
  33. */
  34. public $feedbackMessages;
  35. public function __construct($tokenAuth)
  36. {
  37. $this->tokenAuth = $tokenAuth;
  38. }
  39. /**
  40. * Outputs the data.
  41. *
  42. * @return string html
  43. */
  44. public function render()
  45. {
  46. // set response headers
  47. @header('Content-Type: text/html; charset=UTF-8');
  48. @header('Pragma: ');
  49. @header('Expires: ');
  50. @header('Cache-Control: must-revalidate');
  51. @header('X-Frame-Options: deny');
  52. $error = htmlspecialchars($this->coreError, ENT_QUOTES, 'UTF-8');
  53. $messages = htmlspecialchars(serialize($this->feedbackMessages), ENT_QUOTES, 'UTF-8');
  54. $tokenAuth = $this->tokenAuth;
  55. // use a heredoc instead of an external file
  56. echo <<<END_OF_TEMPLATE
  57. <!DOCTYPE html>
  58. <html>
  59. <head>
  60. <meta charset="utf-8">
  61. <title></title>
  62. </head>
  63. <body>
  64. <form name="myform" method="post" action="?module=CoreUpdater&amp;action=oneClickResults">
  65. <input type="hidden" name="token_auth" value="$tokenAuth" />
  66. <input type="hidden" name="error" value="$error" />
  67. <input type="hidden" name="messages" value="$messages" />
  68. <noscript>
  69. <button type="submit">Continue</button>
  70. </noscript>
  71. </form>
  72. <script type="text/javascript">
  73. document.myform.submit();
  74. </script>
  75. </body>
  76. </html>
  77. END_OF_TEMPLATE;
  78. }
  79. }