Skip to content

Commit fe276ed

Browse files
committed
Resolving issue #58
1 parent 422f93e commit fe276ed

File tree

10 files changed

+60
-8
lines changed

10 files changed

+60
-8
lines changed

items.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
chdir('../../');
2626

2727
include_once('./include/auth.php');
28+
29+
if (!defined('REPORTIT_BASE_PATH')) {
30+
include_once(__DIR__ . '/setup.php');
31+
reportit_define_constants();
32+
}
33+
2834
include_once(REPORTIT_BASE_PATH . '/lib/funct_validate.php');
2935
include_once(REPORTIT_BASE_PATH . '/lib/funct_online.php');
3036
include_once(REPORTIT_BASE_PATH . '/lib/funct_shared.php');

measurands.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
chdir('../../');
2626

2727
include_once('./include/auth.php');
28+
29+
if (!defined('REPORTIT_BASE_PATH')) {
30+
include_once(__DIR__ . '/setup.php');
31+
reportit_define_constants();
32+
}
33+
2834
include_once(REPORTIT_BASE_PATH . '/lib/funct_validate.php');
2935
include_once(REPORTIT_BASE_PATH . '/lib/funct_html.php');
3036
include_once(REPORTIT_BASE_PATH . '/lib/funct_online.php');

reports.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
chdir('../../');
2626

2727
include_once('./include/auth.php');
28+
29+
if (!defined('REPORTIT_BASE_PATH')) {
30+
include_once(__DIR__ . '/setup.php');
31+
reportit_define_constants();
32+
}
33+
2834
include_once(REPORTIT_BASE_PATH . '/lib/funct_validate.php');
2935
include_once(REPORTIT_BASE_PATH . '/lib/funct_online.php');
3036
include_once(REPORTIT_BASE_PATH . '/lib/const_runtime.php');

rrdlist.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@
2525
chdir('../../');
2626

2727
include_once('./include/auth.php');
28-
include_once($config['base_path'] . '/plugins/reportit/lib/funct_validate.php');
29-
include_once($config['base_path'] . '/plugins/reportit/lib/funct_online.php');
30-
include_once($config['base_path'] . '/plugins/reportit/lib/funct_shared.php');
31-
include_once($config['base_path'] . '/plugins/reportit/lib/funct_html.php');
32-
include_once($config['base_path'] . '/plugins/reportit/lib/const_runtime.php');
33-
include_once($config['base_path'] . '/plugins/reportit/lib/const_rrdlist.php');
28+
29+
if (!defined('REPORTIT_BASE_PATH')) {
30+
include_once(__DIR__ . '/setup.php');
31+
reportit_define_constants();
32+
}
33+
34+
include_once(REPORTIT_BASE_PATH . 'lib/funct_validate.php');
35+
include_once(REPORTIT_BASE_PATH . 'lib/funct_online.php');
36+
include_once(REPORTIT_BASE_PATH . 'lib/funct_shared.php');
37+
include_once(REPORTIT_BASE_PATH . 'lib/funct_html.php');
38+
include_once(REPORTIT_BASE_PATH . 'lib/const_runtime.php');
39+
include_once(REPORTIT_BASE_PATH . 'lib/const_rrdlist.php');
3440

3541
set_default_action();
3642

run.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
chdir('../../');
2626

2727
include_once('./include/auth.php');
28+
29+
if (!defined('REPORTIT_BASE_PATH')) {
30+
include_once(__DIR__ . '/setup.php');
31+
reportit_define_constants();
32+
}
33+
2834
include_once(REPORTIT_BASE_PATH . '/lib/funct_validate.php');
2935
include_once(REPORTIT_BASE_PATH . '/lib/funct_shared.php');
3036
include_once(REPORTIT_BASE_PATH . '/lib/funct_online.php');

runtime.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
$email_counter = 0;
3939
$export_counter = 0;
4040

41+
if (!defined('REPORTIT_BASE_PATH')) {
42+
include_once(__DIR__ . '/setup.php');
43+
reportit_define_constants();
44+
}
4145

4246
//----- Running on CLI? -----
4347
if(isset($_SERVER['argv']['0']) && realpath($_SERVER['argv']['0']) == __FILE__) {

setup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ function reportit_draw_navigation_text ($nav) {
348348
function reportit_config_arrays() {
349349
global $user_auth_realms, $user_auth_realm_filenames, $menu, $messages;
350350

351+
reportit_define_constants();
352+
351353
/* register all realms of ReportIt */
352354
api_plugin_register_realm('reportit', 'view.php,charts.php', __('View Reports'), 1);
353355
api_plugin_register_realm('reportit', 'reports.php,rrdlist.php,items.php,run.php', __('Create Reports'), 1);
@@ -374,8 +376,6 @@ function reportit_config_arrays() {
374376
}
375377

376378
function reportit_config_settings() {
377-
reportit_define_constants();
378-
379379
global $tabs, $tabs_graphs, $settings, $graph_dateformats, $graph_datechar, $settings_graphs, $config;
380380

381381
/* presets */

templates.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
chdir('../../');
2626

2727
include_once('./include/auth.php');
28+
29+
if (!defined('REPORTIT_BASE_PATH')) {
30+
include_once(__DIR__ . '/setup.php');
31+
reportit_define_constants();
32+
}
33+
2834
include_once(REPORTIT_BASE_PATH . '/lib/funct_validate.php');
2935
include_once(REPORTIT_BASE_PATH . '/lib/funct_online.php');
3036
include_once(REPORTIT_BASE_PATH . '/lib/funct_shared.php');

variables.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
chdir('../../');
2626

2727
include_once('./include/auth.php');
28+
29+
if (!defined('REPORTIT_BASE_PATH')) {
30+
include_once(__DIR__ . '/setup.php');
31+
reportit_define_constants();
32+
}
33+
2834
include_once(REPORTIT_BASE_PATH . '/lib/funct_validate.php');
2935
include_once(REPORTIT_BASE_PATH . '/lib/funct_html.php');
3036
include_once(REPORTIT_BASE_PATH . '/lib/funct_online.php');

view.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
$guest_account = true;
2929

3030
include_once('./include/auth.php');
31+
32+
if (!defined('REPORTIT_BASE_PATH')) {
33+
include_once(__DIR__ . '/setup.php');
34+
reportit_define_constants();
35+
}
36+
3137
include_once(REPORTIT_BASE_PATH . '/lib/funct_validate.php');
3238
include_once(REPORTIT_BASE_PATH . '/lib/funct_shared.php');
3339
include_once(REPORTIT_BASE_PATH . '/lib/funct_html.php');

0 commit comments

Comments
 (0)