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