############################################################ # AUTH-EXTRA-HTML.PL # # This script was written by Selena Sol & Gunther Birznieks. # Date Created: 5-10-96 # Date Last Modified: 5-14-96 # # You may copy this under the terms of the GNU General Public # License or the Artistic License which is distributed with # copies of Perl v5.x for UNIX. # # Selena Sol may be contacted at selena@eff.org # # Purpose: This script contains all the cosmetic HTML output # routines related to the authentication routines. # # Main Procedures: # All the routines are ancillary to the auth-extra-lib.pl # file. # # Special Notes: Nearly all the routines below accept # some sort of parameter. These parameters are only for # printing out extra information. They are not doing any # significant processing. # # ############################################################ ############################################################ # # subroutine: PrintLogonPage # # This routine outputs the logon HTML page along with # a bad logon message if one exists. Hidden form tags # are generated automatically if we are passing previous # form data from the main script. # ############################################################ sub PrintLogonPage { local($bad_logon_message, $main_script, *in) = @_; local($form_tags); local($register_tag); local($search_tag); if (length($auth_logon_title) < 1) { $auth_logon_title = "Submit Logon"; } if (length($auth_logon_header) < 1) { $auth_logon_header = "Enter Your Logon Information"; } $register_tag = ""; $search_tag = ""; if ($auth_allow_register eq "on") { $register_tag = <<__END_OF_REG_TAG__;

__END_OF_REG_TAG__ } if ($auth_allow_search eq "on") { $search_tag = <<__END_OF_SEARCH_TAG__;

__END_OF_SEARCH_TAG__ } $form_tags = &PrintCurrentFormVars(*in); print <<__END_OF_LOGON__; $auth_logon_title

$auth_logon_header


$bad_logon_message
$form_tags
Username
Password

$register_tag $search_tag


__END_OF_LOGON__ } # End of PrintLogonPage ############################################################ # # subroutine: PrintSearchPage # # This routine outputs the Search HTML page if one exists. # Hidden form tags are generated automatically if we are # passing previous form data from the main script. # ############################################################ sub PrintSearchPage { local($main_script,*in) = @_; local($form_tags); $form_tags = &PrintCurrentFormVars(*in); print <<__END_OF_SEARCH__; Search For An Account

Search For Matching Username


Enter Your Email Address To Search For A Matching Username

$form_tags
Email

__END_OF_SEARCH__ } # End of PrintSearchPage ############################################################ # # subroutine: HTMLPrintSearchResults # # This routine outputs the results of the search for # usernames using an email address # ############################################################ sub HTMLPrintSearchResults { local($main_script, $form_tags, $user_list) = @_; print <<__END_SEARCHRESULTS__; User Found

User Was Found In The Search


List Of Users

$user_list
$form_tags
__END_SEARCHRESULTS__ } # End of HTMLPrintSearchResults ############################################################ # # subroutine: HTMLPrintNoSearchResults # # This routine prints the HTML related to not having # found any results from the search on email address. # ############################################################ sub HTMLPrintNoSearchResults { local($main_script, $form_tags) = @_; print <<__END_NOSEARCHRESULTS__; No Users Found

Sorry, No Users Found


Sorry, No users were found that matched your email address

$form_tags
__END_NOSEARCHRESULTS__ } # End HTMLPrintNoSearchResults ############################################################ # # subroutine: PrintRegisterPage # # This routine outputs the Register HTML page. Hidden form # tags are generated automatically if we are passing previous # form data from the main script. # ############################################################ sub PrintRegisterPage { local($main_script,*in) = @_; local($form_tags); local($more_form_input,$password_input, $x); $form_tags = &PrintCurrentFormVars(*in); local ($password_message); # # We also check for the extra fields and output HTML # asking for input on the extra fields. # $more_form_input = ""; for ($x = 0; $x <= @auth_extra_fields - 1; $x++) { $more_form_input .= <<__END_OF_EXTRA_FIELDS__; $auth_extra_desc[$x] __END_OF_EXTRA_FIELDS__ } $password_input = ""; if ($auth_generate_password ne "on") { $password_input = <<__END_OF_PASSWORD_FIELDS__; Password Password Again __END_OF_PASSWORD_FIELDS__ } $password_message = ""; if ($auth_generate_password eq "on") { $password_message = <<__PASSWORDMSG__; Your password will be automatically generated and sent to you via your E-Mail address. __PASSWORDMSG__ } print <<__END_OF_REGISTER__; Register For An Account

Enter The Registration Information


$form_tags $password_input $more_form_input
User Name

$password_message

__END_OF_REGISTER__ } # End of PrintRegisterPage ############################################################ # # subroutine: HTMLPrintRegisterSuccess # # This routine prints the HTML for a successful user # registration. # ############################################################ sub HTMLPrintRegisterSuccess { local($main_script, $form_tags) = @_; print <<__END_OF_REGISTER_SUCCESS__; Registration Added

You Have been added to the user database


$form_tags
$auth_register_message
__END_OF_REGISTER_SUCCESS__ } # End of RegisterSuccess ############################################################ # # subroutine: HTMLPrintRegisterFoundDuplicate # # This routine prints the HTML for a failed user # registration because of finding a duplicate username # ############################################################ sub HTMLPrintRegisterFoundDuplicate { local($main_script, $form_tags) = @_; print <<__END_OF_REGISTER_DUPLICATE__; Problem with Registration

Problem with Registration


$form_tags
Sorry, your username is already in the database
__END_OF_REGISTER_DUPLICATE__ } # End of HTMLPrintRegisterFoundDuplicate ############################################################ # # subroutine: HTMLPrintRegisterNoPasswordMatch # # This routine prints the HTML for a failed user # registration because the two passwords did not match # ############################################################ sub HTMLPrintRegisterNoPasswordMatch { local($main_script, $form_tags) = @_; print <<__END_OF_REGISTER_NOMATCH__; Problem with Registration

Problem with Registration


$form_tags
Sorry, the two passwords you typed in did not match.
__END_OF_REGISTER_NOMATCH__ } # End of HTMLPrintRegisterNoPasswordMatch ############################################################ # # subroutine: HTMLPrintRegisterFoundDuplicate # # This routine prints the HTML for a failed user # registration because of finding a missing value or # a value that has a PIPE in it. # ############################################################ sub HTMLPrintRegisterNoValidValues { local ($main_script, $form_tags) = @_; print <<__END_OF_REGISTER_NOVALUE__; Problem with Registration

Problem with Registration


$form_tags
Sorry, you need to enter a valid value for every field
__END_OF_REGISTER_NOVALUE__ } # End of HTMLPrintRegisterNoValidValues 1;