smpcb.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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('NOTOKENRENEWAL')) {
  23. define('NOTOKENRENEWAL', '1');
  24. }
  25. if (!defined('NOREQUIREMENU')) {
  26. define('NOREQUIREMENU', '1');
  27. }
  28. if (!defined('NOREQUIREHTML')) {
  29. define('NOREQUIREHTML', '1');
  30. }
  31. if (!defined('NOREQUIREAJAX')) {
  32. define('NOREQUIREAJAX', '1');
  33. }
  34. // Load Dolibarr environment
  35. require '../main.inc.php';
  36. if (!$user->hasRight('takepos', 'run')) {
  37. accessforbidden();
  38. }
  39. if (GETPOSTISSET('status')) {
  40. die(strtoupper($_SESSION['SMP_CURRENT_PAYMENT']));
  41. }
  42. /*
  43. * View
  44. */
  45. top_httphead('text/html', 1);
  46. if (GETPOST('smp-status')) {
  47. print '<html lang="en">';
  48. print '<head>';
  49. print '<meta charset="utf-8">
  50. <title>The HTML5 Herald</title>
  51. <meta name="description" content="The HTML5 Herald">
  52. <meta name="author" content="SitePoint">
  53. <link rel="stylesheet" href="css/styles.css?v=1.0">';
  54. print '</head>';
  55. print '<body>';
  56. $_SESSION['SMP_CURRENT_PAYMENT'] = GETPOST('smp-status');
  57. print '<script type="application/javascript">
  58. window.onload = function() {
  59. window.close();
  60. }
  61. </script>';
  62. print "Transaction status registered, you can close this";
  63. print '</body></html>';
  64. exit();
  65. }
  66. print 'NOOP';