Skip to content

Commit

Permalink
GMP | 1. EXP -- [small bug fixed for -- ] generalized form asking for…
Browse files Browse the repository at this point in the history
… comment & master password; can be used anywhere in the framework whenever user interactions must be audited & password required; currently used at the time of GMP run submission; needs testing...
  • Loading branch information
alexsav815 committed Jun 29, 2023
1 parent e090f92 commit d230b9b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
1 change: 0 additions & 1 deletion gui/us_passwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ QMap < QString, QString > US_Passwd::getPasswd_auditTrail( QString title, QStri
// if ( ! pw.isEmpty() ) return pw;

QMap < QString, QString > form_map;

QString pw;

// See if the master pasword has been set
Expand Down
20 changes: 18 additions & 2 deletions programs/us_experiment/us_experiment_gui_optima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6281,11 +6281,27 @@ void US_ExperGuiUpload::submitExperiment_confirm()
}
else
{
//get user info:
//get info on logged in user [submitter]:
US_Passwd pw;
QString masterPW = pw.getPasswd();
US_DB2 db( masterPW ); // New constructor
QStringList qry;
qry << QString( "get_user_info" );
db. query( qry );
db. next();
int u_ID = db. value( 0 ).toInt();
QString u_fname = db. value( 1 ).toString();
QString u_lname = db. value( 2 ).toString();
int u_lev = db. value( 5 ).toInt();

QString user_submitter = u_lname + ", " + u_fname;

//ask for submitter's credentials: password, comment [for subsequent audit trail]:
qDebug() << "Checking master password...";
gmp_submitter_map.clear();
US_Passwd pw;
gmp_submitter_map = pw.getPasswd_auditTrail( "GMP Run Submitter Form", "Savelyev, Alexey" );
US_Passwd pw_at;
gmp_submitter_map = pw_at.getPasswd_auditTrail( "GMP Run Submitter Form", user_submitter );

int submit_map_size = gmp_submitter_map.keys().size();
qDebug() << "Submitter map: "
Expand Down

0 comments on commit d230b9b

Please sign in to comment.