Leser: 1
|< 1 2 >| | 11 Einträge, 2 Seiten |
1
2
3
4
catalyst MyPBoard
cd MyPBoard
script\MyPBoard_create.pl view HTC HTML::Template::Compiled
script\mypboard_create.pl controller User
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
sub list : Path('/user/list') {
my ($self, $c) = @_;
my %data = ( template => 'user/list.tmpl',
title => 'Benutzerliste',
navigationfile => 'sub_naviagtion_user.tmpl',
username => 'XXXXXX',
show_images => 1,
);
while (my ($k, $v) = each %data) { $c->stash->{$k} = $v }
die;
} # list
# ------------------------------------------------------------
sub end : Private {
my ($self, $c) = @_;
$c->forward("MyPBoard::View::HTC");
} # end
script\mypboard_create.pl model PBDB DBIC dbi:mysql:dbname=pboard username password
script\mypboard_server.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
sub list : Path('/user/list') {
my ($self, $c) = @_;
my $data = $c->model('PBDB')->table('PbUser')
->search( {'order_by' => 'id ASC'} );
my %data = ( template => 'user/list.tmpl',
title => 'Benutzerliste',
navigationfile => 'sub_naviagtion_user.tmpl',
username => 'XXXXXX',
show_images => 1,
userlist => $data,
);
while (my ($k, $v) = each %data) { $c->stash->{$k} = $v }
} # list
Caught exception in MyPBoard::Controller::User->list "Can't call method "search" on an undefined value at E:/web/PBoard_Catalyst/MyPBoard/script/../lib/MyPBoard/Controller/User.pm line 14."
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Fri May 5 23:56:14 2006] [catalyst] [info] MyPBoard powered by Catalyst 5.68
ou can connect to your server at http://dahoam:3000
Fri May 5 23:56:16 2006] [catalyst] [debug] **********************************
Fri May 5 23:56:16 2006] [catalyst] [debug] * Request 1 (0.333/s) [748]
Fri May 5 23:56:16 2006] [catalyst] [debug] **********************************
Fri May 5 23:56:16 2006] [catalyst] [debug] "GET" request for "user/list" from
"127.0.0.1"
Fri May 5 23:56:16 2006] [catalyst] [debug] Path is "user/list"
Fri May 5 23:56:16 2006] [catalyst] [debug] Rendering template "user/list"
Fri May 5 23:56:16 2006] [catalyst] [error] Caught exception in MyPBoard::Cont
oller::User->list "Can't call method "search" on an undefined value at E:/web/P
oard_Catalyst/MyPBoard/script/../lib/MyPBoard/Controller/User.pm line 14."
Fri May 5 23:56:16 2006] [catalyst] [error] Caught exception in MyPBoard::View
:HTC->process "'user/list' not found at D:/wamp/Perl815/site/lib/Catalyst/View/
TML/Template/Compiled.pm line 112"
Fri May 5 23:56:16 2006] [catalyst] [info] Request took 0.039157s (25.538/s)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package PBoard::Schema::DBIC;
use base qw/DBIx::Class::Schema/;
use DateTime::Format::Pg ();
__PACKAGE__->load_classes(
qw[
PbBoardBoards PbBoardMessages PbBoardSettings PbBoardThreads
PbRole
PbUser PbUserProfile PbUserRole PbUserSession PbUserSettings
]
);
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
38
39
40
41
42
43
44
45
46
47
48
49
50
package PBoard::Schema::DBIC::PbUser;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw[ PK::Auto Core ]);
__PACKAGE__->table('pboard.pb_user');
__PACKAGE__->add_columns(qw[ user_id username password old_user_id ]);
__PACKAGE__->set_primary_key(qw[ user_id ]);
__PACKAGE__->has_many( roles => 'PBoard::Schema::DBIC::PbUserRole', 'user_id' );
__PACKAGE__->has_one(
profile => 'PBoard::Schema::DBIC::PbUserProfile',
'user_id'
);
__PACKAGE__->has_one(
settings => 'PBoard::Schema::DBIC::PbUserSettings',
'user_id'
);
use Crypt::SaltedHash ();
use Digest::MD5 ();
sub check_password {
my ( $self, $password ) = @_;
if ( $password =~ m[^{.*}] ) { # like {SHA256}
my $salt_len =
$self->can("password_salt_len") ? $self->password_salt_len : 0;
return Crypt::SaltedHash->validate( $self->password, $password,
$salt_len );
}
else {
# old board method
my $passdword_digest =
&Digest::MD5::md5_hex( $password . lc( $self->username ) );
return $self->password eq $passdword_digest;
}
}
sub get_group {
my ( $self ) = @_;
my $roles = $self->roles;
}
1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package PBoard::Model::DBIC;
use strict;
use base 'Catalyst::Model::DBIC::Schema';
__PACKAGE__->config(
schema_class => 'PBoard::Schema::DBIC',
connect_info => [
'dbi:Pg:dbname=pboard',
'pboard',
'pboard',
{RaiseError => 1, PrintError => 0, AutoCommit => 1},
],
);
1;
1
2
my $data = $c->model('PBDB')->table('PbUser')
->schema_instance->search( {'order_by' => 'id ASC'} );
Caught exception in MyPBoard::Controller::User->list "Can't call method "schema_instance" on an undefined value at E:/web/PBoard_Catalyst/MyPBoard/script/../lib/MyPBoard/Controller/User.pm line 14."
die Dumper $c->model('PBDB')->table('PbUser');
die Dumper $c->model('PBDB')->table('pb_user');
$VAR1 = 'MyPBoard::Model::PBDB::PbUser';
1
2
3
my $data = $c->model('PBDB')->table('pb_user')
->search( { 'order_by' => 'id ASC' } );
die Dumper $data;
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
$VAR1 = bless( {
'attrs' => {
'alias' => 'me',
'as' => [
'id',
'nick',
'password',
'oldId'
],
'collapse' => {},
'from' => [
{
'me' => 'pb_user'
}
],
'order_by' => [],
'seen_join' => {},
'select' => [
'me.id',
'me.nick',
'me.password',
'me.oldId'
],
'where' => {
'order_by' => 'id ASC'
}
},
...
|< 1 2 >| | 11 Einträge, 2 Seiten |