Skip to content

Conversation

@mambax7
Copy link
Collaborator

@mambax7 mambax7 commented Jun 1, 2025

changing "username" to "uname" to make consistent with the name in the database

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR renames all instances of the “username” parameter to “uname” to align with the database field, and updates related form inputs, validation checks, and search query parameters.

  • Updated form fields and request handlers to use ‘uname’ instead of ‘username’
  • Adjusted validation and error messages to pull from Request::getString('uname')
  • Revised user search logic and URL parameters for the admin users listing

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
htdocs/modules/system/admin/users/users/users.php Changed form input name from ‘username’ to ‘uname’
htdocs/modules/system/admin/users/main.php Replaced request keys, validation, and search filters to use ‘uname’ and adjusted related comments/strings
Comments suppressed due to low confidence (1)

htdocs/modules/system/admin/users/main.php:512

  • [nitpick] The URL parameters mix uname and user_uname_match. To improve clarity, consider renaming user_uname_match to uname_match so the prefix is consistent.
$requete_pagenav .= '&user_uname_match=' . htmlspecialchars($user_uname_match, ENT_QUOTES | ENT_HTML5);

@mambax7 mambax7 requested a review from Copilot June 1, 2025 02:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR standardizes the user identifier from “username” to “uname” across the admin user form and search handlers to match the database column.

  • Renamed form fields and request parameters from “username”/“user_uname” to “uname”
  • Switched from $myts->addSlashes() to $xoopsDB->escape() in search criteria
  • Refactored group parameter handling and updated various comment strings

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
htdocs/modules/system/admin/users/users.php Changed the form input name for nickname from 'username' to 'uname'
htdocs/modules/system/admin/users/main.php Updated request keys, criteria building, escaping, and comments to use 'uname' and xoopsDB->escape()
Comments suppressed due to low confidence (1)

htdocs/modules/system/admin/users/main.php:829

  • Retrieving selgroups with getString will always return a string, but later code treats it as an array. Consider using Request::getArray('selgroups', []) for consistent input handling.
$selgroups = Request::getString('selgroups'); //TODO should it be an array?

@mambax7 mambax7 requested a review from Copilot June 1, 2025 08:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR renames the “username” form and request parameters to “uname” for database consistency and adjusts related defaults and escaping in the admin user search and edit flows.

  • Renamed form element and request keys from username to uname
  • Defaulted attachsig/user_viewemail to 0 instead of null
  • Switched from addSlashes to $xoopsDB->escape and updated search query and result strings to English

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
htdocs/modules/system/admin/users/users.php Change form field name from 'username' to 'uname'
htdocs/modules/system/admin/users/main.php Update all username references to uname, default flag values, SQL escaping, and search query building
Comments suppressed due to low confidence (3)

htdocs/modules/system/admin/users/main.php:473

  • [nitpick] The variable $groupId uses camelCase, while the surrounding code follows snake_case (e.g., $user_uname). Consider renaming it to $group_id for consistency.
$groupId = Request::getInt('group', 0, 'GET');

htdocs/modules/system/admin/users/users.php:124

  • [nitpick] Since the form field name changed from username to uname, add or update automated tests to cover both the form rendering and submission to ensure the backend correctly handles the new uname parameter.
$form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_NICKNAME, 'uname', 25, 25, $uname_value), true);

htdocs/modules/system/admin/users/main.php:647

  • It looks like the $requete_pagenav update for the user_msnm filter was removed by mistake when updating to English. You should re-add the corresponding &user_msnm= parameter to $requete_pagenav to ensure pagination retains this filter.
$requete_search .= 'msn: ' . $user_msnm . ' and user_msnm_match=' . $user_msnm_match . '<br>';

Copy link
Member

@montuy337513 montuy337513 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this, it seems correct to me.

replace 'location' with 'occupation'
@mambax7 mambax7 merged commit e6f8238 into XOOPS:master Jun 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants