View Issue Details

IDProjectCategoryView StatusLast Update
0023331mantisbtcode cleanuppublic2017-10-08 23:53
ReporterdregadAssigned Todregad 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version 
Target Version2.7.0Fixed in Version2.7.0 
Summary0023331: New user_get_username() API function
Description

There are many occurrences of user_get_field( <id>, 'username' ) to retrieve a user's username in MantisBT codebase.

Since this is a common usage scenario, it makes sense to have a dedicated API function for this, similar to user_get_realname(); it would also avoid confusion with user_get_name(), which serves a different purpose (display).

Additional Information

This is a follow-up on @johgoe's suggestion in 0023225:

I guess a new method [...] user_get_username( $t_user_id) is requiered to fix this.

and the subsequent approval by @vboctor in PR https://github.com/mantisbt/mantisbt/pull/1177

TagsNo tags attached.

Relationships

related to 0023225 closeddregad Token API does not work with config show show_realname 

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master b6d5eb51

2017-09-08 06:44:23

dregad

Details Diff
New API function user_get_username()

Replaces multiple calls to `user_get_field(<id>, 'username')` and avoids
confusion with user_get_name().

As discussed in issue 0023225 and PR https://github.com/mantisbt/mantisbt/pull/1177

Fixes 0023331
mod - account_update.php Diff File
mod - api/rest/restcore/AuthMiddleware.php Diff File
mod - api/soap/mc_account_api.php Diff File
mod - bug_reminder_page.php Diff File
mod - core/authentication_api.php Diff File
mod - core/email_api.php Diff File
mod - core/filter_form_api.php Diff File
mod - core/ldap_api.php Diff File
mod - core/rss_api.php Diff File
mod - core/user_api.php Diff File
mod - verify.php Diff File

MantisBT: master 69f166a9

2017-09-08 06:47:23

dregad

Details Diff
Improve PHPDoc for user_get_name()

Better description of the function, and clearly state that it should
not be used to retrieve the user's username.

Issue 0023331
mod - core/user_api.php Diff File

Issue History

Date Modified Username Field Change
2017-09-08 10:09 dregad New Issue
2017-09-08 10:09 dregad Status new => assigned
2017-09-08 10:09 dregad Assigned To => dregad
2017-09-08 10:10 dregad Relationship added related to 0023225
2017-09-09 18:13 dregad Changeset attached => MantisBT master b6d5eb51
2017-09-09 18:13 dregad Changeset attached => MantisBT master 69f166a9
2017-09-09 18:13 dregad Status assigned => resolved
2017-09-09 18:13 dregad Resolution open => fixed
2017-09-09 18:13 dregad Fixed in Version => 2.7.0
2017-10-08 23:53 vboctor Status resolved => closed