[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4097] branches/1.3



Revision: 4097
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4097&view=rev
Author:   einhverfr
Date:     2011-11-26 14:08:27 +0000 (Sat, 26 Nov 2011)
Log Message:
-----------
Adding username to setup utility confirm operation screen

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/LedgerSMB/Database.pm
    branches/1.3/UI/setup/confirm_operation.html
    branches/1.3/scripts/setup.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2011-11-26 12:09:41 UTC (rev 4096)
+++ branches/1.3/Changelog	2011-11-26 14:08:27 UTC (rev 4097)
@@ -31,6 +31,7 @@
 * Corrected filtering of customers/vendors on AR/AP screens (Chris T)
 * Logging enhancements (Herman V)
 * Whitespace adjustment in Pg-database (Herman V)
+* Added logged in username to setup utility confirm operation screen (Chris T)
 
 Changelog for LedgerSMB 1.3.6
 * Including xelatex templates under directory templates/xedemo (Chris T)

Modified: branches/1.3/LedgerSMB/Database.pm
===================================================================
--- branches/1.3/LedgerSMB/Database.pm	2011-11-26 12:09:41 UTC (rev 4096)
+++ branches/1.3/LedgerSMB/Database.pm	2011-11-26 14:08:27 UTC (rev 4097)
@@ -159,6 +159,9 @@
 
 =over
 
+=item username
+Set to the user of the current connection
+
 =item appname
 Set to the current application name, one of:
 
@@ -280,10 +283,16 @@
            } else {
                 $retval->{status} = 'does not exist';
            }
+           my $sth = $dbh->prepare("SELECT SESSION_USER");
+           $sth->execute;
+           $retval->{username} = $sth->fetchrow_array();
            return $retval;
    } else { # Got a db handle... try to find the version and app by a few
             # different means
        my $sth;
+       $sth = $dbh->prepare("SELECT SESSION_USER");
+       $sth->execute;
+       $retval->{username} = $sth->fetchrow_array();
        # Legacy SL and LSMB
        $sth = $dbh->prepare('SELECT version FROM defaults');
        $sth->execute();

Modified: branches/1.3/UI/setup/confirm_operation.html
===================================================================
--- branches/1.3/UI/setup/confirm_operation.html	2011-11-26 12:09:41 UTC (rev 4096)
+++ branches/1.3/UI/setup/confirm_operation.html	2011-11-26 14:08:27 UTC (rev 4097)
@@ -6,6 +6,7 @@
 <h2><?lsmb text('Database Management Console') ?></h2>
 <div class="listtop"><?lsmb text('Confirm Operation') ?></div>
 <?lsmb # notice, message, and operation are all localized. ?>
+<div id="username"><?lsmb text('Logged in as') ?> <?lsmb login_name ?></div>
 <div id="notice"><?lsmb notice ?></div>
 <div id="message"><?lsmb message ?></div>
 <div id="operation"><?lsmb operation ?></div>

Modified: branches/1.3/scripts/setup.pl
===================================================================
--- branches/1.3/scripts/setup.pl	2011-11-26 12:09:41 UTC (rev 4096)
+++ branches/1.3/scripts/setup.pl	2011-11-26 14:08:27 UTC (rev 4097)
@@ -55,6 +55,7 @@
                 password => $creds->{password}}
     );
     my $version_info = $database->get_info();
+    $request->{login_name} = $version_info->{username};
     if ($version_info->{appname} eq 'sql-ledger'){
          $request->{message} = 
              $request->{_locale}->text("SQL-Ledger database detected.");

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.