def get_ui_edit_user(self): u = backend.get_user(self._selected_user, self.users) backend.map_groups([u], backend.get_all_groups()) g = ', '.join(u.groups) dlg = UI.DialogBox(UI.LayoutTable( UI.LayoutTableRow(UI.Label(text='Login: '******'Change', id='chlogin')), UI.LayoutTableRow(UI.Label(), UI.Button(text='Change password', id='chpasswd')), UI.LayoutTableRow( UI.Label(), UI.WarningButton(text='Delete user', id='deluser', msg='Delete user %s' % u.login)), UI.LayoutTableRow(UI.Label(text='UID: ' + str(u.uid)), UI.Button(text='Change', id='chuid')), UI.LayoutTableRow(UI.Label(text='GID: ' + str(u.gid)), UI.Button(text='Change', id='chgid')), UI.LayoutTableRow(UI.Label(text='Home directory: ' + u.home), UI.Button(text='Change', id='chhome')), UI.LayoutTableRow(UI.Label(text='Shell: ' + u.shell), UI.Button(text='Change', id='chshell')), UI.LayoutTableRow(UI.Label(text='Groups: '), UI.Button(text='Edit', id='chgroups')), UI.LayoutTableRow(UI.LayoutTableCell(UI.Label(text=g), colspan=2))), title='Edit user', id='dlgEditUser') return dlg
def get_default_ui(self): self.users = backend.get_all_users() self.groups = backend.get_all_groups() backend.map_groups(self.users, self.groups) tc = UI.TabControl(active=self._tab) tc.add('Users', self.get_ui_users()) tc.add('Groups', self.get_ui_groups()) if self._editing != '': tc = UI.VContainer(tc, UI.InputBox(text=self.params[self._editing], id='dlgEdit')) return tc
def get_default_ui(self): self.users = backend.get_all_users() self.groups = backend.get_all_groups() backend.map_groups(self.users, self.groups) tc = UI.TabControl(active=self._tab) tc.add('Users', self.get_ui_users()) tc.add('Groups', self.get_ui_groups()) if self._editing != '': tc = UI.VContainer( tc, UI.InputBox(text=self.params[self._editing], id='dlgEdit')) return tc
def get_ui_edit_user(self): u = backend.get_user(self._selected_user, self.users) backend.map_groups([u], backend.get_all_groups()) g = ', '.join(u.groups) dlg = UI.DialogBox( UI.LayoutTable( UI.LayoutTableRow( UI.Label(text='Login: '******'Change', id='chlogin') ), UI.LayoutTableRow( UI.Label(), UI.Button(text='Change password', id='chpasswd') ), UI.LayoutTableRow( UI.Label(), UI.WarningButton(text='Delete user', id='deluser', msg='Delete user %s'%u.login) ), UI.LayoutTableRow( UI.Label(text='UID: '+ str(u.uid)), UI.Button(text='Change', id='chuid') ), UI.LayoutTableRow( UI.Label(text='GID: '+ str(u.gid)), UI.Button(text='Change', id='chgid') ), UI.LayoutTableRow( UI.Label(text='Home directory: '+ u.home), UI.Button(text='Change', id='chhome') ), UI.LayoutTableRow( UI.Label(text='Shell: '+ u.shell), UI.Button(text='Change', id='chshell') ), UI.LayoutTableRow( UI.Label(text='Groups: '), UI.Button(text='Edit', id='chgroups') ), UI.LayoutTableRow( UI.LayoutTableCell( UI.Label(text=g), colspan=2 ) ) ), title='Edit user', id='dlgEditUser' ) return dlg