From 796f5fa95c406eda77a0d24fd2eac5c612245d30 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 13 Jan 2016 19:17:37 -0800 Subject: [PATCH] Header location cleanup. From now, please use e107::redirect(); to redirect to the home page, or e107::redirect('admin'); to redirect to the admin start page or e107::redirect($url); --- comment.php | 32 +++++++++---------- e107_admin/admin_log.php | 2 +- e107_admin/administrator.php | 2 +- e107_admin/banlist.php | 2 +- e107_admin/banlist_export.php | 2 +- e107_admin/cache.php | 2 +- e107_admin/comment.php | 2 +- e107_admin/cpage.php | 2 +- e107_admin/cron.php | 2 +- e107_admin/db.php | 2 +- e107_admin/docs.php | 2 +- e107_admin/emoticon.php | 2 +- e107_admin/eurl.php | 2 +- e107_admin/fileinspector.php | 2 +- e107_admin/filemanager.php | 2 +- e107_admin/fla.php | 2 +- e107_admin/frontpage.php | 2 +- e107_admin/image.php | 2 +- e107_admin/lancheck.php | 2 +- e107_admin/language.php | 2 +- e107_admin/links.php | 2 +- e107_admin/mailout.php | 2 +- e107_admin/menus.php | 2 +- e107_admin/meta.php | 2 +- e107_admin/modcomment.php | 2 +- e107_admin/newspost.php | 2 +- e107_admin/notify.php | 2 +- e107_admin/phpinfo.php | 5 +-- e107_admin/plugin.php | 4 +-- e107_admin/prefs.php | 2 +- e107_admin/search.php | 2 +- e107_admin/theme.php | 5 +-- e107_admin/ugflag.php | 2 +- e107_admin/upload.php | 2 +- e107_admin/userclass2.php | 4 +-- e107_admin/users_extended.php | 2 +- e107_admin/wmessage.php | 4 +-- e107_handlers/e107_class.php | 11 +++++++ e107_handlers/redirection_class.php | 18 +++++++++-- e107_plugins/_blank/admin_config.php | 6 +++- e107_plugins/alt_auth/alt_auth_conf.php | 2 +- e107_plugins/banner/admin_banner.php | 2 +- e107_plugins/banner/banner.php | 2 +- e107_plugins/blogcalendar_menu/config.php | 2 +- e107_plugins/chatbox_menu/admin_chatbox.php | 2 +- e107_plugins/chatbox_menu/chat.php | 2 +- e107_plugins/clock_menu/config.php | 2 +- e107_plugins/comment_menu/config.php | 2 +- e107_plugins/download/admin_download.php | 2 +- e107_plugins/download/download.php | 4 +-- e107_plugins/featurebox/admin_config.php | 4 +-- e107_plugins/featurebox/featurebox.php | 2 +- e107_plugins/forum/forum.php | 4 +-- e107_plugins/forum/forum_admin.php | 2 +- e107_plugins/forum/forum_conf.php | 2 +- e107_plugins/forum/forum_post.php | 2 +- e107_plugins/forum/forum_stats.php | 2 +- e107_plugins/forum/forum_update.php | 2 +- e107_plugins/forum/forum_uploads.php | 6 ++-- e107_plugins/forum/forum_viewforum.php | 4 +-- e107_plugins/forum/forum_viewtopic.php | 2 +- .../forum/newforumposts_menu_config.php | 2 +- e107_plugins/gallery/admin_gallery.php | 2 +- e107_plugins/gallery/gallery.php | 2 +- e107_plugins/gsitemap/admin_config.php | 2 +- e107_plugins/gsitemap/weblog_pinger.php | 2 +- e107_plugins/linkwords/admin_config.php | 2 +- e107_plugins/list_new/admin_list_config.php | 2 +- e107_plugins/list_new/list.php | 2 +- e107_plugins/log/admin_config.php | 2 +- e107_plugins/log/stats.php | 2 +- e107_plugins/log/stats_csv.php | 4 +-- e107_plugins/login_menu/config.php | 2 +- e107_plugins/metaweblog/admin_config.php | 2 +- e107_plugins/metaweblog/metaweblog.php | 2 +- e107_plugins/newsfeed/admin_config.php | 2 +- e107_plugins/newsfeed/newsfeed.php | 2 +- e107_plugins/newsletter/admin_config.php | 2 +- e107_plugins/newsletter/nl_archive.php | 4 +-- e107_plugins/online/config.php | 2 +- e107_plugins/pm/admin_config.php | 2 +- e107_plugins/pm/pm.php | 2 +- e107_plugins/pm/pm_conf.php | 2 +- e107_plugins/poll/admin_config.php | 2 +- e107_plugins/poll/oldpolls.php | 2 +- e107_plugins/poll/poll.php | 2 +- e107_plugins/poll/poll_menu.php | 2 +- e107_plugins/rss_menu/admin_prefs.php | 2 +- e107_plugins/rss_menu/rss.php | 4 +-- e107_plugins/social/admin_config.php | 2 +- e107_plugins/tinymce4/admin_config.php | 2 +- e107_plugins/trackback/admin_config.php | 2 +- e107_plugins/trackback/modtrackback.php | 2 +- e107_plugins/user/usertheme_menu_config.php | 2 +- email.php | 12 +++---- fpw.php | 2 +- gsitemap.php | 2 +- login.php | 2 +- rate.php | 2 +- request.php | 2 +- signup.php | 6 ++-- sitedown.php | 2 +- submitnews.php | 2 +- top.php | 4 +-- upload.php | 2 +- userposts.php | 8 ++--- usersettings.php | 8 ++--- 107 files changed, 179 insertions(+), 152 deletions(-) diff --git a/comment.php b/comment.php index 7d25f7a72..752182f2a 100644 --- a/comment.php +++ b/comment.php @@ -183,7 +183,7 @@ if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit'])) { // New comment, or edited comment, being posted. if(!ANON && !USER) { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } @@ -192,21 +192,21 @@ if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit'])) case 'poll' : if (!$sql->db_Select("polls", "poll_title", "`poll_id` = '{$id}' AND `poll_comment` = 1")) { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } break; case 'news' : if (!$sql->db_Select("news", "news_allow_comments", "`news_id` = '{$id}' AND `news_allow_comments` = 0")) { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } break; case 'user' : if (!$sql->db_Select('user', 'user_name', '`user_id` ='.$id)) { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } break; @@ -243,7 +243,7 @@ if (isset($_POST['replysubmit'])) { // Reply to nested comment being posted if ($table == "news" && !$sql->select("news", "news_allow_comments", "news_id='{$nid}' ")) { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } else @@ -331,7 +331,7 @@ if ($action == "reply") case 'news' : if (!$sql->db_Select("news", "news_title", "news_id='{$nid}' ")) { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } else @@ -344,7 +344,7 @@ if ($action == "reply") case 'poll' : if (!$sql->db_Select("polls", "poll_title", "poll_id='{$nid}' ")) { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } else @@ -363,7 +363,7 @@ if ($action == "reply") } else { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } break; @@ -376,7 +376,7 @@ if ($action == "reply") } else { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } break; @@ -424,7 +424,7 @@ elseif ($action == 'comment') if (!$sql->db_Select_gen($query)) { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } else @@ -443,7 +443,7 @@ elseif ($action == 'comment') case 'poll' : if (!$sql->db_Select("polls", "*", "poll_id='{$id}'")) { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } else @@ -474,7 +474,7 @@ elseif ($action == 'comment') } else { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } break; @@ -489,7 +489,7 @@ elseif ($action == 'comment') } else { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } break; @@ -507,7 +507,7 @@ elseif ($action == 'comment') } else { - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } } @@ -523,7 +523,7 @@ elseif ($action == 'comment') } else { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } } @@ -532,7 +532,7 @@ elseif ($action == 'comment') } else { // Invalid action - just exit - header('location: '.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_admin/admin_log.php b/e107_admin/admin_log.php index 93753ef80..4ff5ecb3a 100644 --- a/e107_admin/admin_log.php +++ b/e107_admin/admin_log.php @@ -33,7 +33,7 @@ require_once ('../class2.php'); if(! getperms('S')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit(); } diff --git a/e107_admin/administrator.php b/e107_admin/administrator.php index 52b10f1a4..b173771c6 100644 --- a/e107_admin/administrator.php +++ b/e107_admin/administrator.php @@ -13,7 +13,7 @@ require_once('../class2.php'); if (!getperms('3')) { - header('Location:'.SITEURL.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php index cdf24f37a..a12ccbb3c 100644 --- a/e107_admin/banlist.php +++ b/e107_admin/banlist.php @@ -34,7 +34,7 @@ if(count($_POST) && !varset($_POST['e-token'])) if (!getperms('4')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit(); } diff --git a/e107_admin/banlist_export.php b/e107_admin/banlist_export.php index 42c82e5fd..0d58fcc95 100644 --- a/e107_admin/banlist_export.php +++ b/e107_admin/banlist_export.php @@ -23,7 +23,7 @@ require_once('../class2.php'); if (!getperms('4')) { - header('location:../index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/cache.php b/e107_admin/cache.php index 730fa6f99..a367d277d 100644 --- a/e107_admin/cache.php +++ b/e107_admin/cache.php @@ -25,7 +25,7 @@ require_once("../class2.php"); if (!getperms("C")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/comment.php b/e107_admin/comment.php index 168b9b123..44e82eadb 100644 --- a/e107_admin/comment.php +++ b/e107_admin/comment.php @@ -11,7 +11,7 @@ require_once("../class2.php"); if (!getperms("B")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index e6f9704f7..ae6159744 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -12,7 +12,7 @@ define('e_MINIMAL',true); require_once('../class2.php'); -if (!getperms("5|J")) { header('location:'.e_ADMIN.'admin.php'); exit; } +if (!getperms("5|J")) { e107::redirect('admin'); exit; } e107::css('inline'," diff --git a/e107_admin/cron.php b/e107_admin/cron.php index b0f55a6f8..0347aaecb 100644 --- a/e107_admin/cron.php +++ b/e107_admin/cron.php @@ -24,7 +24,7 @@ require_once('../class2.php'); if (!getperms('U')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/db.php b/e107_admin/db.php index 3a9c995c7..6bf31c603 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -16,7 +16,7 @@ define("EXPORT_PATH","{e_THEME}".$theme."/install/"); if(!getperms('0')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit(); } diff --git a/e107_admin/docs.php b/e107_admin/docs.php index 26ef6c2d6..821588ccd 100644 --- a/e107_admin/docs.php +++ b/e107_admin/docs.php @@ -16,7 +16,7 @@ */ require_once("../class2.php"); if (!ADMIN) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/e107_admin/emoticon.php b/e107_admin/emoticon.php index bfc3c25c0..d3220ad23 100644 --- a/e107_admin/emoticon.php +++ b/e107_admin/emoticon.php @@ -14,7 +14,7 @@ require_once("../class2.php"); if (!getperms("F")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/eurl.php b/e107_admin/eurl.php index c8f45daf1..2c76cc89e 100644 --- a/e107_admin/eurl.php +++ b/e107_admin/eurl.php @@ -15,7 +15,7 @@ require_once('../class2.php'); if (!ADMIN || !getperms('L')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/fileinspector.php b/e107_admin/fileinspector.php index 0e4eb5d44..a7fa9d4d0 100644 --- a/e107_admin/fileinspector.php +++ b/e107_admin/fileinspector.php @@ -22,7 +22,7 @@ e107::lan('core','fileinspector', true); if (!getperms('Y')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } $error_handler->debug = FALSE; diff --git a/e107_admin/filemanager.php b/e107_admin/filemanager.php index fec0a48a8..32a488f03 100644 --- a/e107_admin/filemanager.php +++ b/e107_admin/filemanager.php @@ -17,7 +17,7 @@ require_once("../class2.php"); if (!getperms("6")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/fla.php b/e107_admin/fla.php index de5db4318..6eee15f50 100644 --- a/e107_admin/fla.php +++ b/e107_admin/fla.php @@ -19,7 +19,7 @@ exit; require_once('../class2.php'); if (!getperms('4')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/frontpage.php b/e107_admin/frontpage.php index c01f042fa..1014dfabb 100644 --- a/e107_admin/frontpage.php +++ b/e107_admin/frontpage.php @@ -21,7 +21,7 @@ require_once ('../class2.php'); if(! getperms('G')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit(); } diff --git a/e107_admin/image.php b/e107_admin/image.php index 822dc5bae..684748673 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -25,7 +25,7 @@ if (!defined('e107_INIT')) if (!getperms("A") && ($_GET['action'] != 'dialog')) { - header("location:".e_HTTP."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/lancheck.php b/e107_admin/lancheck.php index a3b2b9ad3..bb7c66953 100644 --- a/e107_admin/lancheck.php +++ b/e107_admin/lancheck.php @@ -18,7 +18,7 @@ if (!defined('e107_INIT')) if (!getperms("L")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/language.php b/e107_admin/language.php index 9e74d7209..872dd8d53 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -12,7 +12,7 @@ require_once ("../class2.php"); if (!getperms('L')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } //include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); diff --git a/e107_admin/links.php b/e107_admin/links.php index aa7e2b268..d8c452499 100644 --- a/e107_admin/links.php +++ b/e107_admin/links.php @@ -23,7 +23,7 @@ require_once("../class2.php"); if (!getperms("I")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index deaba8382..478f4cab5 100644 --- a/e107_admin/mailout.php +++ b/e107_admin/mailout.php @@ -71,7 +71,7 @@ require_once('../class2.php'); if (!getperms('W')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_users.php'); diff --git a/e107_admin/menus.php b/e107_admin/menus.php index 6ed8cb925..7430ce97b 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -21,7 +21,7 @@ if(isset($_GET['configure'])) require_once("../class2.php"); if (!getperms("2")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/meta.php b/e107_admin/meta.php index 0b561e142..c5fe2ae52 100644 --- a/e107_admin/meta.php +++ b/e107_admin/meta.php @@ -12,7 +12,7 @@ */ require_once("../class2.php"); if (!getperms("T")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/modcomment.php b/e107_admin/modcomment.php index 45803c434..23ab9295d 100644 --- a/e107_admin/modcomment.php +++ b/e107_admin/modcomment.php @@ -10,7 +10,7 @@ require_once("../class2.php"); if (!getperms("B")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index baf08e3af..850736164 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -14,7 +14,7 @@ require_once('../class2.php'); if (!getperms('H|N|H0|H1|H2|H3|H4|H5')) { - header('Location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/notify.php b/e107_admin/notify.php index a2bc49c75..c3c920a6e 100644 --- a/e107_admin/notify.php +++ b/e107_admin/notify.php @@ -18,7 +18,7 @@ require_once('../class2.php'); if (!getperms('O')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/phpinfo.php b/e107_admin/phpinfo.php index ab133ff77..dd7829e71 100644 --- a/e107_admin/phpinfo.php +++ b/e107_admin/phpinfo.php @@ -15,8 +15,9 @@ */ require_once("../class2.php"); -if (!getperms("0")) { - header("location:".e_BASE."index.php"); +if (!getperms("0")) +{ + e107::redirect('admin'); exit; } $e_sub_cat = 'phpinfo'; diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index dd17cad0f..5eff2319f 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -13,7 +13,7 @@ require_once("../class2.php"); if (!getperms("Z")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } @@ -3288,7 +3288,7 @@ $text = "\n require_once('../../class2.php'); if (!getperms('P')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 8339057ad..dacb4d55b 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -19,7 +19,7 @@ if(isset($_POST['newver'])) if(! getperms("1")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit(); } diff --git a/e107_admin/search.php b/e107_admin/search.php index 2d83ae924..c2d3a918e 100644 --- a/e107_admin/search.php +++ b/e107_admin/search.php @@ -13,7 +13,7 @@ require_once('../class2.php'); if (!getperms('X')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/theme.php b/e107_admin/theme.php index a238eca54..66e9e9aaf 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -15,8 +15,9 @@ */ require_once("../class2.php"); -if (!getperms("1")) { - header("location:".e_BASE."index.php"); +if (!getperms("1")) +{ + e107::redirect('admin'); exit; } diff --git a/e107_admin/ugflag.php b/e107_admin/ugflag.php index c03497bc4..029999e4a 100644 --- a/e107_admin/ugflag.php +++ b/e107_admin/ugflag.php @@ -12,7 +12,7 @@ require_once ('../class2.php'); if(!getperms('9')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit(); } diff --git a/e107_admin/upload.php b/e107_admin/upload.php index d6efe6784..abe61cfa5 100644 --- a/e107_admin/upload.php +++ b/e107_admin/upload.php @@ -13,7 +13,7 @@ require_once('../class2.php'); if (!getperms('V')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_admin/userclass2.php b/e107_admin/userclass2.php index e0e9d8619..b4221b4e3 100644 --- a/e107_admin/userclass2.php +++ b/e107_admin/userclass2.php @@ -22,7 +22,7 @@ require_once('../class2.php'); if (!getperms('4')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } @@ -559,7 +559,7 @@ function checkAllowed($classID, $redirect = true, $fullEdit = FALSE) if ($redirect) { - header('location:'.SITEURL); + e107::redirect(); exit; } diff --git a/e107_admin/users_extended.php b/e107_admin/users_extended.php index 3667dd7db..b30c6fc5f 100755 --- a/e107_admin/users_extended.php +++ b/e107_admin/users_extended.php @@ -11,7 +11,7 @@ require_once('../class2.php'); if (!getperms('4')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } if (isset($_POST['cancel'])) diff --git a/e107_admin/wmessage.php b/e107_admin/wmessage.php index 350422601..02917e02e 100644 --- a/e107_admin/wmessage.php +++ b/e107_admin/wmessage.php @@ -11,8 +11,8 @@ require_once("../class2.php"); if (!getperms("M")) { - header("location:".e_BASE."index.php"); - exit; + e107::redirect('admin'); + exit; } e107::lan('core','wmessage',true); diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 7f0be870b..c3390b293 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -2777,6 +2777,17 @@ class e107 } + /** + * Simple redirect method for developers. + * @param $url string : 'admin' to redirect to admin entry page or leave blank to go to home page (SITEURL) + */ + public static function redirect($url='') + { + self::getRedirect()->go($url); + } + + + /** * Parses an array into a valid, rawurlencoded query string. This differs from http_build_query() as we need to * rawurlencode() (instead of urlencode()) all query parameters. diff --git a/e107_handlers/redirection_class.php b/e107_handlers/redirection_class.php index d9611eca8..e931fbd9d 100644 --- a/e107_handlers/redirection_class.php +++ b/e107_handlers/redirection_class.php @@ -333,15 +333,27 @@ class redirection /** * Redirect to the given URI * - * @param string $url or error code number. eg. 404 = Not Found. + * @param string $url or error code number. eg. 404 = Not Found. If left empty SITEURL will be used. * @param boolean $replace - default TRUE * @param integer|null $http_response_code - default NULL * @param boolean $preventCache * @return void */ - public function go($url, $replace = TRUE, $http_response_code = NULL, $preventCache = true) + public function go($url='', $replace = TRUE, $http_response_code = NULL, $preventCache = true) { - $url = str_replace("&", "&", $url); // cleanup when using e_QUERY in $url; + $url = str_replace("&", "&", $url); // cleanup when using e_QUERY in $url; + + if(empty($url)) + { + $url = SITEURL; + } + + if($url == 'admin') + { + $url = SITEURLBASE. e_ADMIN_ABS; + } + + if(defset('e_DEBUG') === 'redirect') { diff --git a/e107_plugins/_blank/admin_config.php b/e107_plugins/_blank/admin_config.php index 8a2ce2908..79f333b9b 100644 --- a/e107_plugins/_blank/admin_config.php +++ b/e107_plugins/_blank/admin_config.php @@ -16,7 +16,11 @@ */ require_once("../../class2.php"); -if (!getperms("P")) { header("location:".e_BASE."index.php"); exit; } +if (!getperms("P")) +{ + e107::redirect('admin'); + exit; +} class plugin_blank_admin extends e_admin_dispatcher diff --git a/e107_plugins/alt_auth/alt_auth_conf.php b/e107_plugins/alt_auth/alt_auth_conf.php index 0175055a2..2361df210 100755 --- a/e107_plugins/alt_auth/alt_auth_conf.php +++ b/e107_plugins/alt_auth/alt_auth_conf.php @@ -31,7 +31,7 @@ $eplug_admin = true; require_once('../../class2.php'); if(!getperms('P') || !e107::isInstalled('alt_auth')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit(); } require_once(e_HANDLER.'form_handler.php'); diff --git a/e107_plugins/banner/admin_banner.php b/e107_plugins/banner/admin_banner.php index 838964bd1..9552b5f94 100644 --- a/e107_plugins/banner/admin_banner.php +++ b/e107_plugins/banner/admin_banner.php @@ -23,7 +23,7 @@ require_once('../../class2.php'); if (!getperms('D') && !getperms('P')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/banner/banner.php b/e107_plugins/banner/banner.php index 035507b2e..c248267e9 100644 --- a/e107_plugins/banner/banner.php +++ b/e107_plugins/banner/banner.php @@ -16,7 +16,7 @@ if (!defined('e107_INIT')) if (!e107::isInstalled('banner')) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/e107_plugins/blogcalendar_menu/config.php b/e107_plugins/blogcalendar_menu/config.php index 9107f6897..21e9ed25a 100644 --- a/e107_plugins/blogcalendar_menu/config.php +++ b/e107_plugins/blogcalendar_menu/config.php @@ -16,7 +16,7 @@ require_once(e_HANDLER."userclass_class.php"); include_lan(e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php"); if (!getperms("1")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit ; } require_once(e_ADMIN."auth.php"); diff --git a/e107_plugins/chatbox_menu/admin_chatbox.php b/e107_plugins/chatbox_menu/admin_chatbox.php index 7fc587fae..d7745359e 100644 --- a/e107_plugins/chatbox_menu/admin_chatbox.php +++ b/e107_plugins/chatbox_menu/admin_chatbox.php @@ -14,7 +14,7 @@ require_once("../../class2.php"); if (!e107::isInstalled('chatbox_menu') || !getperms("P")) { - header("Location: ".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/chatbox_menu/chat.php b/e107_plugins/chatbox_menu/chat.php index 19bdf3da1..14020eed1 100644 --- a/e107_plugins/chatbox_menu/chat.php +++ b/e107_plugins/chatbox_menu/chat.php @@ -11,7 +11,7 @@ require_once('../../class2.php'); if (!e107::isInstalled('chatbox_menu')) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/clock_menu/config.php b/e107_plugins/clock_menu/config.php index 3bc239474..ba2302f6c 100644 --- a/e107_plugins/clock_menu/config.php +++ b/e107_plugins/clock_menu/config.php @@ -15,7 +15,7 @@ $eplug_admin = TRUE; require_once('../../class2.php'); if (!getperms('1')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit ; } require_once(e_ADMIN.'auth.php'); diff --git a/e107_plugins/comment_menu/config.php b/e107_plugins/comment_menu/config.php index f30dac3d2..2c6d56571 100644 --- a/e107_plugins/comment_menu/config.php +++ b/e107_plugins/comment_menu/config.php @@ -17,7 +17,7 @@ require_once(e_HANDLER."userclass_class.php"); include_lan(e_PLUGIN."comment_menu/languages/".e_LANGUAGE.".php"); if (!getperms("1")) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit() ; } require_once(e_ADMIN."auth.php"); diff --git a/e107_plugins/download/admin_download.php b/e107_plugins/download/admin_download.php index 71036527c..344f170f6 100644 --- a/e107_plugins/download/admin_download.php +++ b/e107_plugins/download/admin_download.php @@ -20,7 +20,7 @@ define('DOWNLOAD_DEBUG',FALSE); require_once("../../class2.php"); if (!getperms("P") || !e107::isInstalled('download')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit() ; } diff --git a/e107_plugins/download/download.php b/e107_plugins/download/download.php index cc104e9d7..f9528ba43 100644 --- a/e107_plugins/download/download.php +++ b/e107_plugins/download/download.php @@ -15,7 +15,7 @@ if (!defined('e107_INIT')) if (!e107::isInstalled('download')) { - header("location:".e_BASE."index.php"); + e107::redirect(); } e107::lan('download',false, true); // Loads e_PLUGIN.'download/languages/'.e_LANGUAGE.'/English_front.php' @@ -51,7 +51,7 @@ if (!e107::isInstalled('download')) { if (!$sql->select("download", "download_comment", "download_id = '{$id}' ")) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } else diff --git a/e107_plugins/featurebox/admin_config.php b/e107_plugins/featurebox/admin_config.php index 7eea44fff..65fb926f1 100644 --- a/e107_plugins/featurebox/admin_config.php +++ b/e107_plugins/featurebox/admin_config.php @@ -12,8 +12,8 @@ require_once("../../class2.php"); if (!getperms("P") || !e107::isInstalled('featurebox')) { - header("location:".e_BASE."index.php"); - exit; + e107::redirect('admin'); + exit; } // e107::includeLan(e_PLUGIN.'featurebox/languages/'.e_LANGUAGE.'_admin_featurebox.php'); diff --git a/e107_plugins/featurebox/featurebox.php b/e107_plugins/featurebox/featurebox.php index 07ea3883d..e61971c10 100644 --- a/e107_plugins/featurebox/featurebox.php +++ b/e107_plugins/featurebox/featurebox.php @@ -11,7 +11,7 @@ if (!defined('e107_INIT')) { exit; } if (!e107::isInstalled('featurebox')) { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/forum/forum.php b/e107_plugins/forum/forum.php index 1e331e2c9..cd2981ea2 100644 --- a/e107_plugins/forum/forum.php +++ b/e107_plugins/forum/forum.php @@ -20,7 +20,7 @@ $sql = e107::getDb(); if (!$e107->isInstalled('forum')) { // FIXME GLOBAL - get rid of all e_BASE|e_HTTP|Whatever/index.php - just point to SITEURL - header('Location: '.SITEURL); + e107::redirect(); exit; } e107::lan('forum', "front", true); @@ -32,8 +32,6 @@ if(!deftrue('BOOTSTRAP')) 'FORLAN_11' => 'LAN_FORUM_0039', 'FORLAN_12' => 'LAN_FORUM_0040', 'FORLAN_18' => 'LAN_FORUM_0041', - - ); e107::getLanguage()->bcDefs($bcDefs); diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php index dc6145b91..f1c17f8d0 100644 --- a/e107_plugins/forum/forum_admin.php +++ b/e107_plugins/forum/forum_admin.php @@ -12,7 +12,7 @@ $eplug_admin = true; require_once('../../class2.php'); if (!getperms('P')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/forum/forum_conf.php b/e107_plugins/forum/forum_conf.php index 6c1e54d3e..30b9d6e50 100644 --- a/e107_plugins/forum/forum_conf.php +++ b/e107_plugins/forum/forum_conf.php @@ -12,7 +12,7 @@ require_once('../../class2.php'); $e107 = e107::getInstance(); if (!$e107->isInstalled('forum')) { - header('Location: '.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 15e69262f..a5622cd56 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -27,7 +27,7 @@ $mes = e107::getMessage(); if (!$e107->isInstalled('forum')) { - header('Location: '.SITEURL.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/forum/forum_stats.php b/e107_plugins/forum/forum_stats.php index 5556b7f53..4d96a6cc7 100644 --- a/e107_plugins/forum/forum_stats.php +++ b/e107_plugins/forum/forum_stats.php @@ -15,7 +15,7 @@ if(!defined('e107_INIT')) if (!e107::isInstalled('forum')) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/forum/forum_update.php b/e107_plugins/forum/forum_update.php index d5674f592..798a2917b 100644 --- a/e107_plugins/forum/forum_update.php +++ b/e107_plugins/forum/forum_update.php @@ -15,7 +15,7 @@ require_once ('../../class2.php'); if (!getperms('P')) { - header('location:' . e_BASE . 'index.php'); + e107::redirect(); exit ; } diff --git a/e107_plugins/forum/forum_uploads.php b/e107_plugins/forum/forum_uploads.php index 141f289fe..3e7f6fe9f 100644 --- a/e107_plugins/forum/forum_uploads.php +++ b/e107_plugins/forum/forum_uploads.php @@ -12,7 +12,7 @@ require_once("../../class2.php"); $e107 = e107::getInstance(); if (!$e107->isInstalled('forum')) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit; } @@ -22,9 +22,9 @@ if(!USER) exit; } -include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_uploads.php'); +e107::lan('forum', "front", true); + -e107::lan('forum','front'); if(is_array($_POST['delete'])) { diff --git a/e107_plugins/forum/forum_viewforum.php b/e107_plugins/forum/forum_viewforum.php index f77889337..d50b5b47a 100644 --- a/e107_plugins/forum/forum_viewforum.php +++ b/e107_plugins/forum/forum_viewforum.php @@ -15,9 +15,9 @@ if(!defined('e107_INIT')) require_once('../../class2.php'); } $e107 = e107::getInstance(); -if (!$e107->isInstalled('forum')) +if (!e107::isInstalled('forum')) { - header('Location: '.SITEURL); + e107::redirect(); exit; } e107::lan('forum', "front", true); diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php index 73d3588ee..849b41c6b 100644 --- a/e107_plugins/forum/forum_viewtopic.php +++ b/e107_plugins/forum/forum_viewtopic.php @@ -42,7 +42,7 @@ $ns = e107::getRender(); if (!e107::isInstalled('forum')) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/forum/newforumposts_menu_config.php b/e107_plugins/forum/newforumposts_menu_config.php index 8116a4c0d..7f4646799 100755 --- a/e107_plugins/forum/newforumposts_menu_config.php +++ b/e107_plugins/forum/newforumposts_menu_config.php @@ -16,7 +16,7 @@ $eplug_admin = TRUE; require_once('../../class2.php'); if (!getperms('1')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit(); } require_once(e_ADMIN.'auth.php'); diff --git a/e107_plugins/gallery/admin_gallery.php b/e107_plugins/gallery/admin_gallery.php index 634c8a9fd..70fe9031f 100644 --- a/e107_plugins/gallery/admin_gallery.php +++ b/e107_plugins/gallery/admin_gallery.php @@ -19,7 +19,7 @@ $eplug_admin = true; require_once("../../class2.php"); if (!getperms("P") || !e107::isInstalled('gallery')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit() ; } diff --git a/e107_plugins/gallery/gallery.php b/e107_plugins/gallery/gallery.php index 5e1d983ab..51df7a93f 100644 --- a/e107_plugins/gallery/gallery.php +++ b/e107_plugins/gallery/gallery.php @@ -25,7 +25,7 @@ require_once("../../class2.php"); if (!e107::isInstalled('gallery')) { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/gsitemap/admin_config.php b/e107_plugins/gsitemap/admin_config.php index 3f4209052..096f805b1 100644 --- a/e107_plugins/gsitemap/admin_config.php +++ b/e107_plugins/gsitemap/admin_config.php @@ -12,7 +12,7 @@ require_once("../../class2.php"); if(!getperms("P") || !e107::isInstalled('gsitemap')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit(); } require_once(e_ADMIN."auth.php"); diff --git a/e107_plugins/gsitemap/weblog_pinger.php b/e107_plugins/gsitemap/weblog_pinger.php index 71b8d1193..0d707a737 100644 --- a/e107_plugins/gsitemap/weblog_pinger.php +++ b/e107_plugins/gsitemap/weblog_pinger.php @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ if(!e107::isInstalled('gsitemap')) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit(); } diff --git a/e107_plugins/linkwords/admin_config.php b/e107_plugins/linkwords/admin_config.php index c83d14d50..6fcc76ca4 100644 --- a/e107_plugins/linkwords/admin_config.php +++ b/e107_plugins/linkwords/admin_config.php @@ -14,7 +14,7 @@ if (!getperms('P') || !e107::isInstalled('linkwords')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit ; } diff --git a/e107_plugins/list_new/admin_list_config.php b/e107_plugins/list_new/admin_list_config.php index cf05c7578..1381b5d79 100644 --- a/e107_plugins/list_new/admin_list_config.php +++ b/e107_plugins/list_new/admin_list_config.php @@ -26,7 +26,7 @@ require_once("../../class2.php"); if(!getperms("1") || !e107::isInstalled('list_new')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit ; } require_once(e_ADMIN."auth.php"); diff --git a/e107_plugins/list_new/list.php b/e107_plugins/list_new/list.php index 0c5b0f91c..1f331b7e9 100644 --- a/e107_plugins/list_new/list.php +++ b/e107_plugins/list_new/list.php @@ -26,7 +26,7 @@ require_once("../../class2.php"); if (!e107::isInstalled('list_new')) { - header("Location: ".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/e107_plugins/log/admin_config.php b/e107_plugins/log/admin_config.php index 3103cb83b..68475daab 100644 --- a/e107_plugins/log/admin_config.php +++ b/e107_plugins/log/admin_config.php @@ -14,7 +14,7 @@ require_once('../../class2.php'); if (!getperms('P') || !e107::isInstalled('log')) { - header('Location: '.e_HTTP.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/log/stats.php b/e107_plugins/log/stats.php index 9d825b10b..2e814b3cf 100644 --- a/e107_plugins/log/stats.php +++ b/e107_plugins/log/stats.php @@ -16,7 +16,7 @@ if (!defined('e107_INIT')) if (!e107::isInstalled('log')) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/log/stats_csv.php b/e107_plugins/log/stats_csv.php index cc86839aa..fb2ffd332 100644 --- a/e107_plugins/log/stats_csv.php +++ b/e107_plugins/log/stats_csv.php @@ -20,7 +20,7 @@ require_once('../../class2.php'); if (!getperms('P')) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit; } @@ -33,7 +33,7 @@ $action = varset($sl_qs[0],'config'); $params = varset($sl_qs[1],''); if (($action != 'export') || $params) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/login_menu/config.php b/e107_plugins/login_menu/config.php index e3f6e8bed..12a600ed4 100644 --- a/e107_plugins/login_menu/config.php +++ b/e107_plugins/login_menu/config.php @@ -28,7 +28,7 @@ $eplug_admin = TRUE; require_once('../../class2.php'); if (!getperms('4')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit() ; } diff --git a/e107_plugins/metaweblog/admin_config.php b/e107_plugins/metaweblog/admin_config.php index f29e88e15..fb42f7d5f 100644 --- a/e107_plugins/metaweblog/admin_config.php +++ b/e107_plugins/metaweblog/admin_config.php @@ -10,7 +10,7 @@ +---------------------------------------------------------------+ */ require_once("../../class2.php"); -if(!getperms("P")){ header("location:".e_BASE."index.php"); exit; } +if(!getperms("P")){ e107::redirect('admin');exit; } include_lan(e_PLUGIN."metaweblog/languages/".e_LANGUAGE.".php"); require_once(e_ADMIN."auth.php"); diff --git a/e107_plugins/metaweblog/metaweblog.php b/e107_plugins/metaweblog/metaweblog.php index 4c1a3ff07..cfdad35fe 100644 --- a/e107_plugins/metaweblog/metaweblog.php +++ b/e107_plugins/metaweblog/metaweblog.php @@ -21,7 +21,7 @@ if (!defined('e107_INIT')) //check if plugin is installed if (!e107::isInstalled('metaweblog')) { - header("location:".e_BASE."index.php"); + e107::redirect(); } diff --git a/e107_plugins/newsfeed/admin_config.php b/e107_plugins/newsfeed/admin_config.php index d31208878..00b6271f9 100644 --- a/e107_plugins/newsfeed/admin_config.php +++ b/e107_plugins/newsfeed/admin_config.php @@ -13,7 +13,7 @@ require_once("../../class2.php"); if (!getperms("P") || !e107::isInstalled('newsfeed')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/newsfeed/newsfeed.php b/e107_plugins/newsfeed/newsfeed.php index f479f686c..aec03c609 100644 --- a/e107_plugins/newsfeed/newsfeed.php +++ b/e107_plugins/newsfeed/newsfeed.php @@ -21,7 +21,7 @@ if(!defined('e107_INIT')) if (!e107::isInstalled('newsfeed')) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/e107_plugins/newsletter/admin_config.php b/e107_plugins/newsletter/admin_config.php index bd9083a8c..bb1fda9b0 100644 --- a/e107_plugins/newsletter/admin_config.php +++ b/e107_plugins/newsletter/admin_config.php @@ -14,7 +14,7 @@ require_once('../../class2.php'); if (!getperms('P')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } $e_sub_cat = 'newsletter'; diff --git a/e107_plugins/newsletter/nl_archive.php b/e107_plugins/newsletter/nl_archive.php index 42227ec05..a4d40aacb 100644 --- a/e107_plugins/newsletter/nl_archive.php +++ b/e107_plugins/newsletter/nl_archive.php @@ -20,9 +20,9 @@ require_once('../../class2.php'); -if (!$e107->isInstalled('newsletter') || !ADMIN) +if (!e107::isInstalled('newsletter') || !ADMIN) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit(); } include_lan(e_PLUGIN.'newsletter/languages/'.e_LANGUAGE.'.php'); diff --git a/e107_plugins/online/config.php b/e107_plugins/online/config.php index 9463d0292..024575f37 100644 --- a/e107_plugins/online/config.php +++ b/e107_plugins/online/config.php @@ -16,7 +16,7 @@ include_lan(e_PLUGIN.'online/languages/'.e_LANGUAGE.'.php'); if (!getperms('1')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit ; } require_once(e_ADMIN.'auth.php'); diff --git a/e107_plugins/pm/admin_config.php b/e107_plugins/pm/admin_config.php index eacf47a81..847edf7c1 100644 --- a/e107_plugins/pm/admin_config.php +++ b/e107_plugins/pm/admin_config.php @@ -5,7 +5,7 @@ require_once('../../class2.php'); if (!getperms('P')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index 4c7ef3e43..454bdbd59 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -25,7 +25,7 @@ require_once('../../class2.php'); if (!e107::isInstalled('pm')) { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/pm/pm_conf.php b/e107_plugins/pm/pm_conf.php index 910eec3f8..33c5b1241 100755 --- a/e107_plugins/pm/pm_conf.php +++ b/e107_plugins/pm/pm_conf.php @@ -37,7 +37,7 @@ require_once('../../class2.php'); if (!e107::isInstalled('pm') || !getperms('P')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/poll/admin_config.php b/e107_plugins/poll/admin_config.php index b5f705c21..eb84451d3 100644 --- a/e107_plugins/poll/admin_config.php +++ b/e107_plugins/poll/admin_config.php @@ -12,7 +12,7 @@ require_once("../../class2.php"); if (!is_object($tp)) $tp = new e_parse; if (!getperms("P") || !e107::isInstalled('poll')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } $e_sub_cat = 'poll'; diff --git a/e107_plugins/poll/oldpolls.php b/e107_plugins/poll/oldpolls.php index 62fd56e29..6d77c6c18 100644 --- a/e107_plugins/poll/oldpolls.php +++ b/e107_plugins/poll/oldpolls.php @@ -17,7 +17,7 @@ require_once("../../class2.php"); if (!e107::isInstalled('poll')) { - header("Location: ".e_BASE."index.php"); + e107::redirect(); exit; } require_once(HEADERF); diff --git a/e107_plugins/poll/poll.php b/e107_plugins/poll/poll.php index a9c274d89..241ff9911 100644 --- a/e107_plugins/poll/poll.php +++ b/e107_plugins/poll/poll.php @@ -15,7 +15,7 @@ require_once('../../class2.php'); if (!e107::isInstalled('poll')) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/poll/poll_menu.php b/e107_plugins/poll/poll_menu.php index a777b48d1..d145b0fe4 100644 --- a/e107_plugins/poll/poll_menu.php +++ b/e107_plugins/poll/poll_menu.php @@ -19,7 +19,7 @@ if(defined("POLLRENDERED")) if (!e107::isInstalled('poll')) { - header("location:".e_BASE."index.php"); + e107::redirect(); } if(!defined("POLLCLASS")) diff --git a/e107_plugins/rss_menu/admin_prefs.php b/e107_plugins/rss_menu/admin_prefs.php index fa30565b4..adc2c4cc7 100644 --- a/e107_plugins/rss_menu/admin_prefs.php +++ b/e107_plugins/rss_menu/admin_prefs.php @@ -26,7 +26,7 @@ Notes: require_once("../../class2.php"); if(!getperms("P") || !e107::isInstalled('rss_menu')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/rss_menu/rss.php b/e107_plugins/rss_menu/rss.php index 81e50a2af..f9ad3ef34 100644 --- a/e107_plugins/rss_menu/rss.php +++ b/e107_plugins/rss_menu/rss.php @@ -26,9 +26,9 @@ if (!defined('e107_INIT')) $e107 = e107::getInstance(); -if (!$e107->isInstalled('rss_menu')) +if (!e107::isInstalled('rss_menu')) { - header('Location: '.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/e107_plugins/social/admin_config.php b/e107_plugins/social/admin_config.php index 6ccf51e28..f92e6ac08 100644 --- a/e107_plugins/social/admin_config.php +++ b/e107_plugins/social/admin_config.php @@ -5,7 +5,7 @@ require_once('../../class2.php'); if (!getperms('P')) { - header('location:'.e_BASE.'index.php'); + e107::redirect('admin'); exit; } diff --git a/e107_plugins/tinymce4/admin_config.php b/e107_plugins/tinymce4/admin_config.php index aea7d13de..684af731e 100644 --- a/e107_plugins/tinymce4/admin_config.php +++ b/e107_plugins/tinymce4/admin_config.php @@ -11,7 +11,7 @@ require_once("../../class2.php"); if( !e107::isInstalled('tinymce4')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit(); } diff --git a/e107_plugins/trackback/admin_config.php b/e107_plugins/trackback/admin_config.php index 21a74508d..cafd2b97c 100644 --- a/e107_plugins/trackback/admin_config.php +++ b/e107_plugins/trackback/admin_config.php @@ -15,7 +15,7 @@ require_once("../../class2.php"); if (!getperms("P") || !e107::isInstalled('trackback')) { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit() ; } diff --git a/e107_plugins/trackback/modtrackback.php b/e107_plugins/trackback/modtrackback.php index 0a431ed0c..796c27de2 100644 --- a/e107_plugins/trackback/modtrackback.php +++ b/e107_plugins/trackback/modtrackback.php @@ -19,7 +19,7 @@ require_once("../../class2.php"); if (!getperms("P") || !e107::isInstalled('trackback') || !$pref['trackbackEnabled']) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/e107_plugins/user/usertheme_menu_config.php b/e107_plugins/user/usertheme_menu_config.php index f85877fb9..0b0146e34 100644 --- a/e107_plugins/user/usertheme_menu_config.php +++ b/e107_plugins/user/usertheme_menu_config.php @@ -18,7 +18,7 @@ if (!is_object($e_userclass)) $e_userclass = new user_class; if (!getperms("2")) // Same permissions as menu configuration { - header("location:".e_BASE."index.php"); + e107::redirect('admin'); exit ; } diff --git a/email.php b/email.php index e2b4cffb4..81f425f60 100644 --- a/email.php +++ b/email.php @@ -49,7 +49,7 @@ if (e_QUERY) } else { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } $source = $qs[0]; @@ -77,12 +77,12 @@ if (isset($_POST['emailsubmit'])) { if(!isset($_POST['code_verify']) || !isset($_POST['rand_num'])) { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify'])) { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } } @@ -118,7 +118,7 @@ if (isset($_POST['emailsubmit'])) } if($text == '') { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } $message .= $text; @@ -127,7 +127,7 @@ if (isset($_POST['emailsubmit'])) { if(!isset($_POST['referer']) || $_POST['referer'] == '') { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } $message .= strip_tags($_POST['referer']); @@ -146,7 +146,7 @@ if (isset($_POST['emailsubmit'])) if($message == '') { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } } diff --git a/fpw.php b/fpw.php index 259e4a471..12fe96517 100644 --- a/fpw.php +++ b/fpw.php @@ -18,7 +18,7 @@ $tp = e107::getParser(); if (USER && !getperms('0')) { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } diff --git a/gsitemap.php b/gsitemap.php index 951c877c1..7b411a482 100644 --- a/gsitemap.php +++ b/gsitemap.php @@ -17,7 +17,7 @@ require_once("class2.php"); if(!e107::isInstalled('gsitemap')) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit(); } diff --git a/login.php b/login.php index 30e3a039f..4ef07aff2 100644 --- a/login.php +++ b/login.php @@ -22,7 +22,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); if ((USER || e_LOGIN != e_SELF || empty($pref['user_reg']) ) && e_QUERY !== 'preview' ) // Disable page if user logged in, or some custom e_LOGIN value is used. { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit(); } diff --git a/rate.php b/rate.php index 2afefe2a6..902b8a4b2 100644 --- a/rate.php +++ b/rate.php @@ -29,7 +29,7 @@ if(!e_AJAX_REQUEST) // Legacy method. if (!$qs[0] || USER == FALSE || $qs[3] > 10 || $qs[3] < 1 || strpos($qs[2], '://') !== false) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/request.php b/request.php index 156421475..ae4382727 100644 --- a/request.php +++ b/request.php @@ -21,7 +21,7 @@ require_once("class2.php"); if (!e_QUERY || isset($_POST['userlogin'])) { - header("location: ".SITEURL); // $e107->base_path + e107::redirect(); exit(); } diff --git a/signup.php b/signup.php index d42051ec0..97190eabd 100644 --- a/signup.php +++ b/signup.php @@ -113,7 +113,7 @@ if($signup_imagecode) if ((USER || (intval($pref['user_reg']) !== 1) || (vartrue($pref['auth_method'],'e107') != 'e107')) && !getperms('0')) { - header('location: '.e_HTTP.'index.php'); + e107::redirect(); } @@ -762,7 +762,7 @@ if (isset($_POST['register']) && intval($pref['user_reg']) === 1) $fp = new floodprotect; if ($fp->flood("user", "user_join") == FALSE) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } @@ -1018,7 +1018,7 @@ if ($qs == 'stage1' && $pref['use_coppa'] == 1) } else { - header('Location: '.e_BASE.'signup.php'); + e107::redirect(); exit; } } diff --git a/sitedown.php b/sitedown.php index 95218b630..307caa7ad 100644 --- a/sitedown.php +++ b/sitedown.php @@ -16,7 +16,7 @@ require_once('class2.php'); if (!varset($pref['maintainance_flag']) && !getperms('0')) // Allow main admin to test and view template before going offline. { - header('location: '.SITEURL); + e107::redirect(); exit(); } diff --git a/submitnews.php b/submitnews.php index aaa79fe5c..6696feffc 100644 --- a/submitnews.php +++ b/submitnews.php @@ -39,7 +39,7 @@ if (isset($_POST['submitnews_submit']) && $_POST['submitnews_title'] && $_POST[' $fp = new floodprotect; if ($fp->flood("submitnews", "submitnews_datestamp") == FALSE) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/top.php b/top.php index b6e2e8879..7253b6697 100644 --- a/top.php +++ b/top.php @@ -45,7 +45,7 @@ elseif ($action == 'active') } else { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit; } @@ -75,7 +75,7 @@ if ($action == 'active') if ($sql->gen($qry)) { $text = "
\n\n"; - $gen = e107::gethateConvert(); + $gen = e107::getDate(); $text .= " diff --git a/upload.php b/upload.php index cfc64d2d2..8741280c3 100644 --- a/upload.php +++ b/upload.php @@ -13,7 +13,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); if (!$pref['upload_enabled'] || $pref['upload_class'] == 255) { - header("location: ".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/userposts.php b/userposts.php index b4ed570b6..7894a58f5 100644 --- a/userposts.php +++ b/userposts.php @@ -46,7 +46,7 @@ if(isset($_POST['fsearch'])) if ($action == 'exit') { - header("Location: ".SITEURL); + e107::redirect(); exit; } @@ -79,7 +79,7 @@ if ($action == "comments") } else // posts by IP currently disabled (see Query filtering - top of the page) { - header("Location:".SITEURL."index.php"); + e107::redirect(); exit; /*$dip = $id; if (strlen($dip) == 8) @@ -155,7 +155,7 @@ elseif ($action == 'forums') if(!$user_name) { - header("Location:".SITEURL); + e107::redirect(); exit; } @@ -257,7 +257,7 @@ elseif ($action == 'forums') } else { - header("Location: ".SITEURL); + e107::redirect(); exit; } diff --git a/usersettings.php b/usersettings.php index de5beed89..30cac9313 100644 --- a/usersettings.php +++ b/usersettings.php @@ -35,7 +35,7 @@ define("US_DEBUG",FALSE); if (!USER) { // Must be logged in to change settings - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit(); } @@ -132,7 +132,7 @@ $info = e107::user($inp); //Only site admin is able to change setting for other admins if(!is_array($info) || ($info['user_admin'] == 1 && (!defined('ADMINPERMS') || ADMINPERMS !== '0')) || ((!defined('ADMINPERMS') || ADMINPERMS !== '0') && !getperms('4'))) { - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit(); } $adminEdit = TRUE; // Flag to indicate admin edit @@ -140,7 +140,7 @@ if(!is_array($info) || ($info['user_admin'] == 1 && (!defined('ADMINPERMS') || A else { //Non admin attempting to edit another user's ID - header('location:'.e_BASE.'index.php'); + e107::redirect(); exit(); } @@ -596,7 +596,7 @@ if ($dataToSave && !$promptPassword) if (e_QUERY == 'update') { - header('Location: index.php'); + e107::redirect(); } if($adminEdit && $message)