diff --git a/pym/server/variables/action.py b/pym/server/variables/action.py index 76d8a63..9dfb3b0 100644 --- a/pym/server/variables/action.py +++ b/pym/server/variables/action.py @@ -27,6 +27,8 @@ class Actions(object): Backup = "server_backup" Ldif = "server_ldif" + All = (Setup, Backup, Ldif) + class VariableAcServerSetup(ActionVariable): """ diff --git a/pym/server/variables/server.py b/pym/server/variables/server.py index 2709dd0..e1bc7a2 100644 --- a/pym/server/variables/server.py +++ b/pym/server/variables/server.py @@ -16,16 +16,23 @@ import sys from calculate.lib.cl_lang import setLocalTranslate -from calculate.lib.datavars import ReadonlyVariable, Variable +from calculate.lib.datavars import ReadonlyVariable, Variable, VariableError +_ = lambda x: x setLocalTranslate('cl_server3', sys.modules[__name__]) -class VariableClServerName(ReadonlyVariable): +class VariableClServerName(Variable): """ Название настраиваемого сервиса """ value = "" + untrusted = True + + def check(self, value): + if value == 'unix' and self.Get('sr_ldap_set') != 'on': + raise VariableError(_("LDAP server is not setup.")) + class VariableClServerEnvPath(Variable): """ @@ -33,11 +40,17 @@ class VariableClServerEnvPath(Variable): """ value = "/etc/calculate/server.env" + class VariableSrLdapSet(Variable): """ Настроен ли LDAP """ type = "bool" + value = "off" + + def init(self): + self.label = _("LDAP server configured") + class VariableSrUnixSet(Variable): """ @@ -45,8 +58,18 @@ class VariableSrUnixSet(Variable): """ type = "bool" + value = "off" + + def init(self): + self.label = _("Unix server configured") + + class VariableSrSambaSet(Variable): """ Настроена ли Samba """ type = "bool" + value = "off" + + def init(self): + self.label = _("Samba server configured")