summaryrefslogtreecommitdiff
authorumopapisdn <umopapisdn>2002-10-14 20:42:04 (UTC)
committer umopapisdn <umopapisdn>2002-10-14 20:42:04 (UTC)
commit14f450ead20011e5697bb36a4ad087cc648b439d (patch) (side-by-side diff)
tree7b474bbeeba4ceebb50c2da0bf26d80002062970
parent8140420efa133ea59310d3f8de721950fd1d13af (diff)
downloadopie-14f450ead20011e5697bb36a4ad087cc648b439d.zip
opie-14f450ead20011e5697bb36a4ad087cc648b439d.tar.gz
opie-14f450ead20011e5697bb36a4ad087cc648b439d.tar.bz2
New users added in OpenZaurus now by default belong to some groups. (video, audio, time, power, input, sharp, tty)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/userdialog.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index 90e27d5..c43b391 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -14,2 +14,3 @@
#include <qmessagebox.h>
+#include <qfile.h>
@@ -189,2 +190,5 @@ void UserDialog::setupTab2() {
bool UserDialog::addUser(int uid, int gid) {
+ QCheckListItem *temp;
+ QFile ozTest;
+ int oz=ozTest.exists("/etc/oz_version");
UserDialog *adduserDialog=new UserDialog();
@@ -196,2 +200,16 @@ bool UserDialog::addUser(int uid, int gid) {
adduserDialog->uidLineEdit->setText(QString::number(uid));
+ // If we're running on OZ, add new users to some default groups.
+ if(oz) {
+ QListViewItemIterator iter( adduserDialog->groupsListView );
+ for ( ; iter.current(); ++iter ) {
+ temp=(QCheckListItem*)iter.current();
+ if (temp->text()=="video") temp->setOn(true);
+ if (temp->text()=="audio") temp->setOn(true);
+ if (temp->text()=="time") temp->setOn(true);
+ if (temp->text()=="power") temp->setOn(true);
+ if (temp->text()=="input") temp->setOn(true);
+ if (temp->text()=="sharp") temp->setOn(true);
+ if (temp->text()=="tty") temp->setOn(true);
+ }
+ }
// Show the dialog!
@@ -211,7 +229,6 @@ bool UserDialog::addUser(int uid, int gid) {
// Add User to additional groups.
- QCheckListItem *temp;
QListViewItemIterator it( adduserDialog->groupsListView );
for ( ; it.current(); ++it ) {
- temp=(QCheckListItem*)it.current();
- if (temp->isOn() )
+ temp=(QCheckListItem*)it.current();
+ if (temp->isOn() )
accounts->addGroupMember(it.current()->text(0),adduserDialog->loginLineEdit->text());