-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp index c43b391..42a9144 100644 --- a/noncore/settings/usermanager/userdialog.cpp +++ b/noncore/settings/usermanager/userdialog.cpp | |||
@@ -112,4 +112,4 @@ void UserDialog::setupTab1() { | |||
112 | skelCheckBox->setChecked(true); | 112 | skelCheckBox->setChecked(true); |
113 | skelLabel->setDisabled(true); | 113 | //skelLabel->setDisabled(true); |
114 | skelCheckBox->setDisabled(true); | 114 | //skelCheckBox->setDisabled(true); |
115 | 115 | ||
@@ -245,2 +245,18 @@ bool UserDialog::addUser(int uid, int gid) { | |||
245 | } | 245 | } |
246 | |||
247 | // Should we copy the skeleton homedirectory /etc/skel to the user's homedirectory? | ||
248 | accounts->findUser(adduserDialog->loginLineEdit->text()); | ||
249 | if(adduserDialog->skelCheckBox->isChecked()) { | ||
250 | QString command_cp; | ||
251 | QString command_chown; | ||
252 | command_cp.sprintf("cp -a /etc/skel/* %s/",accounts->pw_dir.latin1()); | ||
253 | system(command_cp); | ||
254 | |||
255 | command_cp.sprintf("cp -a /etc/skel/.[!.]* %s/",accounts->pw_dir.latin1());// Bug in busybox, ".*" includes parent directory, does this work as a workaround? | ||
256 | system(command_cp); | ||
257 | |||
258 | command_chown.sprintf("chown -R %d:%d %s",accounts->pw_uid,accounts->pw_gid,accounts->pw_dir.latin1()); | ||
259 | system(command_chown); | ||
260 | } | ||
261 | |||
246 | return true; | 262 | return true; |