summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Kaspar Rudert (mortzu) <me@mortzu.de>2014-09-08 08:38:08 +0200
committerMoritz Kaspar Rudert (mortzu) <me@mortzu.de>2014-09-08 08:38:08 +0200
commit27b82236115df5db560e7015248574575441a551 (patch)
tree5241530d84c75068863b875d7712fbea7f81e16b
parentda49eeda6e719d7d9449fcb4cfaed2464100221c (diff)
removed bootstrap.php
-rw-r--r--db/update.php10
-rw-r--r--includes/controller/shifts_controller.php2
-rw-r--r--includes/pages/user_ical.php2
-rw-r--r--public/bootstrap.php10
-rw-r--r--public/index.php142
5 files changed, 78 insertions, 88 deletions
diff --git a/db/update.php b/db/update.php
index 992ce715..ad72ec05 100644
--- a/db/update.php
+++ b/db/update.php
@@ -1,9 +1,9 @@
<?php
-require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'bootstrap.php');
-require_once ('includes/mysql_provider.php');
-require_once('config/config.default.php');
-if(file_exists('config/config.php'))
- require_once ('config/config.php');
+
+require_once realpath(__DIR__ . '/../includes/mysql_provider.php');
+require_once realpath(__DIR__ . '/../config/config.default.php');
+if(file_exists(realpath(__DIR__ . '/../config/config.php')))
+ require_once realpath(__DIR__ . '/../config/config.php');
sql_connect($config['host'], $config['user'], $config['pw'], $config['db']);
error_reporting(E_ALL | E_NOTICE);
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php
index 6e5b71fd..868e903b 100644
--- a/includes/controller/shifts_controller.php
+++ b/includes/controller/shifts_controller.php
@@ -45,7 +45,7 @@ function shifts_json_export_controller() {
die("No privilege for shifts_json_export.");
if (isset($_REQUEST['export']) && $_REQUEST['export'] == 'user_shifts') {
- require_once ('includes/pages/user_shifts.php');
+ require_once realpath(__DIR__ . '/../pages/user_shifts.php');
view_user_shifts();
} else {
$ical_shifts = sql_select("SELECT `Shifts`.*, `Room`.`Name` as `room_name` FROM `ShiftEntry` INNER JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`) INNER JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`) WHERE `UID`=" . sql_escape($user['UID']) . " ORDER BY `start`");
diff --git a/includes/pages/user_ical.php b/includes/pages/user_ical.php
index 384979d7..911f48aa 100644
--- a/includes/pages/user_ical.php
+++ b/includes/pages/user_ical.php
@@ -19,7 +19,7 @@ function user_ical() {
die("No privilege for ical.");
if (isset ($_REQUEST['export']) && $_REQUEST['export'] == 'user_shifts') {
- require_once ('includes/pages/user_shifts.php');
+ require_once realpath(__DIR__ . '/user_shifts.php');
view_user_shifts();
} else {
$ical_shifts = sql_select("SELECT `Shifts`.*, `Room`.`Name` as `room_name` FROM `ShiftEntry` INNER JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`) INNER JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`) WHERE `UID`=" . sql_escape($user['UID']) . " ORDER BY `start`");
diff --git a/public/bootstrap.php b/public/bootstrap.php
deleted file mode 100644
index 2b8e6aba..00000000
--- a/public/bootstrap.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-// path and include settings
-$rootpath = __DIR__ . DIRECTORY_SEPARATOR . '..';
-define('ROOTPATH', $rootpath);
-
-$includePath = ini_get('include_path');
-$includePath .= PATH_SEPARATOR . ROOTPATH;
-
-ini_set('include_path', $includePath);
-?>
diff --git a/public/index.php b/public/index.php
index 604d9ed1..7fe6671c 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,63 +1,62 @@
<?php
-require_once ('bootstrap.php');
-
-require_once ('includes/mysql_provider.php');
-
-require_once ('includes/sys_auth.php');
-require_once ('includes/sys_counter.php');
-require_once ('includes/sys_log.php');
-require_once ('includes/sys_menu.php');
-require_once ('includes/sys_page.php');
-require_once ('includes/sys_template.php');
-
-require_once ('includes/model/AngelType_model.php');
-require_once ('includes/model/LogEntries_model.php');
-require_once ('includes/model/Message_model.php');
-require_once ('includes/model/NeededAngelTypes_model.php');
-require_once ('includes/model/Room_model.php');
-require_once ('includes/model/ShiftEntry_model.php');
-require_once ('includes/model/Shifts_model.php');
-require_once ('includes/model/UserAngelTypes_model.php');
-require_once ('includes/model/UserGroups_model.php');
-require_once ('includes/model/User_model.php');
-
-require_once ('includes/view/AngelTypes_view.php');
-require_once ('includes/view/Questions_view.php');
-require_once ('includes/view/Shifts_view.php');
-require_once ('includes/view/ShiftEntry_view.php');
-require_once ('includes/view/UserAngelTypes_view.php');
-require_once ('includes/view/User_view.php');
-
-require_once ('includes/controller/angeltypes_controller.php');
-require_once ('includes/controller/users_controller.php');
-require_once ('includes/controller/user_angeltypes_controller.php');
-
-require_once ('includes/helper/internationalization_helper.php');
-require_once ('includes/helper/message_helper.php');
-require_once ('includes/helper/error_helper.php');
-require_once ('includes/helper/email_helper.php');
-
-require_once ('config/config.default.php');
-if (file_exists('../config/config.php'))
- require_once ('config/config.php');
-
-require_once ('includes/pages/admin_active.php');
-require_once ('includes/pages/admin_arrive.php');
-require_once ('includes/pages/admin_free.php');
-require_once ('includes/pages/admin_groups.php');
-require_once ('includes/pages/admin_import.php');
-require_once ('includes/pages/admin_log.php');
-require_once ('includes/pages/admin_questions.php');
-require_once ('includes/pages/admin_rooms.php');
-require_once ('includes/pages/admin_shifts.php');
-require_once ('includes/pages/admin_user.php');
-require_once ('includes/pages/guest_login.php');
-require_once ('includes/pages/user_messages.php');
-require_once ('includes/pages/user_myshifts.php');
-require_once ('includes/pages/user_news.php');
-require_once ('includes/pages/user_questions.php');
-require_once ('includes/pages/user_settings.php');
-require_once ('includes/pages/user_shifts.php');
+
+require_once realpath(__DIR__ . '/../includes/mysql_provider.php');
+
+require_once realpath(__DIR__ . '/../includes/sys_auth.php');
+require_once realpath(__DIR__ . '/../includes/sys_counter.php');
+require_once realpath(__DIR__ . '/../includes/sys_log.php');
+require_once realpath(__DIR__ . '/../includes/sys_menu.php');
+require_once realpath(__DIR__ . '/../includes/sys_page.php');
+require_once realpath(__DIR__ . '/../includes/sys_template.php');
+
+require_once realpath(__DIR__ . '/../includes/model/AngelType_model.php');
+require_once realpath(__DIR__ . '/../includes/model/LogEntries_model.php');
+require_once realpath(__DIR__ . '/../includes/model/Message_model.php');
+require_once realpath(__DIR__ . '/../includes/model/NeededAngelTypes_model.php');
+require_once realpath(__DIR__ . '/../includes/model/Room_model.php');
+require_once realpath(__DIR__ . '/../includes/model/ShiftEntry_model.php');
+require_once realpath(__DIR__ . '/../includes/model/Shifts_model.php');
+require_once realpath(__DIR__ . '/../includes/model/UserAngelTypes_model.php');
+require_once realpath(__DIR__ . '/../includes/model/UserGroups_model.php');
+require_once realpath(__DIR__ . '/../includes/model/User_model.php');
+
+require_once realpath(__DIR__ . '/../includes/view/AngelTypes_view.php');
+require_once realpath(__DIR__ . '/../includes/view/Questions_view.php');
+require_once realpath(__DIR__ . '/../includes/view/Shifts_view.php');
+require_once realpath(__DIR__ . '/../includes/view/ShiftEntry_view.php');
+require_once realpath(__DIR__ . '/../includes/view/UserAngelTypes_view.php');
+require_once realpath(__DIR__ . '/../includes/view/User_view.php');
+
+require_once realpath(__DIR__ . '/../includes/controller/angeltypes_controller.php');
+require_once realpath(__DIR__ . '/../includes/controller/users_controller.php');
+require_once realpath(__DIR__ . '/../includes/controller/user_angeltypes_controller.php');
+
+require_once realpath(__DIR__ . '/../includes/helper/internationalization_helper.php');
+require_once realpath(__DIR__ . '/../includes/helper/message_helper.php');
+require_once realpath(__DIR__ . '/../includes/helper/error_helper.php');
+require_once realpath(__DIR__ . '/../includes/helper/email_helper.php');
+
+require_once realpath(__DIR__ . '/../config/config.default.php');
+if (file_exists(realpath(__DIR__ . '/../config/config.php'))
+ require_once realpath(__DIR__ . '/../config/config.php');
+
+require_once realpath(__DIR__ . '/../includes/pages/admin_active.php');
+require_once realpath(__DIR__ . '/../includes/pages/admin_arrive.php');
+require_once realpath(__DIR__ . '/../includes/pages/admin_free.php');
+require_once realpath(__DIR__ . '/../includes/pages/admin_groups.php');
+require_once realpath(__DIR__ . '/../includes/pages/admin_import.php');
+require_once realpath(__DIR__ . '/../includes/pages/admin_log.php');
+require_once realpath(__DIR__ . '/../includes/pages/admin_questions.php');
+require_once realpath(__DIR__ . '/../includes/pages/admin_rooms.php');
+require_once realpath(__DIR__ . '/../includes/pages/admin_shifts.php');
+require_once realpath(__DIR__ . '/../includes/pages/admin_user.php');
+require_once realpath(__DIR__ . '/../includes/pages/guest_login.php');
+require_once realpath(__DIR__ . '/../includes/pages/user_messages.php');
+require_once realpath(__DIR__ . '/../includes/pages/user_myshifts.php');
+require_once realpath(__DIR__ . '/../includes/pages/user_news.php');
+require_once realpath(__DIR__ . '/../includes/pages/user_questions.php');
+require_once realpath(__DIR__ . '/../includes/pages/user_settings.php');
+require_once realpath(__DIR__ . '/../includes/pages/user_shifts.php');
require_once realpath(__DIR__ . '/../vendor/parsedown/Parsedown.php');
@@ -117,27 +116,27 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i
$content = "";
if ($p == "api") {
- require_once ('includes/controller/api.php');
+ require_once realpath(__DIR__ . '/../includes/controller/api.php');
error("Api disabled temporily.");
redirect(page_link_to('login'));
api_controller();
} elseif ($p == "ical") {
- require_once ('includes/pages/user_ical.php');
+ require_once realpath(__DIR__ . '/../includes/pages/user_ical.php');
user_ical();
} elseif ($p == "atom") {
- require_once ('includes/pages/user_atom.php');
+ require_once realpath(__DIR__ . '/../includes/pages/user_atom.php');
user_atom();
} elseif ($p == "shifts_json_export") {
- require_once ('includes/controller/shifts_controller.php');
+ require_once realpath(__DIR__ . '/../includes/controller/shifts_controller.php');
shifts_json_export_controller();
} elseif ($p == "shifts_json_export_all") {
- require_once ('includes/controller/shifts_controller.php');
+ require_once realpath(__DIR__ . '/../includes/controller/shifts_controller.php');
shifts_json_export_all_controller();
} elseif ($p == "stats") {
- require_once ('includes/pages/guest_stats.php');
+ require_once realpath(__DIR__ . '/../includes/pages/guest_stats.php');
guest_stats();
} elseif ($p == "user_password_recovery") {
- require_once ('includes/controller/users_controller.php');
+ require_once realpath(__DIR__ . '/../includes/controller/users_controller.php');
$title = user_password_recovery_title();
$content = user_password_recovery_controller();
} elseif ($p == "angeltypes") {
@@ -150,7 +149,7 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i
$title = news_title();
$content = user_news();
} elseif ($p == "news_comments") {
- require_once ('includes/pages/user_news.php');
+ require_once realpath(__DIR__ . '/../includes/pages/user_news.php');
$title = user_news_comments_title();
$content = user_news_comments();
} elseif ($p == "user_meetings") {
@@ -196,7 +195,7 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i
$title = admin_free_title();
$content = admin_free();
} elseif ($p == "admin_news") {
- require_once ('includes/pages/admin_news.php');
+ require_once realpath(__DIR__ . '/../includes/pages/admin_news.php');
$content = admin_news();
} elseif ($p == "admin_rooms") {
$title = admin_rooms_title();
@@ -205,7 +204,7 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i
$title = admin_groups_title();
$content = admin_groups();
} elseif ($p == "admin_language") {
- require_once ('includes/pages/admin_language.php');
+ require_once realpath(__DIR__ . '/../includes/pages/admin_language.php');
$content = admin_language();
} elseif ($p == "admin_import") {
$title = admin_import_title();
@@ -217,11 +216,11 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i
$title = admin_log_title();
$content = admin_log();
} elseif ($p == "credits") {
- require_once ('includes/pages/guest_credits.php');
+ require_once realpath(__DIR__ . '/../includes/pages/guest_credits.php');
$title = credits_title();
$content = guest_credits();
} else {
- require_once ('includes/pages/guest_start.php');
+ require_once realpath(__DIR__ . '/../includes/pages/guest_start.php');
$content = guest_start();
}
} else {
@@ -247,4 +246,5 @@ echo template_render('../templates/layout.html', array(
));
counter();
+
?>