X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FUSTVA.pm;h=354e13e186d0e503aa8053ffebb2f128e2c71958;hb=0c472ce6b2b803cd57b8361d778fb711dc3549ba;hp=e2aa9c467259db75a6d17c36a3499661f92802ee;hpb=18942bd70d66bd2348c6550887bc2994dfcaf358;p=kivitendo-erp.git diff --git a/SL/USTVA.pm b/SL/USTVA.pm index e2aa9c467..354e13e18 100644 --- a/SL/USTVA.pm +++ b/SL/USTVA.pm @@ -941,6 +941,40 @@ sub get_accounts_ustva { } +sub get_config { + $main::lxdebug->enter_sub(); + + my ($self, $userpath, $filename) = @_; + + my $form = $main::form; + + if (!open(FACONF, "$userpath/$form->{login}_$filename")) { + open(FANEW, ">$userpath/$form->{login}_$filename") || + $form->error("$userpath/$filename : $!"); + close(FANEW); + open(FACONF, "$userpath/$form->{login}_$filename") || + $form->error("$userpath/$form->{username}_$filename : $!"); + } + + while () { + last if (/^\[/); + next if (/^(\#|\s)/); + + # remove comments + s/\s#.*//g; + + # remove any trailing whitespace + s/^\s*(.*?)\s*$/$1/; + my ($key, $value) = split(/=/, $_, 2); + + $form->{$key} = "$value"; + + } + + close(FACONF); + + $main::lxdebug->leave_sub(); +} 1;