fix: Update patient_tracker.php (#6595)
[openemr.git] / interface / couchdb / couchdb_log.php
blob8de24fc0ec6b9120fa4a2c668ddc948d2f0894ee
1 <?php
3 /**
4 * will display the couchdb log
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../globals.php");
15 use OpenEMR\Common\Crypto\CryptoGen;
17 $filename = $GLOBALS['OE_SITE_DIR'] . '/documents/couchdb/log.txt';
19 if (!file_exists($filename)) {
20 echo xlt("CouchDB error log is empty");
21 exit;
24 $fh = file_get_contents($filename);
26 $cryptoGen = new CryptoGen();
27 if ($cryptoGen->cryptCheckStandard($fh)) {
28 $fh = $cryptoGen->decryptStandard($fh, null, 'database');
31 if (!empty($fh)) {
32 echo nl2br(text($fh));
33 } else {
34 echo xlt("CouchDB error log is empty");