|< 1 2 3 >| | 29 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
# esskarcgiapp.cgi
#!/Perl/bin/perl
use strict;
use FindBin qw($Bin);
use lib($Bin);
use esskarcgiapp;
my $wapp = esskarcgiapp->new();
$wapp->run();
exit(0);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# sorry für das kleingeschriebene modul, ist ja nur zum testen
package esskarcgiapp;
use base 'CGI::Application';
sub cgiapp_prerun {
my $self = shift;
# Perform some project-specific init behavior
# such as to implement run mode specific
# authorization functions.
my %loadModules = (
'login::form' => ['esskarcgiapp_login.pm', 'CGI.pm'],
);
my $found = 0;
foreach( keys(%loadModules) ) {
if( $_ eq $self->get_current_runmode() ){
foreach my $module( @{$loadModules{$_}} ) {
# überprüfen ob es das Modul gibt und ob das Laden erfolgreich war usw.
require $module;
}
$found = 1;
last;
} # /if
} # /foreach
} # /cgiapp_prerun
sub setup
{
my $self = shift;
$self->header_props(
-type => 'text/html',
-charset => 'utf-8',
);
$self->mode_param('action');
$self->start_mode('login::form');
$self->run_modes(
'login::form' => 'login_form',
);
}
sub login_form {
my $lf = new esskarcgiapp_login;
if( $lf ){
return "loginfoprm here";
}else{
return "geht nicht!?";
}
}
1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package Ox::WebMail;
use strict;
use warnings;
use base 'CGI::Application::Plus';
use Ox::WebMail::Consts;
sub cgiapp_get_query {
require CGI::Simple;
my $cgi = CGI::Simple->new();
$cgi->parse_query_string();
return $cgi;
}
sub setup {
my $self = shift;
$self->tmpl_path(&Ox::WebMail::Consts::TEMPLATE_PATH);
$self->header_props(
-type => 'text/html',
-charset => &Ox::WebMail::Consts::CONTENT_CHARSET,
);
$self->mode_param('action');
$self->start_mode('login');
$self->run_modes({
'login' => sub {
require Ox::WebMail::Login;
return Ox::WebMail::Login->new()->run()
}
});
}
1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package Ox::WebMail::Login;
use strict;
use warnings;
use base 'CGI::Application::Plus';
sub setup {
my $self = shift;
$self->tmpl_path(&Ox::WebMail::Consts::TEMPLATE_PATH_LOGIN);
$self->header_type('none');
$self->mode_param('login');
$self->start_mode('form');
$self->run_modes({
'form' => 'show_form',
});
}
sub show_form {
my $self = shift;
my $tmpl = $self->load_tmpl(
'form.tpl',
die_on_bad_params => 0,
cache => 1
);
return $tmpl->output;
}
1;
$ENV{CGI_APP_RETURN_ONLY} = 1
|< 1 2 3 >| | 29 Einträge, 3 Seiten |