smpcb.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /* Copyright (C) 2020 Andreu Bisquerra Gaya <jove@bisquerra.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/takepos/smpcb.php
  19. * \ingroup takepos
  20. * \brief Page with the content for smpcb payment
  21. */
  22. if (!defined('NOCSRFCHECK')) {
  23. define('NOCSRFCHECK', '1');
  24. }
  25. if (!defined('NOTOKENRENEWAL')) {
  26. define('NOTOKENRENEWAL', '1');
  27. }
  28. if (!defined('NOREQUIREMENU')) {
  29. define('NOREQUIREMENU', '1');
  30. }
  31. if (!defined('NOREQUIREHTML')) {
  32. define('NOREQUIREHTML', '1');
  33. }
  34. if (!defined('NOREQUIREAJAX')) {
  35. define('NOREQUIREAJAX', '1');
  36. }
  37. // Load Dolibarr environment
  38. require '../main.inc.php';
  39. if (empty($user->rights->takepos->run)) {
  40. accessforbidden();
  41. }
  42. if (GETPOSTISSET('status')) {
  43. die(strtoupper($_SESSION['SMP_CURRENT_PAYMENT']));
  44. }
  45. /*
  46. * View
  47. */
  48. top_httphead('text/html', 1);
  49. if (GETPOST('smp-status')) {
  50. print '<html lang="en">';
  51. print '<head>';
  52. print '<meta charset="utf-8">
  53. <title>The HTML5 Herald</title>
  54. <meta name="description" content="The HTML5 Herald">
  55. <meta name="author" content="SitePoint">
  56. <link rel="stylesheet" href="css/styles.css?v=1.0">';
  57. print '</head>';
  58. print '<body>';
  59. $_SESSION['SMP_CURRENT_PAYMENT'] = GETPOST('smp-status');
  60. print '<script type="application/javascript">
  61. window.onload = function() {
  62. window.close();
  63. };
  64. </script>';
  65. print "Transaction status registered, you can close this";
  66. print '</body></html>';
  67. exit();
  68. }
  69. print 'NOOP';