Added VARLIB_PATH and VARLOG_PATH defines to simplify packaging.
[fa-stable.git] / admin / view / view_upgrade_log.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 $page_security = 'SA_SOFTWAREUPGRADE';
13 $path_to_root = "../..";
14 include_once($path_to_root . "/includes/session.inc");
15 include_once($path_to_root . "/includes/packages.inc");
16
17 page(_($help_context = "Log View"), true);
18
19 include_once($path_to_root . "/includes/ui.inc");
20
21 if (!isset($_GET['id'])) 
22 {
23         /*Script was not passed the correct parameters */
24         display_note(_("The script must be called with a valid company number."));
25         end_page();
26 }
27
28 display_heading(sprintf(_("Upgrade log for company '%s'"), $_GET['id']));
29 br();
30   start_table();
31         start_row();
32
33         $log = strtr(file_get_contents(VARLOG_PATH.'/upgrade.'.$_GET['id'].'.log'), 
34                   array('Fatal error' => 'Fatal  error')); // prevent misinterpretation in output_handler
35     label_cells(null, nl2br(html_specials_encode($log)));
36         end_row();
37   end_table(1);
38 end_page(true);