X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/61cd09fa923cc9d834cd8d7e2307e5b8bb994939..0246e1250d5b6740e6ac04458714a57393bff4f8:/SL/USTVA.pm 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;