From 3407a04463759f42a143644483d5e9c904c03a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Tue, 30 Aug 2016 17:57:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D1=8B?= =?UTF-8?q?=20usermod=20=D0=B8=20groupmod,=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D0=B0=D1=8F=20cl=5Funix=5Fgruop=5Fdefault?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/unix/variables/groups.py | 2 ++ pym/unix/variables/users.py | 15 +++++++++++++-- pym/unix/wsdl_unix.py | 6 +++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pym/unix/variables/groups.py b/pym/unix/variables/groups.py index d444c2a..c9f1f01 100644 --- a/pym/unix/variables/groups.py +++ b/pym/unix/variables/groups.py @@ -261,6 +261,7 @@ class VariableUrUnixGroupUsersAdd(UnixUserHelper, Variable): """ type = "choiceedit-list" opt = ("-a", "--add") + guitype = "hidden" value = [] metavalue = "USERS" @@ -336,6 +337,7 @@ class VariableUrUnixGroupUsersDel(UnixUserHelper, Variable): """ type = "choiceedit-list" opt = ("-r", "--remove") + guitype = "hidden" value = [] metavalue = "USERS" diff --git a/pym/unix/variables/users.py b/pym/unix/variables/users.py index 64b96c1..79430a2 100644 --- a/pym/unix/variables/users.py +++ b/pym/unix/variables/users.py @@ -185,6 +185,13 @@ class VariableUrUnixHomePathMove(Variable): _("Previous home directory %s not found") % old_path) +class VariableClUnixGroupDefault(Variable): + """ + Основная группа пользователя по умолчанию + """ + value = "domain" + + class VariableUrUnixPrimaryGroup(ExistsUserHelper, UnixGroupHelper, UnixActionHelper, Variable): """ @@ -195,7 +202,9 @@ class VariableUrUnixPrimaryGroup(ExistsUserHelper, UnixGroupHelper, opt = ('-g', '--gid') metavalue = "GROUP" - domain_group = "domain" + @property + def domain_group(self): + return self.Get('cl_unix_group_default') def init(self): self.label = _("Primary group") @@ -203,7 +212,7 @@ class VariableUrUnixPrimaryGroup(ExistsUserHelper, UnixGroupHelper, "('default' value for create default group)") def get_new(self): - return "domain" + return self.domain_group def get_exists(self): value = str(ExistsUserHelper.get_exists(self)) @@ -332,6 +341,7 @@ class VariableUrUnixGroupsAdd(UnixGroupHelper, UnixActionHelper, Variable): Список групп в которые необходимо добавить пользователя """ type = "choiceedit-list" + guitype = "hidden" opt = ("-a", "--append") metavalue = "GROUPS" value = [] @@ -390,6 +400,7 @@ class VariableUrUnixGroupsDel(VariableUrUnixGroupsAdd): """ type = "choiceedit-list" opt = ("-r", "--remove") + guitype = "hidden" metavalue = "GROUPS" value = [] diff --git a/pym/unix/wsdl_unix.py b/pym/unix/wsdl_unix.py index fbaba1a..ee1302b 100644 --- a/pym/unix/wsdl_unix.py +++ b/pym/unix/wsdl_unix.py @@ -382,16 +382,16 @@ class Wsdl(WsdlBase): 'ur_unix_primary_group', 'ur_unix_comment', 'ur_unix_groups', - 'ur_unix_visible_set', - 'ur_unix_lock_set', ), expert=( 'ur_unix_groups_add', 'ur_unix_groups_del', + 'ur_unix_lock_set', + 'ur_unix_pw_delete_set', + 'ur_unix_visible_set', 'ur_unix_home_path', 'ur_unix_home_path_move', 'ur_unix_shell', - 'ur_unix_pw_delete_set', ), custom_buttons=[ CustomButton.run_method(Unix.Method.UserShow,