[PATCH 2/2] Allow the user to be added to wheel group (#462161)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 modules/create_user.py |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/modules/create_user.py b/modules/create_user.py
index ee77072..c472cfc 100644
--- a/modules/create_user.py
+++ b/modules/create_user.py
@@ -208,6 +208,12 @@ class moduleClass(Module):
 
         self.admin.setpassUser(userEnt, self.passwordEntry.get_text(), 0)
 
+        # add user to wheel group
+        if self.is_admin.get_active():
+            wheelEnt = self.admin.lookupGroupByName("wheel")
+            wheelEnt.add(libuser.MEMBERNAME, username)
+            self.admin.modifyGroup(wheelEnt)
+
         return RESULT_SUCCESS
 
     def createScreen(self):
@@ -242,7 +248,7 @@ class moduleClass(Module):
 
         self.vbox.pack_start(label, False, True)
 
-        table = gtk.Table(2, 4)
+        table = gtk.Table(3, 4)
         table.set_row_spacings(6)
         table.set_col_spacings(6)
 
@@ -274,6 +280,10 @@ class moduleClass(Module):
         table.attach(label, 0, 1, 3, 4, gtk.FILL)
         table.attach(self.confirmEntry, 1, 2, 3, 4, gtk.SHRINK, gtk.FILL, 5)
 
+        self.is_admin = gtk.CheckButton(_("Add to Administrators group"))
+        self.is_admin.set_alignment(0.0, 0.5)
+        table.attach(self.is_admin, 2, 3, 1, 2, gtk.FILL)
+
         self.vbox.pack_start(table, False)
 
         label = gtk.Label(_("If you need to use network authentication, such as Kerberos or NIS, "
-- 
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux