Skip to content

Commit

Permalink
Merge pull request #9 from james-lsn/master
Browse files Browse the repository at this point in the history
Clean up Includes and add PHP 5.3.2+ requirement to readme
  • Loading branch information
James committed Aug 16, 2013
2 parents bf7c000 + 7be54b4 commit 84575c1
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 49 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This project is [Composer Enabled](http://getcomposer.org/).
* Twitter OAuth (https://github.com/abraham/twitteroauth) available in your PHP include path


To automatically fetch the prerequisites, run the command
To automatically fetch the prerequisites, you must have PHP 5.3.2+ and run the command

```php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));" && ./composer.phar install```

Expand Down
4 changes: 1 addition & 3 deletions includes/authentication.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,4 @@ function logout() {
$_SESSION = array();
return true;
}
}

?>
}
9 changes: 7 additions & 2 deletions includes/base.inc.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

include('config.php');
require_once('config.php');

require_once('../vendor/autoload.php');

Expand All @@ -13,5 +13,10 @@
require_once('template.inc.php');
require_once('status.class.php');
require_once('facilities.class.php');
require_once('twitter.class.php');
require_once('authentication.class.php');
require_once('users.class.php');

?>
if (!class_exists('Smarty')) {
require_once('smarty/Smarty.class.php');
}
3 changes: 1 addition & 2 deletions includes/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@
'heading' => 'Get Support',
'text' => 'Having service issues? In the event that our ticketing system is offline we will monitor emails sent to <a href="mailto:[email protected]">[email protected]</a>. Please be advised that unless our ticketing system is inaccessable this mail box is not actively monitored and you should <a href="https://example.com/support/newticket.html" target="_blank">open a ticket</a> for support.'
);
$config['smarty_debug'] = false;
?>
$config['smarty_debug'] = false;
4 changes: 1 addition & 3 deletions includes/database.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,4 @@ function initialize() {
$this->sqlite->query("CREATE INDEX incidents_updates_incidents_id ON incidents_updates(incidents_id)");
}
}
}

?>
}
4 changes: 1 addition & 3 deletions includes/facilities.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ function getFacilities() {

return $row;
}
}

?>
}
8 changes: 3 additions & 5 deletions includes/status.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function newIncident($data) {
}

if (!empty($data['twitter'])) {
require_once('twitter.class.php');

$twitter = new Twitter;
$twitter->tweet("{$twitter_prefix} {$data['title']}");

Expand Down Expand Up @@ -155,7 +155,7 @@ function newUpdate($data) {
$insert = $sql->execute();

if ($data['twitterpost']) {
require_once('twitter.class.php');

$twitter = new Twitter;
$twitter->tweet($data['message']);
}
Expand Down Expand Up @@ -276,6 +276,4 @@ function getSummary($facilities_id, $days, $shortdate = false) {
return $summary;
}

}

?>
}
7 changes: 1 addition & 6 deletions includes/template.inc.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?php

if (!class_exists('Smarty')) {
require_once('smarty/Smarty.class.php');
}

$smarty = new Smarty();

$smarty->template_dir = "{$config['app_path']}/public/templates/{$config['template_name']}";
Expand All @@ -16,5 +12,4 @@
$smarty->assign('footer_links', $config['footer_links']);
$smarty->assign('textarea', $config['textarea']);

if ($config['smarty_debug']) $smarty->debugging = true;
?>
if ($config['smarty_debug']) $smarty->debugging = true;
4 changes: 1 addition & 3 deletions includes/twitter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,4 @@ private function prepareMessage($message, $limit = 137) {

return $message;
}
}

?>
}
3 changes: 1 addition & 2 deletions includes/users.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ private function userExistsByUsername($name) {
$result = (empty($users)) ? false : true;
return $result;
}
}
?>
}
5 changes: 2 additions & 3 deletions public/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include('../includes/base.inc.php');
require_once('../includes/base.inc.php');

if (!empty($_SESSION['auth']['id'])) {
if (!empty($_POST)) {
Expand Down Expand Up @@ -49,5 +49,4 @@

$smarty->display('_header.tpl');
$smarty->display('index.tpl');
$smarty->display('_footer.tpl');
?>
$smarty->display('_footer.tpl');
7 changes: 3 additions & 4 deletions public/login.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include('../includes/base.inc.php');
include('../includes/authentication.class.php');
require_once('../includes/base.inc.php');

$auth = new Authentication;

if (isset($_POST['username'], $_POST['password'])) {
Expand All @@ -12,5 +12,4 @@

$smarty->display('_header.tpl');
$smarty->display('login.tpl');
$smarty->display('_footer.tpl');
?>
$smarty->display('_footer.tpl');
7 changes: 3 additions & 4 deletions public/logout.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
include('../includes/base.inc.php');
include('../includes/authentication.class.php');
require_once('../includes/base.inc.php');

$auth = new Authentication;

$auth->logout();
header('Location: index.php');
?>
header('Location: index.php');
4 changes: 1 addition & 3 deletions public/save.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
require_once('../includes/base.inc.php');
require_once('../includes/status.class.php');

if (!empty($_SESSION['auth']['id'])) {
if (isset($_POST)) {
Expand Down Expand Up @@ -35,5 +34,4 @@

}
}
}
?>
}
Binary file removed public/templates/default/images/content_bg.jpg
Binary file not shown.
8 changes: 3 additions & 5 deletions public/users.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
include('../includes/base.inc.php');
include('../includes/users.class.php');
include('../includes/authentication.class.php');
require_once('../includes/base.inc.php');

$auth = new Authentication;
$users = new Users;

Expand Down Expand Up @@ -43,5 +42,4 @@

$smarty->display('_header.tpl');
$smarty->display('users.tpl');
$smarty->display('_footer.tpl');
?>
$smarty->display('_footer.tpl');

0 comments on commit 84575c1

Please sign in to comment.