RDBO Support.
[kivitendo-erp.git] / SL / AM.pm
index 1dbf9d8..f5736f1 100644 (file)
--- a/SL/AM.pm
+++ b/SL/AM.pm
@@ -1544,42 +1544,6 @@ sub save_preferences {
     $auth->create_or_refresh_session();
   }
 
-  if ($webdav) {
-    my @webdavdirs =
-      qw(angebote bestellungen rechnungen anfragen lieferantenbestellungen einkaufsrechnungen);
-    foreach my $directory (@webdavdirs) {
-      my $file = "webdav/" . $directory . "/webdav-user";
-      my $newfile;
-      if ($myconfig->{$directory}) {
-        open(HTACCESS, "$file") or die "cannot open webdav-user $!\n";
-        while (<HTACCESS>) {
-          my ($login, $password) = split(/:/, $_);
-          if ($login ne $form->{login}) {
-            $newfile .= $_;
-          }
-        }
-        close(HTACCESS);
-        open(HTACCESS, "> $file") or die "cannot open webdav-user $!\n";
-        $newfile .= $myconfig->{login} . ":" . $myconfig->{password} . "\n";
-        print(HTACCESS $newfile);
-        close(HTACCESS);
-      } else {
-        $form->{$directory} = 0;
-        open(HTACCESS, "$file") or die "cannot open webdav-user $!\n";
-        while (<HTACCESS>) {
-          my ($login, $password) = split(/:/, $_);
-          if ($login ne $form->{login}) {
-            $newfile .= $_;
-          }
-        }
-        close(HTACCESS);
-        open(HTACCESS, "> $file") or die "cannot open webdav-user $!\n";
-        print(HTACCESS $newfile);
-        close(HTACCESS);
-      }
-    }
-  }
-
   $main::lxdebug->leave_sub();
 
   return $rc;
@@ -1778,7 +1742,7 @@ sub retrieve_units {
 
   my ($self, $myconfig, $form, $prefix) = @_;
 
-  my $dbh = $form->dbconnect($myconfig);
+  my $dbh = $form->get_standard_dbh;
 
   my $query = "SELECT *, base_unit AS original_base_unit FROM units";
 
@@ -1818,9 +1782,7 @@ sub retrieve_units {
       map({ $unit->{"LANGUAGES"}->{$ref->{"template_code"}}->{$_} = $ref->{$_} } keys(%{$ref}));
     }
   }
-  $sth->finish();
-
-  $dbh->disconnect();
+  $sth->finish;
 
   $main::lxdebug->leave_sub();