Diffstat (limited to 'noncore/settings/usermanager/userdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp index 3654639..75a96a6 100644 --- a/noncore/settings/usermanager/userdialog.cpp +++ b/noncore/settings/usermanager/userdialog.cpp | |||
@@ -233,27 +233,30 @@ bool UserDialog::addUser(int uid, int gid) | |||
233 | if (temp->text()=="audio") temp->setOn(true); | 233 | if (temp->text()=="audio") temp->setOn(true); |
234 | if (temp->text()=="time") temp->setOn(true); | 234 | if (temp->text()=="time") temp->setOn(true); |
235 | if (temp->text()=="power") temp->setOn(true); | 235 | if (temp->text()=="power") temp->setOn(true); |
236 | if (temp->text()=="input") temp->setOn(true); | 236 | if (temp->text()=="input") temp->setOn(true); |
237 | if (temp->text()=="sharp") temp->setOn(true); | 237 | if (temp->text()=="sharp") temp->setOn(true); |
238 | if (temp->text()=="tty") temp->setOn(true); | 238 | if (temp->text()=="tty") temp->setOn(true); |
239 | } | 239 | } |
240 | } | 240 | } |
241 | // Show the dialog! | 241 | // Show the dialog! |
242 | if(!(adduserDialog->exec())) return false; | 242 | if(!(adduserDialog->exec())) return false; |
243 | if((adduserDialog->groupComboBox->currentItem()!=0)) | 243 | if((adduserDialog->groupComboBox->currentItem()!=0)) |
244 | { | 244 | { |
245 | accounts->findGroup(adduserDialog->groupComboBox->currentText()); | 245 | // making the call findGroup() puts the group info in the accounts gr_gid |
246 | adduserDialog->groupID=accounts->gr_gid; | 246 | if (accounts->findGroup(adduserDialog->groupComboBox->currentText())) |
247 | owarn << QString::number(accounts->gr_gid) << oendl; | 247 | { |
248 | adduserDialog->groupID=accounts->gr_gid; | ||
249 | owarn << QString::number(accounts->gr_gid) << oendl; | ||
250 | } | ||
248 | } | 251 | } |
249 | if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), | 252 | if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), |
250 | adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(), | 253 | adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(), |
251 | QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) | 254 | QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) |
252 | { | 255 | { |
253 | QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user."); | 256 | QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user."); |
254 | return false; | 257 | return false; |
255 | } | 258 | } |
256 | 259 | ||
257 | // Add User to additional groups. | 260 | // Add User to additional groups. |
258 | QListViewItemIterator it( adduserDialog->groupsListView ); | 261 | QListViewItemIterator it( adduserDialog->groupsListView ); |
259 | for ( ; it.current(); ++it ) | 262 | for ( ; it.current(); ++it ) |