package DADA::App::Error; =pod =head1 NAME DADA::App::Error =head1 SYNOPSIS use DADA::App::Error This module basically has error messages in HTML and spits 'em back at ya. =cut use lib './'; use lib '../'; use DADA::Config; use DADA::App::Guts; use DADA::Template::HTML; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(cgi_user_error); use strict; use vars qw(@EXPORT); my %error; require CGI; my $q = new CGI; if(($PROGRAM_URL eq "") || ($PROGRAM_URL eq 'http://www.changetoyoursite.com/cgi-bin/dada/mail.cgi')){ $PROGRAM_URL = $q->url(); } if(($S_PROGRAM_URL eq "") || ($S_PROGRAM_URL eq 'http://www.changetoyoursite.com/cgi-bin/dada/mail.cgi')){ $S_PROGRAM_URL = $q->url(); } $error{no_list} = <I Couldn't Find List ([list_name])

I had trouble fetching [list_name] from this server. It's possible that it has been deleted or moved and the form you used is a bit out of date.

EOF ; $error{no_list_password} = <Problem Logging In

Please refer to the error logs for more information.

EOF ; $error{invalid_password} = <Your Password is Incorrect

The password you gave me doesn't seem to be correct. You might have typed it in wrong. Try typing it in again. If you forgot your password, have it emailed back to you.

Try signing into [list_name] again

If you keep getting bounced back to this screen, make sure that cookies are turned 'on' in your Web browser.

EOF ; $error{need_to_login} = <You Need to Log In

I didn't catch the name of your list or its password. I need those to let you into your administration control panel.

[list_login_form] EOF ; $error{email_in_list} = <You're already subscribed!

Your email address, [email], has already been subscribed to:

[list_name].

This may be because:

  • You've successfully subscribed to this list in the past.
  • You clicked the subscription confirmation link that was mailed to you, twice.
  • The list owner has already subscribed your email address.

If you would like to subscribe to a different list, please visit the $PROGRAM_NAME main screen, which will have a list of all available lists.

If you want to unsubscribe from this list instead, please visit this list's main screen.

EOF ; $error{email_not_in_list} = <You're not subscribed!

Your email address, [email], is not subscribed to:

[list_name].

This may be because:

  • You've successfully unsubscribed to this list in the past.
  • You clicked the unsubscription confirmation link that was mailed to you, twice.
  • The list owner has already unsubscribed your email address.

If you would like to unsubscribe from a different list, please visit the $PROGRAM_NAME main screen, which will have a list of all available lists.

If you want to subscribe to this list instead, please visit this list's main screen.

EOF ; $error{invalid_email} = <Invalid Email Address

The address you gave, [email], doesn't seem to pass verification. It's possible that you just typed it in incorrectly. You may go back and resubmit your address or use the form below:

[list_popup_subscription_form] EOF ; $error{unsub_invalid_email} = $error{invalid_email}; $error{unsub_invalid_email} =~ s/list_popup_subscription_form/list_popup_unsubscription_form/g; $error{mx_lookup_failed} = <Invalid Email Address

The address you gave, [email], doesn't seem to pass our verification because we couldn't find the hostname. It's possible that you just typed it in incorrectly. You may go back and resubmit your address or use the form below:

[list_popup_subscription_form] EOF ; $error{pass_no_match} = <Your New Password Doesn't Match

The new password you typed isn't the same as the second time you typed it, or you didn't enter a new password at all.

Press the back button to fix the problem.

EOF ; $error{invalid_pin} = <Invalid Pin Number

The pin number you gave wasn't correct for your email address. You might have copied the confirmation or unsubscription address incorrectly. Be sure to copy the entire address into the address bar in your browser.

If you'd like, you may resubmit your email address:

[list_popup_subscription_form] EOF ; $error{invalid_root_password} = <Your Root Password is Incorrect

The root password you gave me didn't match up to the one one I have for your $PROGRAM_NAME script. Please try again:

Root Password

EOF ; $error{bad_ip} = <You are not allowed to log into your list control panel from your present IP Address.

EOF ; $error{no_archive_entry} = <Entry Not Available

The archived message you're trying to find isn't there. It may have been removed by the list owner.

EOF ; $error{no_archive} = <No Archive for [list_name]

I couldn't find an archive for [list_name]. Either the archive database is corrupted, or you never sent a message to be archived.

EOF ; $error{list_already_exists} = <The List Name [list_name] Already Exists

So as not to overwrite the list that's already set up, please pick a new name.

EOF ; $error{no_show_archives} = <No Archived Messages

There are no messages archived for this list that are available to be viewed.

EOF ; $error{no_display_attachments} = <Sorry,

Attachments for messages of this list are not displayed.

EOF ; $error{closed_list} = <Unable to Subscribe

This list you are trying to subscribe to is closed. Only the list administrator can subscribe people to the list.

EOF ; $error{over_subscription_quota} = <Unable to Subscribe

This list currently cannot have any more subscribers.

EOF ; $error{over_list_quota} = <Unable to Create a New List

The limit to the amount of lists that can be created has been reached.

EOF ; $error{stupid_programmer} = <Stupid, Stupid Programmer

Um, I have no idea whats wrong with what, whatever you did, um.... I'd close all programs and restart, usually that does the trick. You might want to give me a word or two about my laziness - write to: justin\@skazat.com and tell me how I should just stick to drawing pretty pictures.

*thanks*

EOF ; $error{no_permissions_to_write} = <Can't Create a New List

It seems I'm having trouble writing a new list to the directory you specified your lists to be:

$FILES

this might be because that directory doesn't exist, or I don't have permission to write to it. Make sure the directory path is correct. If your still getting this error, chmod 777 the directory and then setup a new list.

EOF ; $error{black_listed} = <You Are Unable to Subscribe

It seems that your not allowed to subscribe to [list_name] for some reason or another. This list may be closed to particular participants.

EOF ; $error{too_busy} = <$PROGRAM_NAME - Too Busy

Our apologies, but the server is too overloaded to take your request. Please try again in a few minutes and see if the server status has cleared up.

EOF ; $error{no_admin_permissions} = <Sorry,

It seems that you have not been given the permission to use/view this screen. It's most likely that this feature has been shut off by the Main Administrator.

EOF ; $error{no_root_password} = <No Root Password Set

The $PROGRAM_NAME Root Password has not been set to a valid value. List creation is not allowed with the $PROGRAM_NAME Root Password left blank.

EOF ; $error{bad_setup} = < Welcome to $PROGRAM_NAME.

$PROGRAM_NAME is running correctly, but is not configured properly - if you haven't configured the program, please do so now.

Click here for more information.

EOF ; $error{settings_possibly_corrupted} = <Please contact the Server Administrator at: $ENV{SERVER_ADMIN} detailing the problem you are having with this request.

EOF ; $error{no_support_for_displaying_message_source} = <Sorry,

Viewing the message source of an archived message is not supported.

EOF ; =pod =head1 SUBROUTINES =head2 cgi_user_error print cgi_user_error(-List => 'my_list', -Error => 'some_error', -Email => 'some@email.com'); Gives back an HTML friendly error message. =cut sub cgi_user_error { my %args = (-List => undef, -Error => undef, -Email => undef, @_); my $return_html; my $available_lists_ref; my $li = {}; my $list_exists = 0; my $list_login_form = ""; if($args{-Error} ne 'bad_setup'){ $list_exists = check_if_list_exists( -List=> $args{-List}) || 0; if($list_exists > 0) { require DADA::MailingList::Settings; my $ls = DADA::MailingList::Settings->new(-List => $args{-List}); $li = $ls->get; } } $return_html .= (the_html(-Part => "header", -Title => "There seems to be a problem", -List => $li->{list}, -Start_Form => 0, )); if(defined($error{$args{-Error}})) { my $error_msg = $error{$args{-Error}}; require DADA::Template::Widgets; if($args{-Error} ne 'bad_setup'){ if($LOGIN_WIDGET eq 'popup_menu'){ $list_login_form = DADA::Template::Widgets::list_popup_login_form(); } elsif($LOGIN_WIDGET eq 'text_box') { $list_login_form = DADA::Template::Widgets::screen(-screen => 'text_box_login_form.tmpl', -expr => 1); }else{ warn "'$LOGIN_WIDGET' misconfigured!" } } my $list_popup_subscription_form; my $list_popup_unsubscription_form; if($args{-List}){ $list_popup_subscription_form = DADA::Template::Widgets::screen(-screen => 'list_subscribe_form.tmpl', -list => $args{-List}, -expr => 1, -vars => {-email => $args{-Email}}); $list_popup_unsubscription_form = DADA::Template::Widgets::screen(-screen => 'list_subscribe_form.tmpl', -list => $args{-List}, -expr => 1, -vars => {-email => $args{-Email}, -set_flavor => 'u'} ); }else{ $list_popup_subscription_form = DADA::Template::Widgets::list_popup_subscription_form(-email => $args{-Email}, -show_hidden =>1); $list_popup_unsubscription_form = DADA::Template::Widgets::list_popup_subscription_form(-email => $args{-Email}, -set_flavor => 'u', -show_hidden => 1); } $error_msg =~ s/\[list_popup_subscription_form\]/$list_popup_subscription_form/g; $error_msg =~ s/\[list_popup_unsubscription_form\]/$list_popup_unsubscription_form/g; $error_msg =~ s/\[list_login_form\]/$list_login_form/g; $error_msg =~ s/\[email\]/$args{-Email}/g; $error_msg = interpolate_string(-String => $error_msg, -List_Db_Ref => $li); $return_html .= $error_msg; }else{ $return_html .= $args{-Error}; } if($args{-Error} eq 'bad_setup'){ my $error_report; my @tests = ($FILES, $TEMPLATES, $TMP); if($PROGRAM_CONFIG_FILE_DIR){ push(@tests, $PROGRAM_CONFIG_FILE_DIR); } my %sift; foreach(@tests){$sift{$_}++} @tests = keys %sift; foreach my $test_dir(@tests){ unless(-d $test_dir){ $error_report .= "

'$test_dir' is NOT a directory.

\n"; } unless(-e $test_dir){ $error_report .= "

'$test_dir' DOES NOT exist.

\n"; } } $return_html .= $error_report; } if(keys %$li){ if (($list_exists > 0) && ($li->{list_owner_email})) { $return_html .= '

If you would like to receive more assistance, please email the '; $return_html .= 'list owner with your problem.

'; } } $return_html .= (the_html( -Part => "footer", -List => $li->{list}, -End_Form => 0, -Site_Name => $li->{website_name}, -Site_URL => $li->{website_url}, )); return $return_html; }