Additional userfields + edit user acp form



I have a add-on which adds own fields to the edit user acp form.

I've created a own proxycontroller exstending the controlleradmin_user to extend the actionSave()

If i edit an existing user, it's working fine.
BUT if i create a new user, the userid is missing and my own method can't access the new userId to be able to save the add-on related userfields.

public function actionSave()
        $return = parent::actionSave();
        $userId = $this->_input->filterSingle('user_id', XenForo_Input::UINT);
return $this->responseRedirect(
            XenForo_Link::buildAdminLink('users/search', null, array('last_user_id' => $userId)) . $this->getLastHash($userId)
Is it possible to get the userId in my method?
I way would be to overwrite the method completly with my own, but that's imho unneccessary and a little bit dirty because i would need to change this, everytime when the original method was changed to AND if every add-on would do this, it wouldn't work because every method would try to do the same (from the original method) + then the own stuff.

I checked the return from the parent method and i saw that i could MAYBE use the redirectTarget to extract the userid
[redirectTarget] => admin.php?users/search&last_user_id=140#_140

but is there any better way for this?


Problem is related to and all other forms with an redirect^^

Here's my example code:

The same problem exists with pages and own fields.

we had to overwrite the COMPLETE actionSave method, copy the copy the code into my method and add the 2 new fields... (ugly c&p code)


I've found this workaround
class Ragtek_Invite_ControllerAdmin_User extends

    public function actionSave()
        $return = parent::actionSave();
        $target = $return->redirectTarget;

        $pattern = '/(?P<foo>\w+)#_(?P<userid>\d+)/';
        preg_match($pattern, $target, $matches);

        $userId = $matches['userid'];

        if (Ragtek_Invite_Helper::canAdmin() AND $userId != 0) {

            if ($userId) {
                $user = $this->_getUserOrError($userId);