From f7ade0d59e96e3f3ddf1da8c4641bc2772eae24e Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Thu, 10 Jun 2021 15:17:03 -0400 Subject: [PATCH] 2021-06-10 Fred Gleason * Fixed a bug in rdadmin(1) that threw a SQL error when attempting to add a new user. * Fixed a bug in rdadmin(1) that caused the incorrect Login Name to appear in the 'Rivendell User List' dialog immediately after adding the user. Signed-off-by: Fred Gleason --- ChangeLog | 6 ++++++ lib/rduserlistmodel.cpp | 6 +++--- rdadmin/add_user.cpp | 14 ++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3cedaeba..8a073bdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21865,3 +21865,9 @@ 2021-06-04 Fred Gleason * Corrected file permissions and ownerships for rsyslog in 'debian/postinst'. +2021-06-10 Fred Gleason + * Fixed a bug in rdadmin(1) that threw a SQL error when attempting + to add a new user. + * Fixed a bug in rdadmin(1) that caused the incorrect Login Name + to appear in the 'Rivendell User List' dialog immediately after + adding the user. diff --git a/lib/rduserlistmodel.cpp b/lib/rduserlistmodel.cpp index 2bfb4e28..d41fd0b5 100644 --- a/lib/rduserlistmodel.cpp +++ b/lib/rduserlistmodel.cpp @@ -213,10 +213,10 @@ void RDUserListModel::refresh(const QModelIndex &row) } -void RDUserListModel::refresh(const QString &grpname) +void RDUserListModel::refresh(const QString &username) { for(int i=0;ifirst()) { updateRow(line,q); diff --git a/rdadmin/add_user.cpp b/rdadmin/add_user.cpp index 49d465e4..c40d65e2 100644 --- a/rdadmin/add_user.cpp +++ b/rdadmin/add_user.cpp @@ -35,10 +35,8 @@ AddUser::AddUser(QString *username,QWidget *parent) // // Fix the Window Size // - setMinimumWidth(sizeHint().width()); - setMaximumWidth(sizeHint().width()); - setMinimumHeight(sizeHint().height()); - setMaximumHeight(sizeHint().height()); + setMinimumSize(sizeHint()); + setMaximumSize(sizeHint()); setWindowTitle("RDAdmin - "+tr("Add User")); @@ -104,16 +102,12 @@ void AddUser::okData() } sql=QString("insert into `USERS` set ")+ - "`LOGIN_NAME`='"+RDEscapeString(username)+"',"+ - "`PASSWORD`=PASSWORD('')"; - q=new RDSqlQuery(sql); - if(!q->isActive()) { + "`LOGIN_NAME`='"+RDEscapeString(username)+"'"; + if(!RDSqlQuery::apply(sql)) { QMessageBox::warning(this,tr("User Exists"),tr("User Already Exists!"), 1,0,0); - delete q; return; } - delete q; sql="select `NAME` from `GROUPS`"; q=new RDSqlQuery(sql); while(q->next()) {