public function hookPrepareForm(Dictionary $params)
    {
        $session = $params['session'];
        $form = $params['form'];
        if ($session !== null)
        {
            $nonce_name = Nonce::getParameterName();
            if (!isset($form[$nonce_name]))
            {
                $context = [];
                $nonce = Nonce::getNonce($form->getName(), $session, $context);
                $form->add(new FormField($nonce_name, Type::STRING, "hidden", $nonce));
            }
        }
    }
public function hookPrepareForm(Dictionary $params)
    {
        $session = $params['session'];
        $form = $params['form'];
        if ($session !== null)
        {
            $nonce_name = Nonce::getParameterName();
            if (!isset($form[$nonce_name]))
            {
                $context = [];
                $nonce = Nonce::getNonce($form->getName(), $session, $context);
                $form->add(new FormField($nonce_name, Type::STRING, "hidden", $nonce));
            }
        }
    }
public function hookPrepareForm ( Dictionary $ params ) { $ session = $ params [ 'session' ] ; $ form = $ params [ 'form' ] ; if ( $ session !== null ) { $ nonce_name = Nonce :: getParameterName ( ) ; if ( ! isset ( $ form [ $ nonce_name ] ) ) { $ context = [ ] ; $ nonce = Nonce :: getNonce ( $ form -> getName ( ) , $ session , $ context ) ; $ form -> add ( new FormField ( $ nonce_name , Type :: STRING , "hidden" , $ nonce ) ) ; } } }
The hook called when the form is being prepared. Is used to
add the nonce field to the form.
The hook called when the form is being prepared . Is used to add the nonce field to the form .