line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Session::MembersArea; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Name: |
4
|
|
|
|
|
|
|
# CGI::Session::MembersArea. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Documentation: |
7
|
|
|
|
|
|
|
# POD-style documentation is at the end. Extract it with pod2html.*. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Reference: |
10
|
|
|
|
|
|
|
# Object Oriented Perl |
11
|
|
|
|
|
|
|
# Damian Conway |
12
|
|
|
|
|
|
|
# Manning |
13
|
|
|
|
|
|
|
# 1-884777-79-1 |
14
|
|
|
|
|
|
|
# P 114 |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
# Note: |
17
|
|
|
|
|
|
|
# o Tab = 4 spaces || die. |
18
|
|
|
|
|
|
|
# |
19
|
|
|
|
|
|
|
# Author: |
20
|
|
|
|
|
|
|
# Ron Savage |
21
|
|
|
|
|
|
|
# Home page: http://savage.net.au/index.html |
22
|
|
|
|
|
|
|
# |
23
|
|
|
|
|
|
|
# Licence: |
24
|
|
|
|
|
|
|
# Australian copyright (c) 2004 Ron Savage. |
25
|
|
|
|
|
|
|
# |
26
|
|
|
|
|
|
|
# All Programs of mine are 'OSI Certified Open Source Software'; |
27
|
|
|
|
|
|
|
# you can redistribute them and/or modify them under the terms of |
28
|
|
|
|
|
|
|
# The Artistic License, a copy of which is available at: |
29
|
|
|
|
|
|
|
# http://www.opensource.org/licenses/index.html |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
|
35785
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
32
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
33
|
1
|
|
|
1
|
|
4
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
83
|
|
36
|
1
|
|
|
1
|
|
2583
|
use DBI; |
|
1
|
|
|
|
|
22611
|
|
|
1
|
|
|
|
|
1090
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
require 5.005_62; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
require Exporter; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
45
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
46
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# This allows declaration use CGI::Session::MembersArea ':all'; |
49
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
50
|
|
|
|
|
|
|
# will save memory. |
51
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
) ] ); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
our @EXPORT = qw( |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
our $VERSION = '2.06'; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# ----------------------------------------------- |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Preloaded methods go here. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# ----------------------------------------------- |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# Encapsulated class data. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
{ |
71
|
|
|
|
|
|
|
my(%_attr_data) = |
72
|
|
|
|
|
|
|
( # Alphabetical order. |
73
|
|
|
|
|
|
|
_dsn => 'dbi:mysql:myadmin', |
74
|
|
|
|
|
|
|
_form_field_width => 50, |
75
|
|
|
|
|
|
|
_form_resource => 'my_resource', |
76
|
|
|
|
|
|
|
_form_password => 'my_password', |
77
|
|
|
|
|
|
|
_form_username => 'my_username', |
78
|
|
|
|
|
|
|
_password => '', |
79
|
|
|
|
|
|
|
_query => '', |
80
|
|
|
|
|
|
|
_resource_name_column => 'user_resource_name', |
81
|
|
|
|
|
|
|
_resource_password_column => 'user_resource_password', |
82
|
|
|
|
|
|
|
_resource_username_column => 'user_resource_username', |
83
|
|
|
|
|
|
|
_session_full_name_column => 'user_full_name', |
84
|
|
|
|
|
|
|
_session_key_name_column => 'user_full_name_key', |
85
|
|
|
|
|
|
|
_session_password_column => 'user_password', |
86
|
|
|
|
|
|
|
_session_table => 'user', |
87
|
|
|
|
|
|
|
_username => '', |
88
|
|
|
|
|
|
|
); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub _default_for |
91
|
|
|
|
|
|
|
{ |
92
|
0
|
|
|
0
|
|
|
my($self, $attr_name) = @_; |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
$_attr_data{$attr_name}; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub _standard_keys |
98
|
|
|
|
|
|
|
{ |
99
|
0
|
|
|
0
|
|
|
keys %_attr_data; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
} # End of encapsulated class data. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
# ----------------------------------------------- |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub clean_user_data |
107
|
|
|
|
|
|
|
{ |
108
|
0
|
|
|
0
|
0
|
|
my($self, $data, $max_length, $integer) = @_; |
109
|
0
|
0
|
0
|
|
|
|
$data = '' if (! defined($data) || ($data !~ /^([^`\x00-\x1F\x7F-\x9F]+)$/) || (length($1) == 0) || (length($1) > $max_length) ); |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
110
|
0
|
0
|
|
|
|
|
$data = '' if ($data =~ / |