Example #1
0
 public function Step1()
 {
     Theme::Set('form_action', 'install.php');
     // Check environment
     $config = new Config();
     $environment = $config->CheckEnvironment();
     $formFields = array();
     $formButtons = array();
     $formFields[] = FormManager::AddMessage(sprintf(__("First we need to check if your server meets %s's requirements."), Theme::GetConfig('app_name')));
     $formFields[] = FormManager::AddRaw($environment);
     if ($config->EnvironmentFault()) {
         $formFields[] = FormManager::AddHidden('step', 1);
         $formButtons[] = FormManager::AddButton(__('Retest'));
     } else {
         if ($config->EnvironmentWarning()) {
             $formFields[] = FormManager::AddHidden('step', 2);
             $formButtons[] = FormManager::AddButton(__('Retest'), 'link', 'install.php?step=1');
             $formButtons[] = FormManager::AddButton(__('Next'));
         } else {
             $formFields[] = FormManager::AddHidden('step', 2);
             $formButtons[] = FormManager::AddButton(__('Next'));
         }
     }
     // Return a rendered form
     Theme::Set('form_fields', $formFields);
     Theme::Set('form_buttons', $formButtons);
     return Theme::RenderReturn('form_render');
 }
Example #2
0
 public function Step1()
 {
     Theme::Set('form_action', 'index.php?p=upgrade');
     // Check environment
     $config = new Config();
     $environment = $config->CheckEnvironment();
     $formFields = array();
     $formButtons = array();
     $formFields[] = FormManager::AddMessage(sprintf(__('First we need to re-check if your server meets %s\'s requirements. The CMS requirements may change from release to release. If this is the case there will be further information in the release notes.'), Theme::GetConfig('app_name')));
     $formFields[] = FormManager::AddRaw($environment);
     if ($config->EnvironmentFault()) {
         $formFields[] = FormManager::AddHidden('step', 1);
         $formButtons[] = FormManager::AddButton(__('Retest'));
     } else {
         if ($config->EnvironmentWarning()) {
             $formFields[] = FormManager::AddHidden('step', 2);
             $formButtons[] = FormManager::AddButton(__('Retest'), 'link', 'index.php?p=upgrade&step=1');
             $formButtons[] = FormManager::AddButton(__('Next'));
         } else {
             $formFields[] = FormManager::AddHidden('step', 2);
             $formButtons[] = FormManager::AddButton(__('Next'));
         }
     }
     // Return a rendered form
     Theme::Set('form_fields', $formFields);
     Theme::Set('form_buttons', $formButtons);
     return Theme::RenderReturn('form_render');
 }
Example #3
0
    function CollectData()
    {
        $db =& $this->db;
        // We want to output a load of stuff to the browser as a text file.
        header('Content-Type: text/plain');
        header('Content-Disposition: attachment; filename="troubleshoot.txt"');
        header("Content-Transfer-Encoding: binary");
        header('Accept-Ranges: bytes');
        $config = new Config();
        echo "--------------------------------------\n";
        echo 'Environment Checks' . "\n";
        echo "--------------------------------------\n";
        echo $config->CheckEnvironment();
        echo "\n";
        echo "--------------------------------------\n";
        echo 'PHP INFO' . "\n";
        echo "--------------------------------------\n";
        $this->phpinfo_array();
        echo "\n";
        echo "--------------------------------------\n";
        echo 'LOG Dump' . "\n";
        echo "--------------------------------------\n";
        // Get the last 10 minutes of log messages
        $SQL = "SELECT logdate, page, function, message FROM log ";
        $SQL .= sprintf("WHERE logdate > '%s' ", date("Y-m-d H:i:s", time() - 60 * 10));
        $SQL .= "ORDER BY logdate DESC, logid ";
        if (!($results = $db->query($SQL))) {
            trigger_error($db->error());
            trigger_error("Can not query the log", E_USER_ERROR);
        }
        while ($row = $db->get_row($results)) {
            $logdate = Kit::ValidateParam($row[0], _STRING);
            $page = Kit::ValidateParam($row[1], _STRING);
            $function = Kit::ValidateParam($row[2], _STRING);
            $message = Kit::ValidateParam($row[3], _HTMLSTRING);
            $output = <<<END
Date: {$logdate}
Page: {$page}
Function: {$function}
Message: {$message}


END;
            echo $output;
        }
        echo "\n";
        echo "--------------------------------------\n";
        echo 'Display Dump' . "\n";
        echo "--------------------------------------\n";
        $SQL = <<<SQL
\t\tSELECT  display.displayid, 
\t\t\t\tdisplay.display, 
\t\t\t\tlayout.layout, 
\t\t\t\tdisplay.loggedin, 
\t\t\t\tdisplay.lastaccessed, 
\t\t\t\tdisplay.inc_schedule ,
\t\t\t\tdisplay.licensed
\t\tFROM display
\t\tLEFT OUTER JOIN layout ON layout.layoutid = display.defaultlayoutid
\t\tORDER BY display.displayid
SQL;
        if (!($results = $db->query($SQL))) {
            trigger_error($db->error());
            trigger_error("Can not list displays", E_USER_ERROR);
        }
        while ($aRow = $db->get_row($results)) {
            $displayid = $aRow[0];
            $display = $aRow[1];
            $defaultlayoutid = $aRow[2];
            $loggedin = $aRow[3];
            $lastaccessed = $aRow[4];
            $inc_schedule = $aRow[5];
            $licensed = $aRow[6];
            $output = <<<END
DisplayID: {$displayid}
Display: {$display}
Default Layout: {$defaultlayoutid}
Logged In: {$loggedin}
Last Accessed: {$lastaccessed}
Interleave: {$inc_schedule}
Licensed: {$licensed}


END;
            echo $output;
        }
        echo "\n";
        echo "--------------------------------------\n";
        echo 'Settings Dump' . "\n";
        echo "--------------------------------------\n";
        $SQL = <<<SQL
\t\tSELECT  *
\t\tFROM setting
\t\tWHERE setting NOT IN ('SERVER_KEY','PHONE_HOME_KEY')
SQL;
        if (!($results = $db->query($SQL))) {
            trigger_error($db->error());
            trigger_error("Can not list Settings", E_USER_ERROR);
        }
        while ($row = $db->get_assoc_row($results)) {
            $setting = $row['setting'];
            $value = $row['value'];
            $output = <<<END
Setting: {$setting} - Value:   {$value}


END;
            echo $output;
        }
        echo "\n";
        echo "--------------------------------------\n";
        echo 'Sessions Dump' . "\n";
        echo "--------------------------------------\n";
        $SQL = <<<SQL
\t\tSELECT  *
\t\tFROM session
\t\tWHERE IsExpired = 0
SQL;
        if (!($results = $db->query($SQL))) {
            trigger_error($db->error());
            trigger_error("Can not list sessions", E_USER_ERROR);
        }
        while ($row = $db->get_assoc_row($results)) {
            $userAgent = $row['UserAgent'];
            $remoteAddress = $row['RemoteAddr'];
            $sessionData = $row['session_data'];
            $output = <<<END
UserAgent: {$userAgent}
RemoteAddress: {$remoteAddress}
Session Data
{$sessionData}
----


END;
            echo $output;
        }
        exit;
    }
Example #4
0
    ?>
 ></button></div>
  </form>
  <?php 
} elseif ($xibo_step == 1) {
    # Check environment
    $db = new Database();
    $cObj = new Config();
    ?>
  <p><?php 
    echo __("First we need to check if your server meets Xibo's requirements.");
    ?>
</p>
  <div class="checks">
  <?php 
    echo $cObj->CheckEnvironment();
    if ($cObj->EnvironmentFault()) {
        ?>
      <form action="install.php" method="POST">
        <input type="hidden" name="xibo_step" value="1" />
        <div class="loginbutton"><button type="submit"><?php 
        echo __("Retest");
        ?>
</button></div>
      </form>
    <?php 
    } else {
        if ($cObj->EnvironmentWarning()) {
            ?>
      <form action="install.php" method="POST">
        <input type="hidden" name="xibo_step" value="1" />