Documentation

AuthForm

CMain::AuthForm(
 mixed mess,
 bool show_prolog = true,
 bool show_epilog = true,
 string not_show_links = "N",
 bool do_die = true
)

The method includes components depending on the parameters passed in the URL:

ParameterValueComponent name
forgot_passwordyesLost password retrieval (system.auth.forgotpasswd)
change_passwordyes(Lost password change (system.auth.changepasswd)
registeryesRegistration form (system.auth.registration)
authorize_registrationyesAuthorization and registration form (system.auth.authorize)

If neither of the parameters are specified, the method includes the "Authorization form" component (main/auth/authorize.php). .

Note.The method stops the execution of the current page after the inclusion of the required component.

Non-static method.

Parameters

ParameterDescription Available from version
messString containing the error message, or array in the format Array("MESSAGE" => message, "TYPE" => "ERROR"|"OK") (processed in the ShowMessage function)
show_prologIf true, the method emits the prologue code (top part of a page). If set to false, the prolog is not emitted.
show_epilogIf true, the method emits the epilogue code (bottom part of a page). If set to false, the epilog is not emitted.
not_show_linksThis parameter is passed to the component "Authorization form" (main/auth/authorize.php). If set to Y, the links to register, retrieve or change the forgotten password are not displayed. If set to N, the links are displayed (the default behaviour).
do_dieIf true, the page will be completed after the form is displayed and (optionally) epilog as well. If set to false - page will not be interrupted.

See Also

Examples of use

<?
// get read access permission for the file
// "/download/document.doc" for the current user 
$FILE_PERM = $APPLICATION->GetFileAccessPermission("/download/document.doc");
$FILE_PERM = (strlen($FILE_PERM)>0 ? $FILE_PERM : "D");
// display the auth. form is read access is denied
if($FILE_PERM < "R") $APPLICATION->AuthForm("Cannot access this file.");
?>


© «Bitrix24», 2001-2024
Up