| … | |
… | |
| 58 | |
58 | |
| 59 | use mod_perl; |
59 | use mod_perl; |
| 60 | use constant MP2 => ( exists $ENV{MOD_PERL_API_VERSION} and $ENV{MOD_PERL_API_VERSION} >= 2 ); |
60 | use constant MP2 => ( exists $ENV{MOD_PERL_API_VERSION} and $ENV{MOD_PERL_API_VERSION} >= 2 ); |
| 61 | |
61 | |
| 62 | |
62 | |
| 63 | #################### |
63 | ##################### |
| 64 | ## WeBWorK-tr Import localization handle |
64 | ## WeBWorK-tr modification |
| 65 | ## FIXME: we can't import the handle from $WeBWorK::ContentGenerator::LH |
|
|
| 66 | |
|
|
| 67 | use WeBWorK::Localize; |
|
|
| 68 | #$LH = $WeBWorK::LH; |
|
|
| 69 | my $LH = WeBWorK::Localize->get_handle("tr"); |
|
|
| 70 | |
|
|
| 71 | ## If GENERIC_ERROR_MESSAGE is constant, we can't translate it |
65 | ## If GENERIC_ERROR_MESSAGE is constant, we can't translate it |
|
|
66 | |
| 72 | #use vars qw($GENERIC_ERROR_MESSAGE); |
67 | #use vars qw($GENERIC_ERROR_MESSAGE); |
| 73 | our $GENERIC_ERROR_MESSAGE = ""; # define in new |
68 | our $GENERIC_ERROR_MESSAGE = ""; # define in new |
| 74 | |
69 | |
| 75 | ## WeBWorK-tr end modification |
70 | ## WeBWorK-tr end modification |
| 76 | ##################### |
71 | ##################### |
|
|
72 | |
| 77 | |
73 | |
| 78 | use constant COOKIE_LIFESPAN => 60*60*24*30; # 30 days |
74 | use constant COOKIE_LIFESPAN => 60*60*24*30; # 30 days |
| 79 | #use constant GENERIC_ERROR_MESSAGE => "Invalid user ID or password."; |
75 | #use constant GENERIC_ERROR_MESSAGE => "Invalid user ID or password."; |
| 80 | |
76 | |
| 81 | |
77 | |
| … | |
… | |
| 146 | my $class = ref($invocant) || $invocant; |
142 | my $class = ref($invocant) || $invocant; |
| 147 | my $self = { |
143 | my $self = { |
| 148 | r => $r, |
144 | r => $r, |
| 149 | }; |
145 | }; |
| 150 | #initialize |
146 | #initialize |
| 151 | $GENERIC_ERROR_MESSAGE = $LH->maketext("Invalid user ID or password."); |
147 | $GENERIC_ERROR_MESSAGE = $r->maketext("Invalid user ID or password."); |
| 152 | bless $self, $class; |
148 | bless $self, $class; |
| 153 | return $self; |
149 | return $self; |
| 154 | } |
150 | } |
| 155 | |
151 | |
| 156 | =back |
152 | =back |