chore(deps): bump twig/twig from 3.17.1 to 3.19.0 (#7951)
[openemr.git] / interface / billing / clear_log.php
blob51e8101d7a5311827bf730e5f279b215167757c6
1 <?php
3 /**
4 * interface/billing/clear_log.php - backup, then clear billing log
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @author Sherwin Gaddis <sherwingaddis@gmail.com>
10 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
11 * @copyright Copyright (c) 2019 Sherwin Gaddis <sherwingaddis@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
17 use OpenEMR\Common\Acl\AclMain;
18 use OpenEMR\Common\Csrf\CsrfUtils;
19 use OpenEMR\Common\Twig\TwigContainer;
21 if (!CsrfUtils::verifyCsrfToken($_GET["csrf_token_form"])) {
22 CsrfUtils::csrfNotVerified();
25 //ensure user has proper access
26 if (!AclMain::aclCheckCore('acct', 'eob', '', 'write') && !AclMain::aclCheckCore('acct', 'bill', '', 'write')) {
27 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Billing Log")]);
28 exit;
31 $filename = $GLOBALS['OE_SITE_DIR'] . '/documents/edi/process_bills.log';
32 if (file_exists($filename)) {
33 $newlog = $GLOBALS['OE_SITE_DIR'] . '/documents/edi/' . date("Y-m-d-His") . '_process_bills.log';
34 rename($filename, $newlog);
35 echo xlt("Log is cleared. Please close window.");
36 } else {
37 echo xlt("Log was already empty. Please close window.");