From 41a78ddbcbc628f0592c59879df0170bf48664aa Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 5 Apr 2025 21:01:59 +0700 Subject: [PATCH] misc: Minor improvements (#1875) * misc: Minor improvements * Update activate.php * Update admin_ug_auth.php * Update admin_ug_auth.php * Update register.php * Update index.php * Update admin_ug_auth.php --- admin/admin_ug_auth.php | 10 +++++----- index.php | 2 +- library/includes/ucp/activate.php | 2 +- library/includes/ucp/register.php | 4 ++-- styles/templates/default/usercp_viewprofile.tpl | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/admin/admin_ug_auth.php b/admin/admin_ug_auth.php index b6914f4dd..7cef20864 100644 --- a/admin/admin_ug_auth.php +++ b/admin/admin_ug_auth.php @@ -20,9 +20,9 @@ $max_forum_name_length = 50; $yes_sign = '√'; $no_sign = 'x'; -$group_id = isset($_REQUEST['g']) ? (int)$_REQUEST['g'] : 0; -$user_id = isset($_REQUEST['u']) ? (int)$_REQUEST['u'] : 0; -$cat_id = isset($_REQUEST['c']) ? (int)$_REQUEST['c'] : 0; +$group_id = isset($_REQUEST[POST_GROUPS_URL]) ? (int)$_REQUEST[POST_GROUPS_URL] : 0; +$user_id = isset($_REQUEST[POST_USERS_URL]) ? (int)$_REQUEST[POST_USERS_URL] : 0; +$cat_id = isset($_REQUEST[POST_CAT_URL]) ? (int)$_REQUEST[POST_CAT_URL] : 0; $mode = isset($_REQUEST['mode']) ? (string)$_REQUEST['mode'] : ''; $submit = isset($_REQUEST['submit']); @@ -200,7 +200,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { 'CAT_HREF' => "$base_url&" . POST_CAT_URL . "=$c_id", )); - if (!$c =& $_REQUEST['c'] or !in_array($c, array('all', $c_id)) or empty($c_data['forums'])) { + if (!$c =& $_REQUEST[POST_CAT_URL] or !in_array($c, array('all', $c_id)) or empty($c_data['forums'])) { continue; } @@ -316,7 +316,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { 'CAT_HREF' => "$base_url&" . POST_CAT_URL . "=$c_id", )); - if (!($c =& $_REQUEST['c']) || !in_array($c, array('all', $c_id)) || empty($c_data['forums'])) { + if (!($c =& $_REQUEST[POST_CAT_URL]) || !in_array($c, array('all', $c_id)) || empty($c_data['forums'])) { continue; } diff --git a/index.php b/index.php index 7598df5d7..29548df6d 100644 --- a/index.php +++ b/index.php @@ -46,7 +46,7 @@ if ($bb_cfg['show_network_news']) { $user->session_start(); // Init main vars -$viewcat = isset($_GET['c']) ? (int)$_GET['c'] : 0; +$viewcat = isset($_GET[POST_CAT_URL]) ? (int)$_GET[POST_CAT_URL] : 0; $lastvisit = IS_GUEST ? TIMENOW : $userdata['user_lastvisit']; // Caching output diff --git a/library/includes/ucp/activate.php b/library/includes/ucp/activate.php index 4aac130de..b72660e1a 100644 --- a/library/includes/ucp/activate.php +++ b/library/includes/ucp/activate.php @@ -11,7 +11,7 @@ if (!defined('BB_ROOT')) { die(basename(__FILE__)); } -if (empty($_GET['u']) || empty($_GET['act_key'])) { +if (empty($_GET[POST_USERS_URL]) || empty($_GET['act_key'])) { bb_die('Bad request'); } diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php index feaab65df..25acbfc0a 100644 --- a/library/includes/ucp/register.php +++ b/library/includes/ucp/register.php @@ -122,8 +122,8 @@ switch ($mode) { ]; // Select a profile: your own for the user, any for the admin - if (IS_ADMIN && !empty($_REQUEST['u'])) { - $pr_user_id = (int)$_REQUEST['u']; + if (IS_ADMIN && !empty($_REQUEST[POST_USERS_URL])) { + $pr_user_id = (int)$_REQUEST[POST_USERS_URL]; $adm_edit = ($pr_user_id != $userdata['user_id']); } else { $pr_user_id = $userdata['user_id']; diff --git a/styles/templates/default/usercp_viewprofile.tpl b/styles/templates/default/usercp_viewprofile.tpl index 5f1cb06b5..d4a11e354 100644 --- a/styles/templates/default/usercp_viewprofile.tpl +++ b/styles/templates/default/usercp_viewprofile.tpl @@ -225,7 +225,7 @@ ajax.callback.group_membership = function(data) { $('#rank-sel').bind('change', function(){ ajax.change_user_rank( {PROFILE_USER_ID}, $(this).val() ); });
- + {RANK_IMAGE}