diff --git a/admin/admin_cron.php b/admin/admin_cron.php index 27ed0344..1f19a090 100644 --- a/admin/admin_cron.php +++ b/admin/admin_cron.php @@ -40,7 +40,7 @@ define('BB_ROOT', './../'); require BB_ROOT . 'common.php'; $user->session_start(); - redirect('admin/' . basename(__FILE__) . '?mode=list'); + redirectToUrl('admin/' . basename(__FILE__) . '?mode=list'); } else { require __DIR__ . '/pagestart.php'; } @@ -109,12 +109,12 @@ if (file_exists('../triggers/cron_running')) { rename('../triggers/cron_running', '../triggers/cron_allowed'); } - redirect('admin/' . basename(__FILE__) . '?mode=list'); + redirectToUrl('admin/' . basename(__FILE__) . '?mode=list'); break; case 'run': run_jobs($job_id); - redirect('admin/' . basename(__FILE__) . '?mode=list'); + redirectToUrl('admin/' . basename(__FILE__) . '?mode=list'); break; case 'edit': @@ -210,7 +210,7 @@ } elseif (($cron_action == 'disable' || $cron_action == 'enable') && $jobs) { toggle_active($jobs, $cron_action); } - redirect('admin/' . basename(__FILE__) . '?mode=list'); + redirectToUrl('admin/' . basename(__FILE__) . '?mode=list'); } elseif (validate_cron_post($_POST) == 1) { if ($_POST['mode'] == 'edit') { update_cron_job($_POST); @@ -220,7 +220,7 @@ bb_die('Mode error'); } - redirect('admin/' . basename(__FILE__) . '?mode=list'); + redirectToUrl('admin/' . basename(__FILE__) . '?mode=list'); } else { bb_die(validate_cron_post($_POST)); } diff --git a/admin/admin_ug_auth.php b/admin/admin_ug_auth.php index 0e13ae4a..8cff4125 100644 --- a/admin/admin_ug_auth.php +++ b/admin/admin_ug_auth.php @@ -202,8 +202,8 @@ $ug_data = $this_userdata; $ug_data['session_logged_in'] = 1; - $u_access = auth(AUTH_ALL, AUTH_LIST_ALL, $ug_data, array(), UG_PERM_USER_ONLY); - $g_access = auth(AUTH_ALL, AUTH_LIST_ALL, $ug_data, array(), UG_PERM_GROUP_ONLY); + $u_access = auth_user(AUTH_ALL, AUTH_LIST_ALL, $ug_data, array(), UG_PERM_USER_ONLY); + $g_access = auth_user(AUTH_ALL, AUTH_LIST_ALL, $ug_data, array(), UG_PERM_GROUP_ONLY); foreach ($forums['c'] as $c_id => $c_data) { $template->assign_block_vars('c', array( @@ -319,7 +319,7 @@ $base_url = basename(__FILE__) . "?mode=group&g=$group_id"; $ug_data = array('group_id' => $group_id); - $u_access = auth(AUTH_ALL, AUTH_LIST_ALL, $ug_data); + $u_access = auth_user(AUTH_ALL, AUTH_LIST_ALL, $ug_data); foreach ($forums['c'] as $c_id => $c_data) { $template->assign_block_vars('c', array( diff --git a/admin/pagestart.php b/admin/pagestart.php index 141816b9..41c77905 100644 --- a/admin/pagestart.php +++ b/admin/pagestart.php @@ -34,7 +34,7 @@ $user->session_start(); if (IS_GUEST) { - redirect(LOGIN_URL . '?redirect=admin/index.php'); + redirectToUrl(LOGIN_URL . '?redirect=admin/index.php'); } if (!IS_ADMIN) { @@ -43,5 +43,5 @@ if (!$userdata['session_admin']) { $redirect = url_arg($_SERVER['REQUEST_URI'], 'admin', 1); - redirect("login.php?redirect=$redirect"); + redirectToUrl("login.php?redirect=$redirect"); } diff --git a/dl.php b/dl.php index 3c400d9c..f38e3b47 100644 --- a/dl.php +++ b/dl.php @@ -146,7 +146,7 @@ function send_file_to_browser($attachment, $upload_dir) $forum_id = $row['forum_id']; $is_auth = array(); - $is_auth = auth(AUTH_ALL, $forum_id, $userdata); + $is_auth = auth_user(AUTH_ALL, $forum_id, $userdata); set_die_append_msg($forum_id, $topic_id); if ($is_auth['auth_download']) { diff --git a/dl_list.php b/dl_list.php index 34be9934..eeeeab31 100644 --- a/dl_list.php +++ b/dl_list.php @@ -69,12 +69,12 @@ // Check if user logged in if (!$userdata['session_logged_in']) { - redirect(LOGIN_URL . "?redirect=$redirect_type&$redirect"); + redirectToUrl(LOGIN_URL . "?redirect=$redirect_type&$redirect"); } // Check if user did not confirm if (isset($_POST['cancel']) && $_POST['cancel']) { - redirect("$redirect_type?$redirect"); + redirectToUrl("$redirect_type?$redirect"); } // Delete DL-list @@ -86,7 +86,7 @@ bb_die('Could not obtain forum_id for this topic'); } - $is_auth = auth(AUTH_ALL, $row['forum_id'], $userdata); + $is_auth = auth_user(AUTH_ALL, $row['forum_id'], $userdata); if (!$is_auth['auth_mod']) { bb_die($lang['NOT_MODERATOR']); @@ -107,7 +107,7 @@ } clear_dl_list($topic_id); - redirect("$redirect_type?$redirect"); + redirectToUrl("$redirect_type?$redirect"); } // Update DL status @@ -149,7 +149,7 @@ DB()->query("REPLACE INTO " . BB_BT_DLSTATUS . " $new_dlstatus_sql"); - redirect("$redirect_type?$redirect"); + redirectToUrl("$redirect_type?$redirect"); } -redirect("index.php"); +redirectToUrl("index.php"); diff --git a/feed.php b/feed.php index 3f2ad3c5..82f0689f 100644 --- a/feed.php +++ b/feed.php @@ -50,11 +50,11 @@ } } if (file_exists($bb_cfg['atom']['path'] . '/f/' . $id . '.atom') && filemtime($bb_cfg['atom']['path'] . '/f/' . $id . '.atom') > $timecheck) { - redirect($bb_cfg['atom']['url'] . '/f/' . $id . '.atom'); + redirectToUrl($bb_cfg['atom']['url'] . '/f/' . $id . '.atom'); } else { require_once INC_DIR . '/functions_atom.php'; if (update_forum_feed($id, $forum_data)) { - redirect($bb_cfg['atom']['url'] . '/f/' . $id . '.atom'); + redirectToUrl($bb_cfg['atom']['url'] . '/f/' . $id . '.atom'); } else { bb_simple_die($lang['ATOM_NO_FORUM']); } @@ -69,11 +69,11 @@ bb_simple_die($lang['ATOM_ERROR'] . ' #3'); } if (file_exists($bb_cfg['atom']['path'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') && filemtime($bb_cfg['atom']['path'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') > $timecheck) { - redirect($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom'); + redirectToUrl($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom'); } else { require_once INC_DIR . '/functions_atom.php'; if (update_user_feed($id, $username)) { - redirect($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom'); + redirectToUrl($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom'); } else { bb_simple_die($lang['ATOM_NO_USER']); } diff --git a/group.php b/group.php index 6b1b3abb..37f851fd 100644 --- a/group.php +++ b/group.php @@ -180,7 +180,7 @@ function build_group($params) )); } else { if (IS_ADMIN) { - redirect('admin/admin_groups.php'); + redirectToUrl('admin/admin_groups.php'); } else { bb_die($lang['NO_GROUPS_EXIST']); } diff --git a/group_edit.php b/group_edit.php index d0990f19..e3e358a4 100644 --- a/group_edit.php +++ b/group_edit.php @@ -112,5 +112,5 @@ if ($group_id) { $redirect = GROUP_URL . $group_id; } - redirect($redirect); + redirectToUrl($redirect); } diff --git a/index.php b/index.php index c2ea192d..cf9eb3b0 100644 --- a/index.php +++ b/index.php @@ -93,7 +93,7 @@ // Validate requested category id if ($viewcat && !($viewcat =& $forums['c'][$viewcat]['cat_id'])) { - redirect("index.php"); + redirectToUrl("index.php"); } // Forums diff --git a/library/ajax/posts.php b/library/ajax/posts.php index 733ae3d5..6bbe7b96 100644 --- a/library/ajax/posts.php +++ b/library/ajax/posts.php @@ -45,7 +45,7 @@ $this->ajax_die('not post'); } - $is_auth = auth(AUTH_ALL, $post['forum_id'], $userdata, $post); + $is_auth = auth_user(AUTH_ALL, $post['forum_id'], $userdata, $post); if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) { $this->ajax_die($lang['TOPIC_LOCKED']); } @@ -60,7 +60,7 @@ $this->ajax_die('not post'); } - $is_auth = auth(AUTH_ALL, $post['forum_id'], $userdata, $post); + $is_auth = auth_user(AUTH_ALL, $post['forum_id'], $userdata, $post); } if (!defined('WORD_LIST_OBTAINED')) { @@ -172,7 +172,7 @@ $this->response['html'] = bbcode2html($text); } else { - $is_auth = auth(AUTH_ALL, $post['forum_id'], $userdata, $post); + $is_auth = auth_user(AUTH_ALL, $post['forum_id'], $userdata, $post); if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) { $this->ajax_die($lang['TOPIC_LOCKED']); } elseif (!$is_auth['auth_edit']) { diff --git a/library/ajax/view_post.php b/library/ajax/view_post.php index bc263f81..5f7c27f2 100644 --- a/library/ajax/view_post.php +++ b/library/ajax/view_post.php @@ -60,7 +60,7 @@ $this->ajax_die($lang['NEED_TO_LOGIN_FIRST']); } } elseif ($post_data['auth_read'] != AUTH_ALL) { - $is_auth = auth(AUTH_READ, $post_data['forum_id'], $user->data, $post_data); + $is_auth = auth_user(AUTH_READ, $post_data['forum_id'], $user->data, $post_data); if (!$is_auth['auth_read']) { $this->ajax_die($lang['TOPIC_POST_NOT_EXIST']); } diff --git a/library/includes/functions.php b/library/includes/functions.php index db7ef23b..7541eba0 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -140,7 +140,7 @@ function is_unread($ref, $topic_id = 0, $forum_id = 0) define('AUTH_ACL', 2); define('AUTH_ADMIN', 5); -// forum_perm bitfields - backward compatible with auth($type) +// forum_perm bitfields - backward compatible with auth_user($type) define('AUTH_ALL', 0); define('AUTH_VIEW', 1); define('AUTH_READ', 2); @@ -259,7 +259,7 @@ function setbit(&$int, $bit_num, $on) forum auth levels, this will prevent the auth function having to do its own lookup */ -function auth($type, $forum_id, $ug_data, array $f_access = array(), $group_perm = UG_PERM_BOTH) +function auth_user($type, $forum_id, $ug_data, array $f_access = array(), $group_perm = UG_PERM_BOTH) { global $lang, $bf, $datastore; @@ -1402,7 +1402,7 @@ function bb_realpath($path) function login_redirect($url = '') { - redirect(LOGIN_URL . '?redirect=' . (($url) ?: (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'))); + redirectToUrl(LOGIN_URL . '?redirect=' . (($url) ?: (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'))); } function meta_refresh($url, $time = 5) @@ -1412,7 +1412,7 @@ function meta_refresh($url, $time = 5) $template->assign_var('META', ''); } -function redirect($url) +function redirectToUrl($url) { global $bb_cfg; @@ -2133,7 +2133,7 @@ function hash_search($hash) $info_hash = DB()->escape(pack("H*", $hash)); if ($row = DB()->fetch_row("SELECT topic_id FROM " . BB_BT_TORRENTS . " WHERE info_hash = '$info_hash'")) { - redirect(TOPIC_URL . $row['topic_id']); + redirectToUrl(TOPIC_URL . $row['topic_id']); } else { bb_die(sprintf($lang['HASH_NOT_FOUND'], $hash)); } diff --git a/library/includes/functions_torrent.php b/library/includes/functions_torrent.php index 9efe1716..8907f9b5 100644 --- a/library/includes/functions_torrent.php +++ b/library/includes/functions_torrent.php @@ -69,7 +69,7 @@ function torrent_auth_check($forum_id, $poster_id) return true; } - $is_auth = auth(AUTH_ALL, $forum_id, $userdata); + $is_auth = auth_user(AUTH_ALL, $forum_id, $userdata); if ($poster_id != $userdata['user_id'] && !$is_auth['auth_mod']) { bb_die($lang['NOT_MODERATOR']); diff --git a/library/includes/posting_tpl.php b/library/includes/posting_tpl.php index 85592371..c4ff18e8 100644 --- a/library/includes/posting_tpl.php +++ b/library/includes/posting_tpl.php @@ -42,7 +42,7 @@ if (!$f_data['forum_tpl_id'] || !$tpl_data = DB()->fetch_row($sql)) { if (!$edit_tpl_mode) { - redirect(POSTING_URL . "?mode=newtopic&f=$forum_id"); + redirectToUrl(POSTING_URL . "?mode=newtopic&f=$forum_id"); } } diff --git a/library/includes/ucp/email.php b/library/includes/ucp/email.php index ccd79861..d7c8fbc1 100644 --- a/library/includes/ucp/email.php +++ b/library/includes/ucp/email.php @@ -29,7 +29,7 @@ // Is send through board enabled? No, return to index if (!$bb_cfg['board_email_form']) { - redirect("index.php"); + redirectToUrl("index.php"); } set_die_append_msg(); @@ -41,7 +41,7 @@ } if (!$userdata['session_logged_in']) { - redirect(LOGIN_URL . "?redirect=profile.php&mode=email&" . POST_USERS_URL . "=$user_id"); + redirectToUrl(LOGIN_URL . "?redirect=profile.php&mode=email&" . POST_USERS_URL . "=$user_id"); } $errors = array(); diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php index cc869da6..5a37bace 100644 --- a/library/includes/ucp/register.php +++ b/library/includes/ucp/register.php @@ -65,7 +65,7 @@ */ case 'register': if (!$can_register) { - redirect('index.php'); + redirectToUrl('index.php'); } if (!IS_ADMIN) { diff --git a/library/includes/ucp/viewprofile.php b/library/includes/ucp/viewprofile.php index beac76a8..8eedc246 100644 --- a/library/includes/ucp/viewprofile.php +++ b/library/includes/ucp/viewprofile.php @@ -42,7 +42,7 @@ } if (!$userdata['session_logged_in']) { - redirect(LOGIN_URL . "?redirect={$_SERVER['REQUEST_URI']}"); + redirectToUrl(LOGIN_URL . "?redirect={$_SERVER['REQUEST_URI']}"); } if (!$ranks = $datastore->get('ranks')) { diff --git a/login.php b/login.php index f714fcf6..9d6244ad 100644 --- a/login.php +++ b/login.php @@ -37,7 +37,7 @@ if (!IS_GUEST) { $user->session_end(); } - redirect("index.php"); + redirectToUrl("index.php"); } $redirect_url = "index.php"; @@ -88,7 +88,7 @@ if (isset($_POST['login'])) { if (!$mod_admin_login) { if (!IS_GUEST) { - redirect('index.php'); + redirectToUrl('index.php'); } if ($login_username == '' || $login_password == '') { $login_errors[] = $lang['ENTER_PASSWORD']; @@ -109,7 +109,7 @@ if ($redirect_url == '/' . LOGIN_URL || $redirect_url == LOGIN_URL) { $redirect_url = 'index.php'; } - redirect($redirect_url); + redirectToUrl($redirect_url); } $login_errors[] = $lang['ERROR_LOGIN']; @@ -142,4 +142,4 @@ print_page('login.tpl'); } -redirect($redirect_url); +redirectToUrl($redirect_url); diff --git a/modcp.php b/modcp.php index b7517d85..ba1511d9 100644 --- a/modcp.php +++ b/modcp.php @@ -157,11 +157,11 @@ function validate_mode_condition($request_index, $mod_action = '') if ($topic_id || $forum_id) { $redirect = ($topic_id) ? TOPIC_URL . $topic_id : FORUM_URL . $forum_id; } - redirect($redirect); + redirectToUrl($redirect); } // Start auth check -$is_auth = auth(AUTH_ALL, $forum_id, $userdata); +$is_auth = auth_user(AUTH_ALL, $forum_id, $userdata); $is_moderator = (IS_AM); if ($mode == 'ip') { @@ -185,7 +185,7 @@ function validate_mode_condition($request_index, $mod_action = '') // Redirect to login page if not admin session if ($is_moderator && !$userdata['session_admin']) { $redirect = isset($_POST['redirect']) ? $_POST['redirect'] : $_SERVER['REQUEST_URI']; - redirect(LOGIN_URL . "?redirect=$redirect&admin=1"); + redirectToUrl(LOGIN_URL . "?redirect=$redirect&admin=1"); } // diff --git a/posting.php b/posting.php index 0410d340..88c17278 100644 --- a/posting.php +++ b/posting.php @@ -168,7 +168,7 @@ set_die_append_msg($forum_id); - $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $post_info); + $is_auth = auth_user(AUTH_ALL, $forum_id, $userdata, $post_info); if ($post_info['forum_status'] == FORUM_LOCKED && !$is_auth['auth_mod']) { bb_die($lang['FORUM_LOCKED']); @@ -237,7 +237,7 @@ default: $redirect = ''; } - redirect(LOGIN_URL . "?redirect=/" . POSTING_URL . "?$redirect"); + redirectToUrl(LOGIN_URL . "?redirect=/" . POSTING_URL . "?$redirect"); } if ($mode == 'new_rel') { @@ -316,7 +316,7 @@ // Confirm deletion if (($delete || $mode == 'delete') && !$confirm) { if (isset($_POST['cancel'])) { - redirect(POST_URL . "$post_id#$post_id"); + redirectToUrl(POST_URL . "$post_id#$post_id"); } $hidden_fields = array( 'p' => $post_id, diff --git a/privmsg.php b/privmsg.php index 48056a46..2c411305 100644 --- a/privmsg.php +++ b/privmsg.php @@ -82,7 +82,7 @@ // Cancel // if ($cancel) { - redirect(PM_URL . "?folder=$folder"); + redirectToUrl(PM_URL . "?folder=$folder"); } // @@ -171,7 +171,7 @@ // Did the query return any data? // if (!($privmsg = DB()->sql_fetchrow($result))) { - redirect(PM_URL . "?folder=$folder"); + redirectToUrl(PM_URL . "?folder=$folder"); } $privmsg_id = $privmsg['privmsgs_id']; @@ -758,7 +758,7 @@ bb_die('Could not save private messages'); } - redirect(PM_URL . "?folder=savebox"); + redirectToUrl(PM_URL . "?folder=savebox"); } } elseif ($submit || $refresh || $mode != '') { if (IS_USER && $submit && $mode != 'edit') { @@ -1004,7 +1004,7 @@ } if (!($privmsg = DB()->sql_fetchrow($result))) { - redirect(PM_URL . "?folder=$folder"); + redirectToUrl(PM_URL . "?folder=$folder"); } $privmsg_subject = $privmsg['privmsgs_subject']; @@ -1024,7 +1024,7 @@ } if (!($privmsg = DB()->sql_fetchrow($result))) { - redirect(PM_URL . "?folder=$folder"); + redirectToUrl(PM_URL . "?folder=$folder"); } $privmsg_subject = ((!preg_match('/^Re:/', $privmsg['privmsgs_subject'])) ? 'Re: ' : '') . $privmsg['privmsgs_subject']; diff --git a/search.php b/search.php index 1e1bb950..455b83c5 100644 --- a/search.php +++ b/search.php @@ -66,12 +66,12 @@ '); if (IS_GUEST) { - redirect('index.php'); + redirectToUrl('index.php'); } DB()->query("UPDATE " . BB_POSTS . " SET user_post = 1 WHERE poster_id = {$user->id}"); - redirect("search.php?u={$user->id}"); + redirectToUrl("search.php?u={$user->id}"); } // @@ -528,7 +528,7 @@ } if (!$SQL['WHERE']) { - redirect(basename(__FILE__)); + redirectToUrl(basename(__FILE__)); } $SQL['GROUP BY'][] = "item_id"; @@ -738,7 +738,7 @@ } if (!$SQL['WHERE']) { - redirect(basename(__FILE__)); + redirectToUrl(basename(__FILE__)); } $SQL['GROUP BY'][] = "item_id"; @@ -852,7 +852,7 @@ print_page('search_results.tpl'); } -redirect(basename(__FILE__)); +redirectToUrl(basename(__FILE__)); // ----------------------------------------------------------- // // Functions diff --git a/src/Legacy/Ajax.php b/src/Legacy/Ajax.php index 61d92320..42756c34 100644 --- a/src/Legacy/Ajax.php +++ b/src/Legacy/Ajax.php @@ -261,7 +261,7 @@ public function verify_mod_rights($forum_id) { global $userdata, $lang; - $is_auth = auth(AUTH_MOD, $forum_id, $userdata); + $is_auth = auth_user(AUTH_MOD, $forum_id, $userdata); if (!$is_auth['auth_mod']) { $this->ajax_die($lang['ONLY_FOR_MOD']); diff --git a/src/Legacy/Common/User.php b/src/Legacy/Common/User.php index 1815be00..4a27e9ac 100644 --- a/src/Legacy/Common/User.php +++ b/src/Legacy/Common/User.php @@ -719,7 +719,7 @@ public function get_not_auth_forums($auth_type) $not_auth_forums = []; $auth_field = $auth_field_match[$auth_type]; - $is_auth_ary = auth($auth_type, AUTH_LIST_ALL, $this->data); + $is_auth_ary = auth_user($auth_type, AUTH_LIST_ALL, $this->data); foreach ($is_auth_ary as $forum_id => $is_auth) { if (!$is_auth[$auth_field]) { diff --git a/terms.php b/terms.php index 45477a31..00a97fb4 100644 --- a/terms.php +++ b/terms.php @@ -32,7 +32,7 @@ $user->session_start(); if (!$bb_cfg['terms'] && !IS_ADMIN) { - redirect('index.php'); + redirectToUrl('index.php'); } $template->assign_vars(array( diff --git a/viewforum.php b/viewforum.php index 73f2b90e..8bddd14d 100644 --- a/viewforum.php +++ b/viewforum.php @@ -77,14 +77,14 @@ } // Auth -$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_data); +$is_auth = auth_user(AUTH_ALL, $forum_id, $userdata, $forum_data); $moderation = (!empty($_REQUEST['mod']) && $is_auth['auth_mod']); if (!$is_auth['auth_view']) { if (IS_GUEST) { $redirect = ($start) ? "-$start" : ''; - redirect(LOGIN_URL . "?redirect=" . FORUM_URL . $forum_id . $redirect); + redirectToUrl(LOGIN_URL . "?redirect=" . FORUM_URL . $forum_id . $redirect); } // The user is not authed to read this forum ... $message = sprintf($lang['SORRY_AUTH_VIEW'], $is_auth['auth_view_type']); @@ -103,7 +103,7 @@ $mod_redirect_url = LOGIN_URL . "?redirect=$redirect&admin=1"; if ($moderation && !$userdata['session_admin']) { - redirect($mod_redirect_url); + redirectToUrl($mod_redirect_url); } if (isset($_REQUEST['tst']) && $_REQUEST['tst'] != -1) { $tor_status = (int)$_REQUEST['tst']; @@ -273,7 +273,7 @@ } // Correct $start value if ($start > $forum_topics) { - redirect(FORUM_URL . $forum_id); + redirectToUrl(FORUM_URL . $forum_id); } // Generate SORT and ORDER selects diff --git a/viewtopic.php b/viewtopic.php index 8a6e98dd..78df0fb5 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -176,13 +176,13 @@ } // Auth check -$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $t_data); +$is_auth = auth_user(AUTH_ALL, $forum_id, $userdata, $t_data); if (!$is_auth['auth_read']) { if (IS_GUEST) { $redirect = ($post_id) ? POST_URL . "$post_id#$post_id" : TOPIC_URL . $topic_id; $redirect .= ($start && !$post_id) ? "-$start" : ''; - redirect(LOGIN_URL . "?redirect=$redirect"); + redirectToUrl(LOGIN_URL . "?redirect=$redirect"); } bb_die($lang['TOPIC_POST_NOT_EXIST']); } @@ -203,7 +203,7 @@ $mod_redirect_url = LOGIN_URL . "?redirect=$redirect&admin=1"; if ($moderation && !$userdata['session_admin']) { - redirect($mod_redirect_url); + redirectToUrl($mod_redirect_url); } } @@ -285,7 +285,7 @@ } else { if (isset($_GET['unwatch'])) { if ($_GET['unwatch'] == 'topic') { - redirect(LOGIN_URL . "?redirect=" . TOPIC_URL . "$topic_id&unwatch=topic"); + redirectToUrl(LOGIN_URL . "?redirect=" . TOPIC_URL . "$topic_id&unwatch=topic"); } } }