line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- perl -*- |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# $Id: HW.pm,v 1.3 2003/01/16 14:29:11 eserte Exp $ |
5
|
|
|
|
|
|
|
# Author: Slaven Rezic |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# Copyright (C) 2001 Online Office Berlin. All rights reserved. |
8
|
|
|
|
|
|
|
# Copyright (C) 2002 Slaven Rezic. |
9
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under the |
10
|
|
|
|
|
|
|
# terms of the GNU General Public License, see the file COPYING. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# Mail: slaven@rezic.de |
14
|
|
|
|
|
|
|
# WWW: http://we-framework.sourceforge.net |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
package WE_Sample::HW; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$^W = 0; # XXX too much problems with HyperWave::CSP |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
7047
|
use base qw(WE::DB); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
608
|
|
22
|
1
|
|
|
1
|
|
815
|
use WE::Obj; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
WE::DB->use_databases(qw/HWObj HWContent/); |
25
|
|
|
|
|
|
|
WE::Obj->use_classes(':all'); |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
1
|
|
205
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
28
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
306
|
|
29
|
|
|
|
|
|
|
$VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub new { |
32
|
0
|
|
|
0
|
|
|
my($class, $hwhost, $hwport, %args) = @_; |
33
|
0
|
|
|
|
|
|
my $self = {}; |
34
|
0
|
|
|
|
|
|
bless $self, $class; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$self->ObjDB(WE::DB::HWObj->new($self, |
37
|
|
|
|
|
|
|
-hwhost => $hwhost, |
38
|
|
|
|
|
|
|
-hwport => $hwport, |
39
|
|
|
|
|
|
|
%args, |
40
|
|
|
|
|
|
|
)); |
41
|
0
|
|
|
|
|
|
$self->ContentDB(WE::DB::HWContent->new($self)); |
42
|
0
|
|
|
|
|
|
$self; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub identify { |
46
|
0
|
|
|
0
|
|
|
my($self, $user, $pw) = @_; |
47
|
0
|
|
|
|
|
|
my $objdb = $self->ObjDB; |
48
|
0
|
|
|
|
|
|
my $server = HyperWave::CSP->new($objdb->HWHost, $objdb->HWPort, |
49
|
|
|
|
|
|
|
$user, $pw); |
50
|
0
|
0
|
|
|
|
|
if ($server) { |
51
|
0
|
|
|
|
|
|
$objdb->HW($server); |
52
|
0
|
|
|
|
|
|
$self->CurrentUser($user); |
53
|
0
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
} else { |
55
|
0
|
|
|
|
|
|
0; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |