| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# -*- Mode: Perl -*- |
|
2
|
|
|
|
|
|
|
# $Basename: Screen.pm $ |
|
3
|
|
|
|
|
|
|
# $Revision: 1.27 $ |
|
4
|
|
|
|
|
|
|
# Author : Ulrich Pfeifer |
|
5
|
|
|
|
|
|
|
# Created On : Thu Dec 18 09:26:31 1997 |
|
6
|
|
|
|
|
|
|
# Last Modified By: Ulrich Pfeifer |
|
7
|
|
|
|
|
|
|
# Last Modified On: Fri Feb 5 17:05:16 1999 |
|
8
|
|
|
|
|
|
|
# Language : CPerl |
|
9
|
|
|
|
|
|
|
# |
|
10
|
|
|
|
|
|
|
# (C) Copyright 1997, Ulrich Pfeifer |
|
11
|
|
|
|
|
|
|
# |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package CGI::Screen; |
|
14
|
2
|
|
|
2
|
|
11169
|
use CGI; |
|
|
2
|
|
|
|
|
37319
|
|
|
|
2
|
|
|
|
|
13
|
|
|
15
|
2
|
|
|
2
|
|
105
|
use strict; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
64
|
|
|
16
|
2
|
|
|
2
|
|
7
|
use vars qw($VERSION $AUTOLOAD); |
|
|
2
|
|
|
|
|
8
|
|
|
|
2
|
|
|
|
|
1378
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# $Format: "$\VERSION = sprintf '%5.3f', ($ProjectMajorVersion$ * 100 + ($ProjectMinorVersion$-1))/1000;"$ |
|
19
|
|
|
|
|
|
|
$VERSION = sprintf '%5.3f', (1 * 100 + (22))/1000; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _set_screen { |
|
22
|
1
|
|
|
1
|
|
2
|
my ($self, $screen, $title) = @_; |
|
23
|
1
|
|
|
|
|
1
|
my $func; |
|
24
|
|
|
|
|
|
|
|
|
25
|
1
|
50
|
|
|
|
17
|
if ($self->{screen_func} = $self->can($screen . '_data' )) { |
|
|
|
50
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
0
|
$self->{no_headers} = 1; |
|
27
|
|
|
|
|
|
|
} elsif ($self->{screen_func} = $self->can($screen . '_screen')) { |
|
28
|
|
|
|
|
|
|
} else { |
|
29
|
0
|
|
|
|
|
0
|
warn "No such screen: '$screen'\n"; |
|
30
|
0
|
|
|
|
|
0
|
return; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
1
|
|
|
|
|
2
|
$self->{screen_name} = $screen; |
|
33
|
1
|
|
33
|
|
|
10
|
$self->{screen_title} = $title || $self->param('screen_'.$screen); |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# We keep track of the screens here in order to be able to jump back |
|
36
|
1
|
|
|
|
|
17
|
my @screen_last_name = $self->param('screen_last_name'); |
|
37
|
1
|
|
|
|
|
13
|
my @screen_last_title = $self->param('screen_last_title'); |
|
38
|
1
|
50
|
33
|
|
|
21
|
if ( @screen_last_name > 1 and $screen_last_name[-2] eq $screen) { |
|
|
|
50
|
33
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# User did hit a 'back' button |
|
40
|
0
|
|
|
|
|
0
|
pop @screen_last_name; pop @screen_last_title; |
|
|
0
|
|
|
|
|
0
|
|
|
41
|
|
|
|
|
|
|
} elsif (not $self->{dont_cut_loops} and |
|
42
|
|
|
|
|
|
|
@screen_last_name and $screen_last_name[-1] eq $screen) { |
|
43
|
|
|
|
|
|
|
# Do nothing. We did jump to the same screen again |
|
44
|
|
|
|
|
|
|
} else { |
|
45
|
1
|
|
|
|
|
4
|
while (@screen_last_name > 7) {shift @screen_last_name; shift @screen_last_title;} |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
46
|
1
|
|
|
|
|
2
|
push @screen_last_name, $self->{screen_name}; |
|
47
|
1
|
|
|
|
|
1
|
push @screen_last_title, $self->{screen_title}; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
1
|
|
|
|
|
4
|
$self->param('screen_last_name', @screen_last_name); |
|
50
|
1
|
|
|
|
|
40
|
$self->param('screen_last_title', @screen_last_title); |
|
51
|
1
|
|
|
|
|
29
|
$self->{screen_last_name} = $screen_last_name[-2]; |
|
52
|
1
|
|
|
|
|
3
|
$self->{screen_last_title} = $screen_last_title[-2]; |
|
53
|
|
|
|
|
|
|
|
|
54
|
1
|
|
|
|
|
3
|
$self; # return true |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub last_screen { |
|
58
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
|
59
|
|
|
|
|
|
|
|
|
60
|
0
|
0
|
|
|
|
0
|
if (wantarray) { |
|
61
|
0
|
|
0
|
|
|
0
|
($self->{screen_last_name}, $self->{screen_last_title}||$self->{screen_last_name}); |
|
62
|
|
|
|
|
|
|
} else { |
|
63
|
0
|
|
|
|
|
0
|
$self->{screen_last_name}; |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub _check_auth_user { |
|
68
|
0
|
|
|
0
|
|
0
|
my $query = shift; |
|
69
|
0
|
0
|
|
|
|
0
|
my $user = $query->param('screen_user') or return; |
|
70
|
0
|
0
|
|
|
|
0
|
my $passwd = $query->param('screen_passwd') or return; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
0
|
$query->check_auth_user($user, $passwd); |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
my $D; |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub new { |
|
78
|
1
|
|
|
1
|
1
|
4041
|
my $type = shift; |
|
79
|
1
|
|
|
|
|
2
|
my $self = {}; |
|
80
|
|
|
|
|
|
|
|
|
81
|
1
|
50
|
33
|
|
|
5
|
if (@_>1 and $_[0] eq '-screen') { # grab our parameters |
|
82
|
0
|
|
|
|
|
0
|
shift; $self = shift; |
|
|
0
|
|
|
|
|
0
|
|
|
83
|
|
|
|
|
|
|
} |
|
84
|
|
|
|
|
|
|
|
|
85
|
1
|
|
|
|
|
5
|
$self->{cgi} = CGI->new(@_); |
|
86
|
|
|
|
|
|
|
|
|
87
|
1
|
|
|
|
|
185
|
bless $self, $type; $D = $self; |
|
|
1
|
|
|
|
|
2
|
|
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# Poor man's Authentication. |
|
90
|
1
|
50
|
|
|
|
13
|
if (my $func = $self->can('check_auth_ip')) { |
|
91
|
0
|
0
|
0
|
|
|
0
|
&$func($self, $ENV{REMOTE_ADDR}) |
|
92
|
|
|
|
|
|
|
or $self->_set_screen('login', 'Will not serve your ip address') |
|
93
|
|
|
|
|
|
|
&& return $self; # shortcut the rest |
|
94
|
|
|
|
|
|
|
} |
|
95
|
1
|
50
|
|
|
|
9
|
if (my $func = $self->can('check_auth_user')) { |
|
96
|
0
|
0
|
0
|
|
|
0
|
$self->_check_auth_user |
|
97
|
|
|
|
|
|
|
or $self->_set_screen('login', 'Need user id and password') |
|
98
|
|
|
|
|
|
|
&& return $self; # shortcut the rest |
|
99
|
|
|
|
|
|
|
} |
|
100
|
|
|
|
|
|
|
|
|
101
|
1
|
|
|
|
|
5
|
for ($self->{cgi}->param) { # hunt for the target screen |
|
102
|
2
|
50
|
|
|
|
17
|
if (/^screen_function(.*)$/) { |
|
103
|
0
|
0
|
|
|
|
0
|
if ($self->_set_screen($1)) { |
|
104
|
0
|
|
|
|
|
0
|
$self->{cgi}->delete($_); |
|
105
|
0
|
|
|
|
|
0
|
return $self; # shortcut the rest |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
} |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
# provide a default screen |
|
111
|
1
|
|
|
|
|
5
|
$self->_set_screen('main', ''); |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub import { |
|
115
|
1
|
|
|
1
|
|
8
|
my $pkg = shift; |
|
116
|
1
|
|
|
|
|
3
|
my ($callpack, $callfile, $callline) = caller; |
|
117
|
1
|
|
|
|
|
2
|
my %old; |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
package CGI::Screen::import; |
|
120
|
|
|
|
|
|
|
|
|
121
|
1
|
|
|
|
|
3
|
for my $sym (keys %CGI::Screen::import) { |
|
122
|
0
|
|
|
|
|
0
|
$old{$sym}++;# if defined &$sym; |
|
123
|
|
|
|
|
|
|
} |
|
124
|
|
|
|
|
|
|
|
|
125
|
1
|
|
|
|
|
6
|
CGI->import(@_); |
|
126
|
|
|
|
|
|
|
|
|
127
|
2
|
|
|
2
|
|
11
|
no strict 'refs'; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
609
|
|
|
128
|
1
|
|
|
|
|
3309
|
for my $sym (keys %CGI::Screen::import::) { |
|
129
|
167
|
100
|
33
|
|
|
358
|
if (not exists $old{$sym} and |
|
|
167
|
|
|
|
|
728
|
|
|
130
|
|
|
|
|
|
|
not defined &{"CGI::Screen::${sym}"}) { |
|
131
|
165
|
100
|
|
|
|
340
|
next if $sym =~ /^(BEGIN|DESTROY|END)$/; |
|
132
|
164
|
|
|
|
|
2602
|
*{"${callpack}::$sym"} = sub { |
|
133
|
15
|
|
|
15
|
|
48124
|
my $self = $D; |
|
134
|
15
|
50
|
66
|
|
|
56
|
if ( |
|
135
|
|
|
|
|
|
|
ref $_[0] and |
|
136
|
1
|
|
|
|
|
15
|
eval { $_[0]->isa('CGI::Screen') } |
|
137
|
|
|
|
|
|
|
) { |
|
138
|
0
|
|
|
|
|
0
|
$self = shift; |
|
139
|
|
|
|
|
|
|
} |
|
140
|
15
|
100
|
100
|
|
|
89
|
if (@_ and $_[0] eq '-name') { |
|
141
|
13
|
|
|
|
|
49
|
$self->{passed}->{$_[1]} = 1; |
|
142
|
|
|
|
|
|
|
} |
|
143
|
|
|
|
|
|
|
#warn "CGI $sym(@_)\n"; |
|
144
|
15
|
|
|
|
|
27
|
&{"CGI::$sym"}(@_); |
|
|
15
|
|
|
|
|
364
|
|
|
145
|
|
|
|
|
|
|
} |
|
146
|
164
|
|
|
|
|
539
|
} |
|
147
|
|
|
|
|
|
|
} |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
} |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub AUTOLOAD { |
|
152
|
5
|
|
|
5
|
|
4810
|
my $func = $AUTOLOAD; $func =~ s/.*:://; |
|
|
5
|
|
|
|
|
19
|
|
|
153
|
5
|
|
|
|
|
9
|
my $self = $_[0]; |
|
154
|
|
|
|
|
|
|
|
|
155
|
5
|
50
|
|
|
|
16
|
if (my $code = $self->{cgi}->can($func)) { |
|
156
|
2
|
|
|
2
|
|
11
|
no strict 'refs'; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
2077
|
|
|
157
|
|
|
|
|
|
|
*$func = sub { |
|
158
|
18
|
|
|
18
|
|
7087
|
my $self = shift; |
|
159
|
|
|
|
|
|
|
|
|
160
|
18
|
100
|
100
|
|
|
94
|
if (@_>1 and $_[0] eq '-name') { |
|
161
|
2
|
|
|
|
|
21
|
$self->{passed}->{$_[1]} = 1; |
|
162
|
|
|
|
|
|
|
} |
|
163
|
|
|
|
|
|
|
#warn "AL $func(@_)\n"; |
|
164
|
18
|
|
|
|
|
177
|
&$code($self->{cgi}, @_); |
|
165
|
5
|
|
|
|
|
65
|
}; |
|
166
|
5
|
|
|
|
|
13
|
goto &$func; |
|
167
|
|
|
|
|
|
|
} else { # Function not yet AUTOLOADED in CGI.pm |
|
168
|
0
|
|
|
|
|
|
my $self = shift; |
|
169
|
|
|
|
|
|
|
|
|
170
|
0
|
0
|
0
|
|
|
|
if (@_>1 and $_[0] eq '-name') { |
|
171
|
0
|
|
|
|
|
|
$self->{passed}->{$_[1]} = 1; |
|
172
|
|
|
|
|
|
|
} |
|
173
|
0
|
|
|
|
|
|
$self->{cgi}->$func(@_); # Force autoloading in CGI.pm |
|
174
|
|
|
|
|
|
|
} |
|
175
|
|
|
|
|
|
|
} |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
sub _call { |
|
178
|
0
|
|
|
0
|
|
|
my ($query, $method) = @_; |
|
179
|
|
|
|
|
|
|
|
|
180
|
0
|
0
|
|
|
|
|
my $func = ref($method) eq 'CODE' ? $method : $query->can($method) |
|
|
|
0
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
or die "No method '$method' defined"; |
|
182
|
|
|
|
|
|
|
|
|
183
|
0
|
|
|
|
|
|
@_ = ($query, $query->{screen_name}, $query->{screen_title}); |
|
184
|
|
|
|
|
|
|
|
|
185
|
0
|
|
|
|
|
|
goto &$func; |
|
186
|
|
|
|
|
|
|
} |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub dispatch { |
|
189
|
0
|
|
|
0
|
0
|
|
my $query = shift; |
|
190
|
0
|
|
|
|
|
|
my $func; |
|
191
|
|
|
|
|
|
|
|
|
192
|
0
|
0
|
|
|
|
|
$query->_call('prologue') unless $query->{no_headers}; |
|
193
|
0
|
|
|
|
|
|
$query->_call($query->{screen_func}); |
|
194
|
0
|
0
|
|
|
|
|
$query->_call('epilogue') unless $query->{no_headers}; |
|
195
|
|
|
|
|
|
|
} |
|
196
|
|
|
|
|
|
|
|
|
197
|
0
|
|
|
0
|
1
|
|
sub application { 'CGI::Screen Test' } |
|
198
|
0
|
|
|
0
|
0
|
|
sub default_title { 'Welcome' } |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
sub title { |
|
201
|
0
|
|
|
0
|
1
|
|
my ($query, $screen, $title) = @_; |
|
202
|
|
|
|
|
|
|
|
|
203
|
0
|
|
0
|
|
|
|
$query->application . ': ' . ($title || $screen || $query->default_title); |
|
204
|
|
|
|
|
|
|
} |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
sub headline { |
|
207
|
0
|
|
|
0
|
1
|
|
my $query = shift; |
|
208
|
|
|
|
|
|
|
|
|
209
|
0
|
|
|
|
|
|
$query->h1($query->title(@_)); |
|
210
|
|
|
|
|
|
|
} |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
sub prologue { |
|
213
|
0
|
|
|
0
|
0
|
|
my $query = shift; |
|
214
|
0
|
|
|
|
|
|
my $screen = $query->{'screen_name'}; |
|
215
|
0
|
|
0
|
|
|
|
my $title = $query->{'screen_title'} || $query->default_title; |
|
216
|
0
|
|
|
|
|
|
print |
|
217
|
|
|
|
|
|
|
$query->header ('-type' => 'text/html', -expires => '+10s'), |
|
218
|
|
|
|
|
|
|
$query->start_html('-title' => $query->title($screen, $title)), |
|
219
|
|
|
|
|
|
|
$query->_call('headline'), |
|
220
|
|
|
|
|
|
|
$query->start_form |
|
221
|
|
|
|
|
|
|
; |
|
222
|
|
|
|
|
|
|
} |
|
223
|
|
|
|
|
|
|
|
|
224
|
0
|
|
|
0
|
0
|
|
sub trailer {''} |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
sub epilogue { |
|
227
|
0
|
|
|
0
|
0
|
|
my $query = shift; |
|
228
|
|
|
|
|
|
|
|
|
229
|
0
|
|
|
|
|
|
print |
|
230
|
|
|
|
|
|
|
$query->_call('trailer'), |
|
231
|
|
|
|
|
|
|
$query->close_form, |
|
232
|
|
|
|
|
|
|
$query->end_html; |
|
233
|
|
|
|
|
|
|
} |
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
sub start_form { |
|
237
|
0
|
|
|
0
|
0
|
|
my $query = shift; |
|
238
|
0
|
|
|
|
|
|
my $screen = $query->param('screen'); |
|
239
|
|
|
|
|
|
|
|
|
240
|
0
|
|
|
|
|
|
$query->{passed} = {}; |
|
241
|
0
|
|
|
|
|
|
$query->startform(-method=>'POST', -action=>$query->url); |
|
242
|
|
|
|
|
|
|
} |
|
243
|
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
sub new_form { |
|
245
|
0
|
|
|
0
|
0
|
|
my $query = shift; |
|
246
|
0
|
|
|
|
|
|
my $screen = $query->param('screen'); |
|
247
|
|
|
|
|
|
|
|
|
248
|
0
|
|
|
|
|
|
$query->close_form . |
|
249
|
|
|
|
|
|
|
$query->start_form; |
|
250
|
|
|
|
|
|
|
} |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
sub close_form { |
|
253
|
0
|
|
|
0
|
0
|
|
my $query = shift; |
|
254
|
0
|
|
|
|
|
|
my $html; |
|
255
|
|
|
|
|
|
|
|
|
256
|
0
|
|
|
|
|
|
for my $param ($query->param) { |
|
257
|
0
|
0
|
|
|
|
|
next if exists $query->{passed}->{$param}; |
|
258
|
0
|
0
|
|
|
|
|
$html .= $query->hidden(-name=>$param) if defined $query->param($param); |
|
259
|
|
|
|
|
|
|
} |
|
260
|
0
|
|
|
|
|
|
$html .= $query->endform; |
|
261
|
|
|
|
|
|
|
} |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
sub goto_screen { |
|
264
|
0
|
|
|
0
|
0
|
|
my ($query, $screen, $name) = @_; |
|
265
|
|
|
|
|
|
|
|
|
266
|
0
|
|
|
|
|
|
$query->submit |
|
267
|
|
|
|
|
|
|
( |
|
268
|
|
|
|
|
|
|
-name => 'screen_function' . $screen, |
|
269
|
|
|
|
|
|
|
-value => $name, |
|
270
|
|
|
|
|
|
|
); |
|
271
|
|
|
|
|
|
|
} |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
sub url_to_screen { |
|
274
|
0
|
|
|
0
|
0
|
|
my ($query, $screen, $title, %parm) = @_; |
|
275
|
0
|
|
|
|
|
|
my $url = $query->url . '?'; |
|
276
|
0
|
|
|
|
|
|
my $escape = $query->{cgi}->can('escape'); # should have our own |
|
277
|
|
|
|
|
|
|
# since CGI does not |
|
278
|
|
|
|
|
|
|
# announce this function |
|
279
|
|
|
|
|
|
|
# ;-( |
|
280
|
|
|
|
|
|
|
|
|
281
|
0
|
|
0
|
|
|
|
$url .= $escape->('screen_function' . $screen) . '=' . $escape->($title||''); |
|
282
|
0
|
|
|
|
|
|
for my $param ($query->param) { |
|
283
|
0
|
0
|
|
|
|
|
next if exists $parm{$param}; |
|
284
|
0
|
|
|
|
|
|
for my $value ($query->param($param)) { |
|
285
|
0
|
|
|
|
|
|
$url .= '&' . $escape->($param) . '=' . |
|
286
|
|
|
|
|
|
|
$escape->($value); |
|
287
|
|
|
|
|
|
|
} |
|
288
|
|
|
|
|
|
|
} |
|
289
|
|
|
|
|
|
|
|
|
290
|
0
|
|
|
|
|
|
for my $param (keys %parm) { |
|
291
|
0
|
|
|
|
|
|
$url .= '&' . $escape->($param) . '=' . $escape->($parm{$param}); |
|
292
|
|
|
|
|
|
|
} |
|
293
|
|
|
|
|
|
|
|
|
294
|
0
|
|
|
|
|
|
$url; |
|
295
|
|
|
|
|
|
|
} |
|
296
|
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
sub link_to_screen { |
|
298
|
0
|
|
|
0
|
0
|
|
my ($query, $screen, $title, %parm) = @_; |
|
299
|
|
|
|
|
|
|
|
|
300
|
0
|
|
|
|
|
|
$query->a({href => $query->url_to_screen($screen, $title, %parm)}, $title); |
|
301
|
|
|
|
|
|
|
} |
|
302
|
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
sub login_screen { |
|
304
|
0
|
|
|
0
|
0
|
|
my $query = shift; |
|
305
|
|
|
|
|
|
|
|
|
306
|
0
|
|
|
|
|
|
print |
|
307
|
|
|
|
|
|
|
$query->table |
|
308
|
|
|
|
|
|
|
( |
|
309
|
|
|
|
|
|
|
$query->TR($query->td('Login'), |
|
310
|
|
|
|
|
|
|
$query->td($query->textfield('-name' => 'screen_user')), |
|
311
|
|
|
|
|
|
|
), |
|
312
|
|
|
|
|
|
|
$query->TR($query->td('Passwd'), |
|
313
|
|
|
|
|
|
|
$query->td($query->password_field('-name'=>'screen_passwd')), |
|
314
|
|
|
|
|
|
|
) |
|
315
|
|
|
|
|
|
|
); |
|
316
|
0
|
|
|
|
|
|
print |
|
317
|
|
|
|
|
|
|
$query->submit |
|
318
|
|
|
|
|
|
|
( |
|
319
|
|
|
|
|
|
|
-name =>'screen', |
|
320
|
|
|
|
|
|
|
-value=>'login', |
|
321
|
|
|
|
|
|
|
); |
|
322
|
|
|
|
|
|
|
} |
|
323
|
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
sub main_screen { |
|
325
|
0
|
|
|
0
|
0
|
|
my $query = shift; |
|
326
|
|
|
|
|
|
|
|
|
327
|
0
|
|
|
|
|
|
print |
|
328
|
|
|
|
|
|
|
$query->p("Users of this module should overwrite this method"); |
|
329
|
|
|
|
|
|
|
} |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
package CGI::Screen::Debug; |
|
332
|
2
|
|
|
2
|
|
11
|
use vars qw(@ISA); |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
430
|
|
|
333
|
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
@ISA = qw(CGI::Screen); |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
sub prologue { |
|
337
|
0
|
|
|
0
|
|
|
my $query = shift; |
|
338
|
0
|
|
|
|
|
|
my @tab = $query->TR($query->td({colspan => 2}, 'CGI Parameters')); |
|
339
|
|
|
|
|
|
|
|
|
340
|
0
|
|
|
|
|
|
$query->SUPER::prologue; |
|
341
|
|
|
|
|
|
|
|
|
342
|
0
|
|
|
|
|
|
for ($query->param) { |
|
343
|
0
|
0
|
|
|
|
|
next if /^screen_/; # you don't want to know! |
|
344
|
0
|
|
|
|
|
|
push @tab, $query->TR($query->td($_), |
|
345
|
|
|
|
|
|
|
$query->td(join ', ', $query->param($_))); |
|
346
|
|
|
|
|
|
|
} |
|
347
|
0
|
|
|
|
|
|
print $query->table({border => 1}, @tab); |
|
348
|
|
|
|
|
|
|
} |
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
1; |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
__END__ |