Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
maintenance mode template
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabeel Shahzad committed Mar 25, 2011
1 parent c1ee072 commit 9869471
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 5 deletions.
7 changes: 3 additions & 4 deletions core/bootstrap.inc.php
Expand Up @@ -72,10 +72,9 @@ function post_module_load() {
// @TODO: Clean ACARS records older than one month
if (Config::Get('MAINTENANCE_MODE') == true && !Auth::LoggedIn() && !
PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN)) {
echo '<html><head><title>Down for maintenance - ' . SITE_NAME .
'</title></head><body>';
Debug::showCritical(Config::Get('MAINTENANCE_MESSAGE'), 'Down for maintenance');
echo '</body></html>';

Template::Show('maintenance.tpl');

die();
}

Expand Down
16 changes: 16 additions & 0 deletions core/templates/maintenance.tpl
@@ -0,0 +1,16 @@
<html>
<head>
<title>Down for maintenance - phpVMS Virtual Airline</title>
<style type="text/css">
body { font-family: verdana; font-size: 16px; color: #001B6B }
h1 { font-weight:16px;font-size:18px;color:#6B001B;margin:0 0 4px 0; }
div#codon_crit_error { border:#999 1px solid;background-color:#fff;padding:20px 20px 12px 20px;}
</style>
</head>
<body>
<div id="codon_crit_error" >
<h1>Down for maintenance</h1>
<p>We are currently down for maintenance, please check back soon.</p>
</div>
</body>
</html>
75 changes: 75 additions & 0 deletions unittest/Tests/InstallTest.php
@@ -0,0 +1,75 @@
<?php
/**
* phpVMS - Virtual Airline Administration Software
* Copyright (c) 2008 Nabeel Shahzad
* For more information, visit www.phpvms.net
* Forums: http://www.phpvms.net/forum
* Documentation: http://www.phpvms.net/docs
*
* phpVMS is licenced under the following license:
* Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
* View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/
*
* @author Nabeel Shahzad
* @copyright Copyright (c) 2008, Nabeel Shahzad
* @link http://www.phpvms.net
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/
*/

class InstallTest extends PHPUnit_Framework_TestCase {

/**
* Ensure that all database tables are included as designed
*
* @return void
*/
public function testDatabaseTables() {

if (!file_exists(SITE_ROOT.'/install/structure.xml')) {
$this->markTestSkipped('The install folder is unavailable, can\'t run this test.');
}

$db = simplexml_load_file(SITE_ROOT.'/install/structure.xml');

foreach($db->database->table_structure as $table) {

$tablename = str_replace('phpvms_', TABLE_PREFIX, $table['name']);

DB::query('SELECT * FROM '.$tablename.' WHERE 1=1 LIMIT 1');

$this->assertNotEquals('1146', DB::errno(), "\"{$tablename}\" is missing");
if(DB::$errno == '1146') {
continue;
}

/* loop through all the columns returned by the above query and all the columns
from the fields in the xml file, and make sure they all match up, with the
fieldlist from the xml being the "master" outside loop which it looks up against */
$anyerrors = false;
$colinfo = DB::$DB->col_info;
foreach($table->field as $field) {
$found = false;
foreach($colinfo as $column) {
if($column->name == $field['Field']) {
$found = true;
break;
}
}

$this->assertTrue($found, "Column {$field['Field']} from {$tablename} missing");
}
}
}

/**
* Check if all the files on the server are valid
*
* @return void
*/
public function testInstallFiles() {

#$this->markTestSkipped('Install files check');

}

}
1 change: 0 additions & 1 deletion unittest/Tests/SchedulePIREPTest.php
Expand Up @@ -265,7 +265,6 @@ public function testPIREPPerHourPay() {
$sched = $this->findSchedule();
$this->assertEquals(0, $sched->payforflight, 'Pay per-flight set to 0');


$pirep_test = array(
'pilotid' => $this->samplePilotID,
'code' => $sched->code,
Expand Down
1 change: 1 addition & 0 deletions unittest/web
Submodule web added at 66c0a0

0 comments on commit 9869471

Please sign in to comment.