View Issue Details

This issue affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
20770Bug reportsPluginspublic2026-10-15 20:35
Reportertassoman Assigned Toc_schmitz  
PrioritynoneSeverityminor 
Status closedResolutionduplicate 
Summary20770: Plugin event: createNewUser not working properly
Description

According documentation createNewUser event is triggered while adding an user by admin user management interface.
https://www.limesurvey.org/manual/CreateNewUser#Output_Parameters_(Set_by_Plugins)

Steps To Reproduce

Steps to reproduce

Create a plugin who hooks the event. And put following code:

    public function createNewUser()
    {
        traceVar([
            'fn' => __FUNCTION__,
        ]);

        $oEvent = $this->getEvent();
        $oEvent->set('preCollectedUserArray', []);
        $oEvent->set('errorCode', self::ERROR_NOT_ADDED);
        $oEvent->set('errorMessageTitle', 'Disabled feature');
        $oEvent->set('errorMessageBody', 'Not authorized');
    }

Or simply put return;

Expected result

User is not created

Actual result

UI error message is effective, REST call "success" is false, but the user still be created.

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)7.5.1+261007
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySql 8.x
Server OS (if known)
Webserver software & version (if known)
PHP Version8.3

Relationships

duplicate of 16391 resolvedc_schmitz Allow beforeModelSave and Dynamic model events to do validations 

Users monitoring this issue

tassoman

Activities

tassoman

tassoman

2026-10-15 17:11

reporter   ~86473

Also throwing a new exception, is ineffective ;_ ;
throw new CHttpException(401, 'Feature was disabled');

c_schmitz

c_schmitz

2026-10-15 20:35

administrator   ~86474

This will be possible in the next version and is resolved by 16391

You would use something like
$this->getEvent()->get('modelEvent')->isValid = false;.

Issue History

Date Modified Username Field Change
2026-10-15 17:05 tassoman New Issue
2026-10-15 17:06 tassoman Issue Monitored: tassoman
2026-10-15 17:06 tassoman Bug heat 0 => 2
2026-10-15 17:11 tassoman Note Added: 86473
2026-10-15 17:11 tassoman Bug heat 2 => 4
2026-10-15 20:33 c_schmitz Relationship added duplicate of 16391
2026-10-15 20:35 c_schmitz Note Added: 86474
2026-10-15 20:35 c_schmitz Bug heat 4 => 6
2026-10-15 20:35 c_schmitz Assigned To => c_schmitz
2026-10-15 20:35 c_schmitz Status new => closed
2026-10-15 20:35 c_schmitz Resolution open => duplicate