line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- Mode: Perl -*- |
2
|
|
|
|
|
|
|
# Config.pm -- |
3
|
|
|
|
|
|
|
# ITIID : $ITI$ $Header $__Header$ |
4
|
|
|
|
|
|
|
# Author : Ulrich Pfeifer |
5
|
|
|
|
|
|
|
# Created On : Sat Sep 28 13:53:36 1996 |
6
|
|
|
|
|
|
|
# Last Modified By: Ulrich Pfeifer |
7
|
|
|
|
|
|
|
# Last Modified On: Mon Sep 30 08:55:23 1996 |
8
|
|
|
|
|
|
|
# Language : CPerl |
9
|
|
|
|
|
|
|
# Update Count : 11 |
10
|
|
|
|
|
|
|
# Status : Unknown, Use with caution! |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# (C) Copyright 1996, Universität Dortmund, all rights reserved. |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package NNML::Config; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
63
|
|
18
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION @ISA @EXPORT_OK $Config); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
1090
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
require Exporter; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
@EXPORT_OK = qw( |
25
|
|
|
|
|
|
|
$Config |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$VERSION = '0.01'; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$Config = bless { |
32
|
|
|
|
|
|
|
'active' => q[~/active], |
33
|
|
|
|
|
|
|
'base' => q[~/Mail], |
34
|
|
|
|
|
|
|
'local_passwd' => q[], |
35
|
|
|
|
|
|
|
'local_user' => q[~], |
36
|
|
|
|
|
|
|
'mirror_host' => q[], |
37
|
|
|
|
|
|
|
'mirror_port' => q[119], |
38
|
|
|
|
|
|
|
'passwd' => q[~/passwd], |
39
|
|
|
|
|
|
|
'port' => q[119], |
40
|
|
|
|
|
|
|
'remote_passwd' => q[], |
41
|
|
|
|
|
|
|
'remote_user' => q[~], |
42
|
|
|
|
|
|
|
}, 'NNML::Config'; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub local_user { |
45
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
46
|
0
|
|
|
|
|
|
my $user; |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if (defined $user) { |
49
|
0
|
|
|
|
|
|
$self->{local_user} = $user; |
50
|
0
|
|
|
|
|
|
delete $self->{_local_user}; |
51
|
|
|
|
|
|
|
} |
52
|
0
|
0
|
|
|
|
|
return $self->{_local_user} if exists $self->{_local_user}; |
53
|
0
|
0
|
|
|
|
|
if ($self->{local_user} eq '~') { |
54
|
0
|
|
0
|
|
|
|
my $user = $ENV{'USER'} || $ENV{'LOGNAME'} || getpwuid($<); |
55
|
0
|
|
|
|
|
|
$self->{_local_user} = $user; |
56
|
|
|
|
|
|
|
} else { |
57
|
0
|
|
|
|
|
|
$self->{_local_user} = $self->{local_user}; |
58
|
|
|
|
|
|
|
} |
59
|
0
|
|
|
|
|
|
$self->{_local_user}; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub remote_user { |
63
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
64
|
0
|
|
|
|
|
|
my $user; |
65
|
|
|
|
|
|
|
|
66
|
0
|
0
|
|
|
|
|
if (defined $user) { |
67
|
0
|
|
|
|
|
|
$self->{remote_user} = $user; |
68
|
0
|
|
|
|
|
|
delete $self->{_remote_user}; |
69
|
|
|
|
|
|
|
} |
70
|
0
|
0
|
|
|
|
|
return $self->{_remote_user} if exists $self->{_remote_user}; |
71
|
0
|
0
|
|
|
|
|
if ($self->{remote_user} eq '~') { |
72
|
0
|
|
0
|
|
|
|
my $user = $ENV{'USER'} || $ENV{'LOGNAME'} || getpwuid($<); |
73
|
0
|
|
|
|
|
|
$self->{_remote_user} = $user; |
74
|
|
|
|
|
|
|
} else { |
75
|
0
|
|
|
|
|
|
$self->{_remote_user} = $self->{remote_user}; |
76
|
|
|
|
|
|
|
} |
77
|
0
|
|
|
|
|
|
$self->{_remote_user}; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub home { |
81
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
82
|
|
|
|
|
|
|
|
83
|
0
|
0
|
|
|
|
|
return $self->{_home} if exists $self->{_home}; |
84
|
0
|
|
0
|
|
|
|
my $user = $ENV{'USER'} || $ENV{'LOGNAME'} || getpwuid($<); |
85
|
0
|
|
|
|
|
|
my $home = (getpwnam($user))[7]; |
86
|
0
|
|
|
|
|
|
$self->{_home} = $home; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub base { |
90
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
91
|
0
|
|
|
|
|
|
my $base = shift; |
92
|
|
|
|
|
|
|
|
93
|
0
|
0
|
|
|
|
|
if (defined $base) { |
94
|
0
|
|
|
|
|
|
$self->{base} = $base; |
95
|
0
|
|
|
|
|
|
delete $self->{_base}; |
96
|
0
|
|
|
|
|
|
delete $self->{_active}; |
97
|
0
|
|
|
|
|
|
delete $self->{_passwd}; |
98
|
|
|
|
|
|
|
} |
99
|
0
|
0
|
|
|
|
|
return $self->{_base} if exists $self->{_base}; |
100
|
0
|
|
|
|
|
|
$self->{_base} = $self->{base}; |
101
|
0
|
|
|
|
|
|
$self->{_base} =~ s/^~/$self->home/e; |
|
0
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
$self->{_base}; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub spool { |
106
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
107
|
0
|
|
|
|
|
|
$self->base . '/NNML.spool'; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub bad { |
111
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
112
|
0
|
|
|
|
|
|
$self->base . '/NNML.bad'; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub active { |
116
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
117
|
0
|
|
|
|
|
|
my $active = shift; |
118
|
0
|
0
|
|
|
|
|
if (defined $active) { |
119
|
0
|
|
|
|
|
|
$self->{active} = $active; |
120
|
0
|
|
|
|
|
|
delete $self->{_active}; |
121
|
|
|
|
|
|
|
} |
122
|
0
|
0
|
|
|
|
|
return $self->{_active} if exists $self->{_active}; |
123
|
0
|
|
|
|
|
|
$self->{_active} = $self->{active}; |
124
|
0
|
|
|
|
|
|
$self->{_active} =~ s/^~/$self->base/e; |
|
0
|
|
|
|
|
|
|
125
|
0
|
|
|
|
|
|
$self->{_active}; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
sub passwd { |
129
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
130
|
0
|
|
|
|
|
|
my $passwd = shift; |
131
|
0
|
0
|
|
|
|
|
if (defined $passwd) { |
132
|
0
|
|
|
|
|
|
$self->{passwd} = $passwd; |
133
|
0
|
|
|
|
|
|
delete $self->{_passwd}; |
134
|
|
|
|
|
|
|
} |
135
|
0
|
0
|
|
|
|
|
return $self->{_passwd} if exists $self->{_passwd}; |
136
|
0
|
|
|
|
|
|
$self->{_passwd} = $self->{passwd}; |
137
|
0
|
|
|
|
|
|
$self->{_passwd} =~ s/^~/$self->base/e; |
|
0
|
|
|
|
|
|
|
138
|
0
|
|
|
|
|
|
$self->{_passwd}; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub AUTOLOAD { |
142
|
0
|
|
|
0
|
|
|
my $func = $NNML::Config::AUTOLOAD; $func =~ s/.*:://; |
|
0
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
|
my $self = shift; |
144
|
0
|
|
|
|
|
|
my $val = shift; |
145
|
0
|
0
|
|
|
|
|
if (defined $val) { |
146
|
0
|
|
|
|
|
|
$self->{$func} = $val; |
147
|
0
|
|
|
|
|
|
return $val; |
148
|
|
|
|
|
|
|
} else { |
149
|
0
|
0
|
|
|
|
|
if (exists $self->{$func}) { |
150
|
0
|
|
|
|
|
|
return $self->{$func}; |
151
|
|
|
|
|
|
|
} else { |
152
|
0
|
|
|
|
|
|
return undef; |
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
1; |
158
|
|
|
|
|
|
|
|