|
|
|
@ -468,10 +468,9 @@ class VariableUrUnixPw(Variable):
|
|
|
|
|
|
|
|
|
|
def check(self, value):
|
|
|
|
|
delete_pw = self.GetBool('ur_unix_pw_delete_set')
|
|
|
|
|
change_lock = (self.GetBool('ur_unix_lock_set') !=
|
|
|
|
|
self.GetBool('ur_unix_lock_exists_set'))
|
|
|
|
|
change_lock = self.GetBool('ur_unix_lock_set')
|
|
|
|
|
if (self.Get('cl_unix_action') == Actions.Passwd and
|
|
|
|
|
not delete_pw and not change_lock and not value):
|
|
|
|
|
not delete_pw and change_lock is None and not value):
|
|
|
|
|
raise PasswordError(_("Specify user password"))
|
|
|
|
|
if self.Get('cl_unix_action') in (Actions.Passwd, Actions.UserMod):
|
|
|
|
|
if self.Get('ur_unix_pw_delete_set') == 'on' and value:
|
|
|
|
@ -552,7 +551,7 @@ class VariableUrUnixVisibleSet(ExistsUserHelper, UnixActionHelper, Variable):
|
|
|
|
|
Виден ли пользователь
|
|
|
|
|
"""
|
|
|
|
|
attribute = "visible"
|
|
|
|
|
type = "bool"
|
|
|
|
|
type = "boolauto"
|
|
|
|
|
opt = ("-v", "--visible")
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
@ -562,28 +561,24 @@ class VariableUrUnixVisibleSet(ExistsUserHelper, UnixActionHelper, Variable):
|
|
|
|
|
def get_new(self):
|
|
|
|
|
return "on"
|
|
|
|
|
|
|
|
|
|
def get_exists(self):
|
|
|
|
|
return "auto"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableUrUnixLockSet(ExistsUserHelper, UnixActionHelper, Variable):
|
|
|
|
|
"""
|
|
|
|
|
Виден ли пользователь
|
|
|
|
|
"""
|
|
|
|
|
attribute = "lock"
|
|
|
|
|
type = "bool"
|
|
|
|
|
type = "boolauto"
|
|
|
|
|
opt = ("-l", "--lock")
|
|
|
|
|
value = "off"
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("Locked")
|
|
|
|
|
self.help = _("lock the account")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableUrUnixLockExistsSet(ExistsUserHelper, UnixActionHelper, Variable):
|
|
|
|
|
"""
|
|
|
|
|
Виден ли пользователь
|
|
|
|
|
"""
|
|
|
|
|
type = "bool"
|
|
|
|
|
attribute = "lock"
|
|
|
|
|
value = "off"
|
|
|
|
|
def get(self):
|
|
|
|
|
return "auto"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableUrUnixVisibleFlag(UnixUserHelper, ReadonlyVariable):
|
|
|
|
|