pipit_members_is_authorized_submission()

Check whether a Perch form submission was performed by a logged in member. The function checks the submitted CSRF token against the current session’s.

pipit_members_is_authorized_submission($SubmittedForm);

The function is useful if you have a custom Perch app with a form handler that handles submissions from members.

Parameters

Type Description
object PerchAPI_SubmittedForm object

Return

Boolean

Usage

function my_app_form_handler($SubmittedForm) {
    if( !pipit_members_is_authorized_submission($SubmittedForm) || !perch_member_logged_in() ) {
        $SubmittedForm->throw_error('unauthorized', 'token');
        return false;
    }
}
link