dolibarr  17.0.3
smpcb.php
Go to the documentation of this file.
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 
24 if (!defined('NOTOKENRENEWAL')) {
25  define('NOTOKENRENEWAL', '1');
26 }
27 if (!defined('NOREQUIREMENU')) {
28  define('NOREQUIREMENU', '1');
29 }
30 if (!defined('NOREQUIREHTML')) {
31  define('NOREQUIREHTML', '1');
32 }
33 if (!defined('NOREQUIREAJAX')) {
34  define('NOREQUIREAJAX', '1');
35 }
36 
37 // Load Dolibarr environment
38 require '../main.inc.php';
39 
40 if (empty($user->rights->takepos->run)) {
42 }
43 
44 if (GETPOSTISSET('status')) {
45  die(strtoupper($_SESSION['SMP_CURRENT_PAYMENT']));
46 }
47 
48 
49 /*
50  * View
51  */
52 
53 top_httphead('text/html', 1);
54 
55 if (GETPOST('smp-status')) {
56  print '<html lang="en">';
57  print '<head>';
58  print '<meta charset="utf-8">
59 
60  <title>The HTML5 Herald</title>
61  <meta name="description" content="The HTML5 Herald">
62  <meta name="author" content="SitePoint">
63 
64  <link rel="stylesheet" href="css/styles.css?v=1.0">';
65 
66  print '</head>';
67 
68  print '<body>';
69  $_SESSION['SMP_CURRENT_PAYMENT'] = GETPOST('smp-status');
70 
71  print '<script type="application/javascript">
72  window.onload = function() {
73  window.close();
74  };
75  </script>';
76 
77  print "Transaction status registered, you can close this";
78 
79  print '</body></html>';
80  exit();
81 }
82 
83 print 'NOOP';
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:520
top_httphead
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
Definition: main.inc.php:1440
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:421
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
Definition: security.lib.php:1125