Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c87608ab

Von Moritz Bunkus vor etwa 16 Jahren hinzugefügt

  • ID c87608abb2f5d98353e6838f33146b00a1399c3c
  • Vorgänger 2b5da843
  • Nachfolger f4b04c63

Bugfix beim Anlegen der Authentifizierungsdatenbank mit UTF-8. Anzeigen von Fehlermeldungen, wenn Lx-Office nicht mit UTF-8 sondern z.B. ISO-8859 konfiguriert ist und Datenbanken auf einem PostgreSQL angelegt werden sollen, das selber UTF-8 verwendet (weil das nicht geht). Forcieren von UTF-8 als Datenbankcharset auf PostgreSQL-Installationen, die mit UTF-8 als Charset angelegt wurden.

Unterschiede anzeigen:

SL/Auth.pm
222 222
    $main::form->error($main::locale->text('The connection to the template database failed:') . "\n" . $DBI::errstr);
223 223
  }
224 224

  
225
  my $charset    = $main::charset;
225
  my $charset    = $main::dbcharset;
226 226
  $charset     ||= Common::DEFAULT_CHARSET;
227 227
  my $encoding   = $Common::charset_to_db_encoding{$charset};
228 228
  $encoding    ||= 'UNICODE';
......
234 234
  $dbh->do($query);
235 235

  
236 236
  if ($dbh->err) {
237
    my $error = $dbh->errstr();
238

  
239
    $query                 = qq|SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = 'template0'|;
240
    my ($cluster_encoding) = $dbh->selectrow_array($query);
241

  
242
    if ($cluster_encoding && ($cluster_encoding =~ m/^(?:UTF-?8|UNICODE)$/i) && ($encoding !~ m/^(?:UTF-?8|UNICODE)$/i)) {
243
      $error = $main::locale->text('Your PostgreSQL installationen uses UTF-8 as its encoding. Therefore you have to configure Lx-Office to use UTF-8 as well.');
244
    }
245

  
237 246
    $dbh->disconnect();
238 247

  
239
    $main::form->error($main::locale->text('The creation of the authentication database failed:') . "\n" . $DBI::errstr);
248
    $main::form->error($main::locale->text('The creation of the authentication database failed:') . "\n" . $error);
240 249
  }
241 250

  
242 251
  $dbh->disconnect();
......
250 259
  my $self = shift;
251 260
  my $dbh  = $self->dbconnect();
252 261

  
253
  my $charset    = $main::charset;
262
  my $charset    = $main::dbcharset;
254 263
  $charset     ||= Common::DEFAULT_CHARSET;
255 264

  
256 265
  $dbh->rollback();

Auch abrufbar als: Unified diff