Username change

Username change 2.1.1

No permission to download

CMTV

Well-known member
CMTV submitted a new resource:

Username change - Ultimate username change functionality: managable history, criteria, widget, permissions and more!

View attachment 186944

Description

This addon brings configurable username change functionality to your forum, inluding permissions, managable username change history, "Latest username changes" widget, trophy criteria and with "User change log" support.

This is an open source addon. Visit GitHub repository for source code.

All my addons...

Read more about this resource...
 
Looks like it's giving me a consistent error about 40 times in the error log:

#0 src/addons/CMTV/UsernameChange/XF/Entity/User.php(170): XF::handlePhpError(8, '[E_NOTICE] Tryi...', '/home/tjforum/p...', 170, Array)
#1 src/addons/CMTV/UsernameChange/XF/Entity/User.php(124): CMTV\UsernameChange\XF\Entity\User->getUsernameChangeFrequency()
#2 src/addons/CMTV/UsernameChange/XF/Pub/Controller/Account.php(29): CMTV\UsernameChange\XF\Entity\User->isTimeLimitExpired()
#3 src/XF/Mvc/Dispatcher.php(249): CMTV\UsernameChange\XF\Pub\Controller\Account->actionAccountDetails(Object(XF\Mvc\ParameterBag))
#4 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'AccountDetails', 'html', Object(XF\Mvc\ParameterBag), 'account', Object(CMTV\UsernameChange\XF\Pub\Controller\Account), NULL)
#5 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#7 src/XF.php(329): XF\App->run()
#8 index.php(13): XF::runApp('XF\\Pub\\App')
#9 {main}

Here's a screenshot:

187634


Any idea why this might be happening?
 
@CMTV received an error whilst trying to analyse node permissions for a user.

The following server errors have been logged in the Admin CP:
Code:
    ErrorException: [E_NOTICE] Undefined index: CMTV_UC src/addons/CMTV/UsernameChange/XF/Admin/Controller/Permission.php:25 

    Generated by: Andy Jan 3, 2019 at 5:24 PM 

Stack trace

#0 src/addons/CMTV/UsernameChange/XF/Admin/Controller/Permission.php(25): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/nerdface/...', 25, Array)
#1 src/XF/Mvc/Dispatcher.php(249): CMTV\UsernameChange\XF\Admin\Controller\Permission->actionAnalyze(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Permission', 'Analyze', 'html', Object(XF\Mvc\ParameterBag), 'permissions', Object(CMTV\UsernameChange\XF\Admin\Controller\Permission), NULL)
#3 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#4 src/XF/App.php(1934): XF\Mvc\Dispatcher->run()
#5 src/XF.php(333): XF\App->run()
#6 admin.php(13): XF::runApp('XF\\Admin\\App')
#7 {main}

Request state

array(4) {
  ["url"] => string(30) "/admin.php?permissions/analyze"
  ["referrer"] => string(52) "https://nerdface.co.uk/admin.php?permissions/analyze"
  ["_GET"] => array(1) {
    ["permissions/analyze"] => string(0) ""
  }
  ["_POST"] => array(4) {
    ["username"] => string(4) "Airo"
    ["content_id"] => string(1) "8"
    ["content_type"] => string(4) "node"
    ["_xfToken"] => string(8) "********"
  }
}
Code:
    ErrorException: [E_WARNING] array_shift() expects parameter 1 to be array, null given src/addons/CMTV/UsernameChange/XF/Admin/Controller/Permission.php:27 

    Generated by: Andy Jan 3, 2019 at 5:24 PM 

Stack trace

#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] arr...', '/home/nerdface/...', 27, Array)
#1 src/addons/CMTV/UsernameChange/XF/Admin/Controller/Permission.php(27): array_shift(NULL)
#2 src/XF/Mvc/Dispatcher.php(249): CMTV\UsernameChange\XF\Admin\Controller\Permission->actionAnalyze(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Permission', 'Analyze', 'html', Object(XF\Mvc\ParameterBag), 'permissions', Object(CMTV\UsernameChange\XF\Admin\Controller\Permission), NULL)
#4 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src/XF/App.php(1934): XF\Mvc\Dispatcher->run()
#6 src/XF.php(333): XF\App->run()
#7 admin.php(13): XF::runApp('XF\\Admin\\App')
#8 {main}

Request state

array(4) {
  ["url"] => string(30) "/admin.php?permissions/analyze"
  ["referrer"] => string(52) "https://nerdface.co.uk/admin.php?permissions/analyze"
  ["_GET"] => array(1) {
    ["permissions/analyze"] => string(0) ""
  }
  ["_POST"] => array(4) {
    ["username"] => string(4) "Airo"
    ["content_id"] => string(1) "8"
    ["content_type"] => string(4) "node"
    ["_xfToken"] => string(8) "********"
  }
}
 
Code:
XF\Db\Exception: MySQL query error [1364]: Field 'display_condition' doesn't have a default value in src/XF/Db/AbstractStatement.php at line 217
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 77
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 89
XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 172
XF\Db\AbstractAdapter->insert() in src/addons/CMTV/UsernameChange/Setup.php at line 80
CMTV\UsernameChange\Setup->installStep5() in src/XF/AddOn/StepRunnerInstallTrait.php at line 60
CMTV\UsernameChange\Setup->installStepRunner() in src/XF/AddOn/StepRunnerInstallTrait.php at line 27
CMTV\UsernameChange\Setup->install() in src/XF/Admin/Controller/AddOn.php at line 398
XF\Admin\Controller\AddOn->actionInstall() in src/XF/Mvc/Dispatcher.php at line 321
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
XF\App->run() in src/XF.php at line 390
XF::runApp() in admin.php at line 13
 
Not working on 2.1 for me - won't install.

Exception: MySQL query error [1364]: Field 'display_condition' doesn't have a default value
 
Thank you for the addon, working smoothly :)
Suggestion : change pseudo on the fly when clicking in history view :)
 
CMTV updated Username change with a new update entry:

Update 2.1.0 – XenForo 2.1 support & New features

Username Change 2.1.0 was rewritten from scratch. It is compatible with previous addon version but only works with XF 2.1 and above!

After upgrading check addon permissions!

New features

Read the rest of this update entry...
 
I am afraid I don't understand what you mean. It is better to ask @DragonByte Tech. If needed, new username change records can be added by simply creating and saving a UsernameChange entity and updating two columns of User entity.
All 3rd party add-ons already generate change logs for their changes, assuming they save the entity via the normal way instead of fastUpdate.

/admin.php?logs/user-change / log is here. ( dbshop plugin created by log )

But, @CMTV not on profile page.
 
This doesn't work with User Essentials by @Xon
I have disabled username change feature of his addon, and even disabled template modifications made to account_details, but that just hides the username field. Only disabling User Essentials fixes this.
 
I like older style for buttons (▼ button at right side of names)
Can you add options for switching button?
 
I'm getting this error when I try to analyze node permissions for a user.

ErrorException: [E_NOTICE] Undefined index: CMTV_UC src/addons/CMTV/UsernameChange/XF/Admin/Controller/Permission.php:29

Code:
#0 src/addons/CMTV/UsernameChange/XF/Admin/Controller/Permission.php(29): XF::handlePhpError(8, '[E_NOTICE] Unde...', 's...', 29, Array)
#1 src/XF/Mvc/Dispatcher.php(321): CMTV\UsernameChange\XF\Admin\Controller\Permission->actionAnalyze(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Permission', 'Analyze', Object(XF\Mvc\RouteMatch), Object(CMTV\UsernameChange\XF\Admin\Controller\Permission), NULL)
#3 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(CMTV\UsernameChange\XF\Admin\Controller\Permission), NULL)
#4 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#6 src/XF.php(390): XF\App->run()
#7 admin.php(13): XF::runApp('XF\\Admin\\App')
#8 {main}

@CMTV , I've submitted a Pull Request that fixes this issue.
 
Last edited:
Bug report:

1> installed a few minutes ago.... the "Change username" option was set to YES for a handful of usergroups. It should be set to "no" by default

2> Username Change frequency is not respected if a usergroup is set to "no"...for example, if I have Registered usergroups set as "Change username = no", then the "change frequency" should be ignore entirely. Instead, a "higher" usergroup is has "Change username = yes" and "frequency = 180"....yet, when you analyze permissions, that usergroup is respecting the "change frequency = 30" that was set in the Registered group.

EDIT: screenshot added....perfect example for MY username/admin account....Registered is set to "no / 0" and Admin is set to "yes / 30"....yet the applied/recognized Change frequency is still zero.

usernamechange.webp
 
Last edited:
Back
Top Bottom