Merge pull request #21824 from ptibogxiv/patch-40

Fix hook in takepos/pay.php
This commit is contained in:
Laurent Destailleur 2022-08-22 10:42:26 +02:00 committed by GitHub
commit 301d14d58e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
* Copyright (C) 2021 Thibault FOUCART <support@ptibogxiv.net>
/* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
* Copyright (C) 2021-2022 Thibault FOUCART <support@ptibogxiv.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,6 +42,7 @@ if (!defined('NOREQUIREHTML')) {
require '../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$langs->loadLangs(array("main", "bills", "cashdesk", "banks"));
@ -49,6 +50,8 @@ $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'); // $place
$invoiceid = GETPOST('invoiceid', 'int');
$hookmanager->initHooks(array('takepospay'));
if (empty($user->rights->takepos->run)) {
accessforbidden();
}