From 4285770bb31a6f300fb9856a1f0665f9e0eacdfd Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Fri, 29 Jun 2012 00:32:03 -0400
Subject: [PATCH] Allow admin to view logs during upgrade process

---
 include/upgrader/aborted.inc.php | 4 +++-
 scp/admin.inc.php                | 8 ++++----
 scp/staff.inc.php                | 2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/upgrader/aborted.inc.php b/include/upgrader/aborted.inc.php
index b8fad7034..3402bb904 100644
--- a/include/upgrader/aborted.inc.php
+++ b/include/upgrader/aborted.inc.php
@@ -20,13 +20,15 @@ if(!defined('OSTSCPINC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access D
             echo '<b><font color="red">Internal error occurred - get technical help.</font></b>';
         }
         ?>
+        <p><b>For detailed - please view <a href="logs.php">system logs</a></b></p>
+        <br>
         <p>Please, refer to the <a target="_blank" href="http://osticket.com/wiki/Upgrade_and_Migration">Upgrade Guide</a> on the wiki for more information.</p>
     </div>
     <p><strong>Need Help?</strong> We provide <a target="_blank" href="http://osticket.com/support/professional_services.php"><u>professional upgrade services</u></a> and commercial support. <a target="_blank" href="http://osticket.com/support/">Contact us</a> today for <u>expedited</u> help.</p>
   </div>    
   <div id="sidebar">
     <h3>What to do?</h3>
-    <p>Restore your previous version from backup and try again or <a target="_blank" href="http://osticket.com/support/">seek help</a>.</p>    
+    <p>Restore your previous version from backup and try again or <a target="_blank" href="http://osticket.com/support/">seek help</a>.</p>
   </div>
   <div class="clear"></div>
 </div>
diff --git a/scp/admin.inc.php b/scp/admin.inc.php
index fe14f5c97..acd63ed41 100644
--- a/scp/admin.inc.php
+++ b/scp/admin.inc.php
@@ -27,11 +27,11 @@ define('ADMINPAGE',TRUE);   //Used by the header to swap menus.
 //Some security related warnings - bitch until fixed!!! :)
 if($ost->isUpgradePending()) {
     $errors['err']=$sysnotice='System upgrade is pending <a href="upgrade.php">Upgrade Now</a>';
-    if(basename($_SERVER['SCRIPT_NAME'])!='upgrade.php')
+    if(!in_array(basename($_SERVER['SCRIPT_NAME']), array('upgrade.php', 'logs.php'))) {
         header('Location: upgrade.php');
-    
-    require('upgrade.php');
-    exit;
+        require('upgrade.php');
+        exit;
+    }
 } else {
     
     if(file_exists('../setup/')) {
diff --git a/scp/staff.inc.php b/scp/staff.inc.php
index 490be1457..93b290a7b 100644
--- a/scp/staff.inc.php
+++ b/scp/staff.inc.php
@@ -92,7 +92,7 @@ $errors=array();
 $msg=$warn=$sysnotice='';
 $tabs=array();
 $submenu=array();
-$exempt = in_array(basename($_SERVER['SCRIPT_NAME']), array('logout.php','ajax.php'));
+$exempt = in_array(basename($_SERVER['SCRIPT_NAME']), array('logout.php', 'ajax.php', 'logs.php'));
 
 if($ost->isUpgradePending() && !$exempt) {
     $errors['err']=$sysnotice='System upgrade is pending <a href="upgrade.php">Upgrade Now</a>';
-- 
GitLab