1 |
joko |
1.3 |
## ------------------------------------------------------------------------ |
2 |
|
|
## $Id: Files.pm,v 1.2 2003/01/19 02:14:11 joko Exp $ |
3 |
|
|
## ------------------------------------------------------------------------ |
4 |
|
|
## $Log: Files.pm,v $ |
5 |
|
|
## ------------------------------------------------------------------------ |
6 |
|
|
|
7 |
|
|
|
8 |
joko |
1.1 |
package Torus::API; |
9 |
|
|
|
10 |
|
|
use strict; |
11 |
|
|
use warnings; |
12 |
|
|
|
13 |
|
|
# load configuration-data from ini-file |
14 |
|
|
BEGIN { |
15 |
|
|
use loadConfig; |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
use Torus::Core; |
19 |
|
|
use Data::Dumper; |
20 |
|
|
|
21 |
|
|
|
22 |
|
|
sub sendContact { |
23 |
|
|
my $modulename = shift; |
24 |
|
|
my $sourceFolderName = shift; |
25 |
|
|
my $data = shift; |
26 |
|
|
|
27 |
|
|
# print Dumper($data); |
28 |
|
|
|
29 |
|
|
my $data_transfer; |
30 |
|
|
|
31 |
|
|
foreach my $key (sort keys %{$data}) { |
32 |
|
|
my $value = $data->{$key}; |
33 |
|
|
#print $key, ": ", $value, "\n"; |
34 |
|
|
next if (!$value); |
35 |
|
|
|
36 |
|
|
$data_transfer->{$key} = $value; |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
|
40 |
|
|
# V2: 2003-01-06 - dynamic target container configuration |
41 |
|
|
my $folderMapping = $config->get("folders_map"); |
42 |
|
|
my $container; |
43 |
|
|
# 1. use default |
44 |
|
|
$container = $folderMapping->{_default}; |
45 |
|
|
# 2. try to determine target-container by mapping currently "use"d folder against ini-configuration |
46 |
|
|
$container = $folderMapping->{$sourceFolderName} if $folderMapping->{$sourceFolderName}; |
47 |
joko |
1.2 |
# my $basedn = "ou=$container, dc=labnet, dc=de"; |
48 |
|
|
my $basedn = "ou=$container, o=netfrag.org, c=de"; |
49 |
|
|
|
50 |
joko |
1.1 |
|
51 |
|
|
return Torus::Core::addItem('MapiContact', $data_transfer, $basedn); |
52 |
|
|
|
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
1; |