CoreAPI
[ class tree: CoreAPI ] [ index: CoreAPI ] [ all elements ]

Procedural File: form_api.php

Source Location: /core/form_api.php



Page Details:

Form API for handling tasks necessary to form security and validation.

Security methods are targetted to work with both GET and POST form types, and should allow multiple simultaneous edits of the form to be submitted.




Tags:

copyright:  Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
copyright:  Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
link:  http://www.mantisbt.org
uses:  session_api.php








form_action_self [line 37]

string form_action_self( )

Helper function to generate a form action value when forms are designed to be submitted to the same url that's is currently being used, such as helper_ensure_confirmed() or auth_reauthenticate().



Tags:

return:  Form action value


[ Top ]



form_security_field [line 82]

string form_security_field( string $p_form_name)

Get a hidden form element containing a generated form security token.



Tags:

return:  Hidden form element to output


Parameters

string   $p_form_name   Form name
[ Top ]



form_security_param [line 102]

string form_security_param( string $p_form_name)

Get a URL parameter containing a generated form security token.



Tags:

return:  Hidden form element to output


Parameters

string   $p_form_name   Form name
[ Top ]



form_security_purge [line 166]

void form_security_purge( string $p_form_name)

Purge form security tokens that are older than 3 days, or used for form validation.



Parameters

string   $p_form_name   Form name
[ Top ]



form_security_token [line 48]

string form_security_token( string $p_form_name)

Generate a random security token, prefixed by date, store it in the user's session, and then return the string to be used as a form element element with the security token as the value.



Tags:

return:  Security token string


Parameters

string   $p_form_name   Form name
[ Top ]



form_security_validate [line 124]

boolean form_security_validate( string $p_form_name)

Validate the security token for the given form name based on tokens stored in the user's session. While checking stored tokens, any that are more than 3 days old will be purged.



Tags:

return:  Form is valid


Parameters

string   $p_form_name   Form name
[ Top ]



Documentation generated on Sun, 12 Dec 2010 23:50:29 +0900 by phpDocumentor 1.4.3
inserted by FC2 system