Accessing the raw post data from an $event My users have an accountBalance field and there's a createInvoice service in my plugin. I'd like to autogenerate an invoice whenever the accountBalance changes (including from the admin cp), while optionally passing in extra invoice info. Is there a way to access the raw post data from the event to check for extra info like invoice skus and descriptions?

In my plugin I have the following code.

craft()-&gt;on('users.onBeforeSaveUser', function(Event $event)
{
    $userId = $event-&gt;params['user']-&gt;id;
    $user = craft()-&gt;users-&gt;getUserById($userId);

    //raw post data is private so these lines are pseudo code
    if ($extraPostData != null)
    {
        $desc = $event-&gt;params['_rawPostData']['invoiceDescription'];
        $sku = $event-&gt;params['_rawPostData']['invoiceSku'];
    }

    $oldBalance = $user-&gt;accountBalance;
    $newBalance = $event-&gt;params['user']-&gt;accountBalance;
    if ($newBalance != $oldBalance)
    {
        $balanceDelta = $newBalance - $oldBalance;

        //plugin service has defaults if $desc/$sku are empty or null
        craft()-&gt;myPlugin-&gt;createInvoice($balanceDelta, $userId, $desc, $sku);
    }
}


Alternatively, is there a way to disable adjusting the accountBalance user field from the admin cp?
You can just grab whatever you need either from $_POST or, more preferably, craft()->request->getPost().