diff --git a/block/all_bets.php b/block/all_bets.php index 49b2f13..b4a7a56 100644 --- a/block/all_bets.php +++ b/block/all_bets.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } diff --git a/block/bank.php b/block/bank.php index 79a8a42..fa0e7c1 100644 --- a/block/bank.php +++ b/block/bank.php @@ -7,6 +7,11 @@ * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + // Check Prediction League authorisation if ( !$this->auth->acl_get('u_use_football') ) { @@ -225,5 +230,3 @@ $template->assign_vars(array( 'POINTS' => $config['football_win_name'], ) ); - -?> \ No newline at end of file diff --git a/block/bet.php b/block/bet.php index 644f9e9..ec78f7e 100644 --- a/block/bet.php +++ b/block/bet.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -526,5 +526,3 @@ $template->assign_vars(array( 'S_DISPLAY_RATING' => $display_rating, ) ); - -?> \ No newline at end of file diff --git a/block/bet_popup.php b/block/bet_popup.php index 8b82199..1bd4d55 100644 --- a/block/bet_popup.php +++ b/block/bet_popup.php @@ -7,6 +7,11 @@ * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + // Can this user view Prediction Leagues pages? if (!$config['football_guest_view']) { @@ -389,4 +394,3 @@ $template->set_filenames(array( ); page_footer(); -?> \ No newline at end of file diff --git a/block/delivery.php b/block/delivery.php index fa74e02..8374473 100644 --- a/block/delivery.php +++ b/block/delivery.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -71,5 +71,3 @@ $template->assign_vars(array( 'S_DATA_DELIVERY' => $data_delivery, ) ); - -?> \ No newline at end of file diff --git a/block/dload_bank.php b/block/dload_bank.php index 3ec7888..b644b65 100644 --- a/block/dload_bank.php +++ b/block/dload_bank.php @@ -7,6 +7,11 @@ * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + $this->user->add_lang_ext('football/football', 'info_acp_bank'); // Check Prediction League authorisation diff --git a/block/dload_bank_open.php b/block/dload_bank_open.php index 7775523..36b1582 100644 --- a/block/dload_bank_open.php +++ b/block/dload_bank_open.php @@ -7,6 +7,11 @@ * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + $this->user->add_lang_ext('football/football', 'info_acp_bank'); // Check Prediction League authorisation @@ -96,4 +101,3 @@ else exit_handler(); } } -?> \ No newline at end of file diff --git a/block/dload_export.php b/block/dload_export.php index df11c12..7fdf1c9 100644 --- a/block/dload_export.php +++ b/block/dload_export.php @@ -7,6 +7,11 @@ * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + // Check Prediction League authorisation if ( !$this->auth->acl_get('u_use_football') ) { diff --git a/block/hist_popup.php b/block/hist_popup.php index ea53df7..989840e 100644 --- a/block/hist_popup.php +++ b/block/hist_popup.php @@ -7,6 +7,11 @@ * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + $vert = 9; $start = 22; $end = 28; @@ -1342,4 +1347,3 @@ $template->set_filenames(array( ); page_footer(); -?> \ No newline at end of file diff --git a/block/last_results.php b/block/last_results.php index f8e7ca0..7dce726 100644 --- a/block/last_results.php +++ b/block/last_results.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -146,5 +146,3 @@ $template->assign_vars(array( 'S_USER_IS_MEMBER' => $user_is_member, ) ); - -?> \ No newline at end of file diff --git a/block/last_users.php b/block/last_users.php index 36e233b..25d0543 100644 --- a/block/last_users.php +++ b/block/last_users.php @@ -62,5 +62,3 @@ $template->assign_vars(array( 'S_DISPLAY_LAST_USERS' => $display_last_users, 'S_LAST_USERS' => true, )); - -?> \ No newline at end of file diff --git a/block/my_bets.php b/block/my_bets.php index 17ce719..7718cc9 100644 --- a/block/my_bets.php +++ b/block/my_bets.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -320,5 +320,3 @@ $template->assign_vars(array( 'USERNAME' => $username, ) ); - -?> \ No newline at end of file diff --git a/block/my_chart.php b/block/my_chart.php index 7ef19fd..f04695c 100644 --- a/block/my_chart.php +++ b/block/my_chart.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -331,4 +331,3 @@ $template->assign_vars(array( 'USERNAME4' => $username4, ) ); -?> \ No newline at end of file diff --git a/block/my_koeff.php b/block/my_koeff.php index 64239e1..4643357 100644 --- a/block/my_koeff.php +++ b/block/my_koeff.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -382,5 +382,3 @@ $template->assign_vars(array( 'USERNAME' => $username, ) ); - -?> \ No newline at end of file diff --git a/block/my_points.php b/block/my_points.php index 64b3b03..64f976b 100644 --- a/block/my_points.php +++ b/block/my_points.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -195,4 +195,3 @@ $template->assign_vars(array( 'USERNAME' => $username, ) ); -?> \ No newline at end of file diff --git a/block/my_rank.php b/block/my_rank.php index 93dd4ae..bf8d124 100644 --- a/block/my_rank.php +++ b/block/my_rank.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -169,5 +169,3 @@ $template->assign_vars(array( 'USERNAME' => $username, ) ); - -?> \ No newline at end of file diff --git a/block/my_table.php b/block/my_table.php index 74de0d9..4b13767 100644 --- a/block/my_table.php +++ b/block/my_table.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -422,5 +422,3 @@ $template->assign_vars(array( 'USERNAME' => $username, ) ); - -?> \ No newline at end of file diff --git a/block/odds.php b/block/odds.php index a9ee894..f217007 100644 --- a/block/odds.php +++ b/block/odds.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -212,5 +212,3 @@ $template->assign_vars(array( 'S_DATA_ODDS' => $data_odds, ) ); - -?> \ No newline at end of file diff --git a/block/rank_matchday.php b/block/rank_matchday.php index fba4094..d16fcbd 100644 --- a/block/rank_matchday.php +++ b/block/rank_matchday.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } diff --git a/block/rank_total.php b/block/rank_total.php index 00e5aca..3fc4be5 100644 --- a/block/rank_total.php +++ b/block/rank_total.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -91,4 +91,3 @@ if ($league <> 0) ) ); } -?> \ No newline at end of file diff --git a/block/ranks_matchday.php b/block/ranks_matchday.php index d39221e..19f08b7 100644 --- a/block/ranks_matchday.php +++ b/block/ranks_matchday.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } diff --git a/block/ranks_total.php b/block/ranks_total.php index 3bee599..84fc7d8 100644 --- a/block/ranks_total.php +++ b/block/ranks_total.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } diff --git a/block/results.php b/block/results.php index 18f08db..ef6594c 100644 --- a/block/results.php +++ b/block/results.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -424,5 +424,3 @@ $template->assign_vars(array( 'S_EDIT_MODE' => $edit_mode, ) ); - -?> \ No newline at end of file diff --git a/block/rules_popup.php b/block/rules_popup.php index d14cddd..e108232 100644 --- a/block/rules_popup.php +++ b/block/rules_popup.php @@ -7,6 +7,11 @@ * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + // Can this user view Prediction Leagues pages? if (!$config['football_guest_view']) { diff --git a/block/side_table.php b/block/side_table.php index 6747241..327ac62 100644 --- a/block/side_table.php +++ b/block/side_table.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -142,4 +142,3 @@ else ) ); } -?> \ No newline at end of file diff --git a/block/stat_points.php b/block/stat_points.php index f8afd63..b5cc4a0 100644 --- a/block/stat_points.php +++ b/block/stat_points.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -160,5 +160,3 @@ $template->assign_vars(array( 'LEAGUE' => $league, ) ); - -?> \ No newline at end of file diff --git a/block/stat_results.php b/block/stat_results.php index 17d5d03..7c059b1 100644 --- a/block/stat_results.php +++ b/block/stat_results.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -136,5 +136,3 @@ $template->assign_vars(array( 'LEAGUE' => $league, ) ); - -?> \ No newline at end of file diff --git a/block/table.php b/block/table.php index 24e15fa..7945d52 100644 --- a/block/table.php +++ b/block/table.php @@ -7,7 +7,7 @@ * */ -if (!defined('IN_PHPBB') OR !defined('IN_FOOTBALL')) +if (!defined('IN_PHPBB')) { exit; } @@ -436,5 +436,3 @@ $template->assign_vars(array( 'TEXT_FORM' => $text_form, ) ); - -?> \ No newline at end of file diff --git a/block/under_construction.php b/block/under_construction.php index 47dbe12..270db24 100644 --- a/block/under_construction.php +++ b/block/under_construction.php @@ -8,7 +8,7 @@ * */ -if ( !defined('IN_PHPBB') OR !defined('IN_FOOTBALL') ) +if (!defined('IN_PHPBB')) { exit; } @@ -19,5 +19,3 @@ $template->assign_vars(array( 'S_DISPLAY_UNDER_CONSTRUCTION' => true, ) ); - -?> \ No newline at end of file diff --git a/block/viewplan_popup.php b/block/viewplan_popup.php index b0128da..973cfde 100644 --- a/block/viewplan_popup.php +++ b/block/viewplan_popup.php @@ -7,6 +7,11 @@ * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + // Can this user view Prediction Leagues pages? if (!$config['football_guest_view']) { @@ -293,5 +298,3 @@ $template->set_filenames(array( ); page_footer(); - -?> \ No newline at end of file diff --git a/composer.json b/composer.json index c30731a..0ff3a27 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "homepage" : "http://football.bplaced.net", "version" : "0.9.9", "time" : "2021-04-04", - "license" : "GPL-2.0", + "license" : "GPL-2.0-only", "authors" : [{ "name" : "J. Helmke", "email" : "phpBB3.football@gmx.de", diff --git a/controller/download.php b/controller/download.php index c93fcc9..6cf2829 100644 --- a/controller/download.php +++ b/controller/download.php @@ -122,7 +122,6 @@ class download { $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; trigger_error($message); - exit; } // Can this user view Prediction Leagues pages? diff --git a/controller/main.php b/controller/main.php index 5ea02f3..19560b3 100644 --- a/controller/main.php +++ b/controller/main.php @@ -137,7 +137,6 @@ class main { $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; trigger_error($message); - exit; } // Can this user view Prediction Leagues pages? diff --git a/controller/popup.php b/controller/popup.php index 4d31382..390b090 100644 --- a/controller/popup.php +++ b/controller/popup.php @@ -128,7 +128,6 @@ class popup { $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; trigger_error($message); - exit; } // Can this user view Prediction Leagues pages? diff --git a/controller/xmlplan.php b/controller/xmlplan.php index af56627..8d42f9a 100644 --- a/controller/xmlplan.php +++ b/controller/xmlplan.php @@ -105,7 +105,6 @@ class xmlplan { $message = (!empty($config['football_disable_msg'])) ? $config['football_disable_msg'] : 'FOOTBALL_DISABLED'; trigger_error($message); - exit; } diff --git a/cron/task/football_remember.php b/cron/task/football_remember.php index 52a9c4a..622469e 100644 --- a/cron/task/football_remember.php +++ b/cron/task/football_remember.php @@ -333,4 +333,3 @@ class football_remember extends \phpbb\cron\task\base } } } -?> \ No newline at end of file diff --git a/includes/chart_hist.php b/includes/chart_hist.php index 7a53faf..4fc3a0e 100644 --- a/includes/chart_hist.php +++ b/includes/chart_hist.php @@ -9,6 +9,11 @@ * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + $values1 = ( isset($_GET['v1']) ) ? $_GET['v1'] : 0; $graphvalues1 = explode(",",$values1); $matchdays = sizeof($graphvalues1); @@ -63,4 +68,3 @@ for ($i = 0; $i < $count_values; $i++) // Output graph and clear image from memory imagepng($image); imagedestroy($image); -?> diff --git a/includes/chart_points.php b/includes/chart_points.php index 945e6e9..1d9fa76 100644 --- a/includes/chart_points.php +++ b/includes/chart_points.php @@ -8,6 +8,11 @@ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + $matchdays = ( isset($_GET['m']) ) ? intval($_GET['m']) : 0; $values1 = ( isset($_GET['v1']) ) ? $_GET['v1'] : 0; @@ -123,4 +128,3 @@ for ($i = 1; $i < $count_values; $i++) // Output graph and clear image from memory imagepng($image); imagedestroy($image); -?> diff --git a/includes/chart_rank.php b/includes/chart_rank.php index e602f86..b58b474 100644 --- a/includes/chart_rank.php +++ b/includes/chart_rank.php @@ -8,6 +8,11 @@ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ +if (!defined('IN_PHPBB')) +{ + exit; +} + $numb_users = ( isset($_GET['t']) ) ? intval($_GET['t']) : 0; $matchdays = ( isset($_GET['m']) ) ? intval($_GET['m']) : 0; @@ -94,4 +99,3 @@ for ($i = 1; $i < $count_values; $i++) // Output graph and clear image from memory imagepng($image); imagedestroy($image); -?> diff --git a/includes/constants.php b/includes/constants.php index c4e3677..ebe0ca3 100644 --- a/includes/constants.php +++ b/includes/constants.php @@ -42,4 +42,3 @@ define('UP_WINS', 1); define('UP_POINTS', 2); define('LEAGUE_CHAMP', 1); define('LEAGUE_KO', 2); -?> \ No newline at end of file diff --git a/xml/league.php b/xml/league.php index 2f7d00d..8e988f0 100644 --- a/xml/league.php +++ b/xml/league.php @@ -11,66 +11,63 @@ * Automatically write the league as XML-file */ -if (!defined('IN_PHPBB')) -{ - // Stuff required to work with phpBB3 - define('IN_PHPBB', true); - $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../../../../'; - $phpEx = substr(strrchr(__FILE__, '.'), 1); - include($phpbb_root_path . 'common.' . $phpEx); +// Stuff required to work with phpBB3 +define('IN_PHPBB', true); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../../../../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.' . $phpEx); - // Start session management - $user->session_begin(); - $auth->acl($user->data); - $user->setup(); - $user->add_lang_ext('football/football', 'info_acp_update'); - include('../includes/constants.' . $phpEx); +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup(); +$user->add_lang_ext('football/football', 'info_acp_update'); +include('../includes/constants.' . $phpEx); - if ($config['board_disable']) - { - $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; - trigger_error($message); - } - - $season = $request->variable('season', 0); - $league = $request->variable('league', 0); - if (!$season or !$league) - { - exit; - } - - $download = $request->variable('d', false); - $xml_string = xml_data($season, $league); - - if ( $xml_string == '') - { - trigger_error('Fehler! Die XML-Datei konnte nicht erzeugt werden.'); - } +if ($config['board_disable']) +{ + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); +} - if ($download) - { - // Download XML-File - $filename = 'league_' . $season . '_' . $league . '.xml'; - $fp = fopen('php://output', 'w'); - - header('Pragma: no-cache'); - header("Content-Type: application/xml name=\"" . basename($filename) . "\""); - header("Content-disposition: attachment; filename=\"" . basename($filename) . "\""); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Cache-Control: private', false); - header('Pragma: public'); - - fwrite($fp, $xml_string); - fclose($fp); - exit_handler(); - } - else - { - // XML header - header ("content-type: text/xml"); - echo $xml_string; - } +$season = $request->variable('season', 0); +$league = $request->variable('league', 0); +if (!$season or !$league) +{ + trigger_error('Keine gültige Saison oder Liga gewählt.'); +} + +$download = $request->variable('d', false); +$xml_string = xml_data($season, $league); + +if ( $xml_string == '') +{ + trigger_error('Fehler! Die XML-Datei konnte nicht erzeugt werden.'); +} + +if ($download) +{ + // Download XML-File + $filename = 'league_' . $season . '_' . $league . '.xml'; + $fp = fopen('php://output', 'w'); + + header('Pragma: no-cache'); + header("Content-Type: application/xml name=\"" . basename($filename) . "\""); + header("Content-disposition: attachment; filename=\"" . basename($filename) . "\""); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: private', false); + header('Pragma: public'); + + fwrite($fp, $xml_string); + fclose($fp); + exit_handler(); +} +else +{ + // XML header + header ("content-type: text/xml"); + echo $xml_string; } function xml_data($season, $league) diff --git a/xml/seasons.php b/xml/seasons.php index 757f022..096d7ec 100644 --- a/xml/seasons.php +++ b/xml/seasons.php @@ -11,46 +11,43 @@ * Automatically write the seasons and leagues as XML-file */ -if (!defined('IN_PHPBB')) -{ - // Stuff required to work with phpBB3 - define('IN_PHPBB', true); - $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../../../../'; - $phpEx = substr(strrchr(__FILE__, '.'), 1); - include($phpbb_root_path . 'common.' . $phpEx); +// Stuff required to work with phpBB3 +define('IN_PHPBB', true); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../../../../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.' . $phpEx); - // Start session management - $user->session_begin(); - $auth->acl($user->data); - $user->setup(); - $user->add_lang_ext('football/football', 'info_acp_update'); - include('../includes/constants.' . $phpEx); +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup(); +$user->add_lang_ext('football/football', 'info_acp_update'); +include('../includes/constants.' . $phpEx); - if ($config['board_disable']) - { - $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; - trigger_error($message); - } - - //Check Access Code - global $code; - $code = $request->variable('code', ''); - if (strcmp($code, trim($config['football_update_code'])) <> 0) - { - trigger_error('ERROR_XML_CODE'); - } - - $string = xml_seasons(); - - if ( $string == '') - { - trigger_error('ERROR_XML_CREATE'); - } - - header ("content-type: text/xml"); - echo $string; +if ($config['board_disable']) +{ + $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; + trigger_error($message); } - + +//Check Access Code +global $code; +$code = $request->variable('code', ''); +if (strcmp($code, trim($config['football_update_code'])) <> 0) +{ + trigger_error('ERROR_XML_CODE'); +} + +$string = xml_seasons(); + +if ( $string == '') +{ + trigger_error('ERROR_XML_CREATE'); +} + +header ("content-type: text/xml"); +echo $string; + function xml_seasons() { global $db, $phpbb_root_path, $phpEx, $table_prefix, $code, $ext_path;