[Rt-commit] r12481 - rt/branches/3.8-TESTING/share/html/installation
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Sat May 17 08:46:31 EDT 2008
Author: sunnavy
Date: Sat May 17 08:46:31 2008
New Revision: 12481
Modified:
rt/branches/3.8-TESTING/share/html/installation/DatabaseDetails.html
Log:
refactor a bit
Modified: rt/branches/3.8-TESTING/share/html/installation/DatabaseDetails.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/installation/DatabaseDetails.html (original)
+++ rt/branches/3.8-TESTING/share/html/installation/DatabaseDetails.html Sat May 17 08:46:31 2008
@@ -93,7 +93,6 @@
RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .
'installation/Basics.html');
}
-
my ( $status, $msg ) = RT::Installer->SaveConfig;
if ( $status ) {
RT->LoadConfig;
@@ -103,19 +102,28 @@
);
if ( $dbh ) {
- push @results, 'Connection succeeded',
+ push @results, 'Connection succeeded';
# dba connect dsn, which has table info
$dbh = DBI->connect(
RT::Handle->DSN, $ARGS{DatabaseAdmin}, $ARGS{DatabaseAdminPassword}, { RaiseError => 0, PrintError => 0 },
);
if ( $dbh ) {
- # check if Tickets table exists
- my $sth = $dbh->table_info('', '', 'Tickets', 'TABLE');
- # get 'Tickets' if it exists
- if ( ($sth->fetchrow_array)[2] ) {
+ # check if table Users exists
+ eval {
+ my $dbh = DBI->connect(
+ RT::Handle->DSN,
+ $ARGS{DatabaseAdmin},
+ $ARGS{DatabaseAdminPassword},
+ { RaiseError => 1, PrintError => 0 },
+ );
+
+ my $sth = $dbh->prepare('select * from Users');
+ };
+
+ unless ( $@ ) {
- $sth = $dbh->prepare('select id from Users where Name=?');
+ my $sth = $dbh->prepare('select id from Users where Name=?');
$sth->execute('RT_System');
if ( $sth->fetchrow_array ) {
$RT::Installer->{DatabaseAction} = 'none';
More information about the Rt-commit
mailing list