|
|
|
@ -58,6 +58,8 @@ class VariableUrUnixLogin(UnixUserHelper, UnixActionHelper, Variable):
|
|
|
|
|
raise VariableError(_("You should specify login"))
|
|
|
|
|
if not re.match("^[a-zA-Z_]([a-zA-Z0-9_ -]*[a-zA-Z0-9_-])?$", value):
|
|
|
|
|
raise VariableError(_("Wrong user login"))
|
|
|
|
|
if value == "list":
|
|
|
|
|
raise VariableError(_("List is using as keyword"))
|
|
|
|
|
if self.search_ldap_user_name(value):
|
|
|
|
|
raise VariableError(_("User %s already exists" % value))
|
|
|
|
|
if self.search_system_user_name(value):
|
|
|
|
@ -183,9 +185,6 @@ class VariableUrUnixHomePathMove(Variable):
|
|
|
|
|
if path.exists(new_path):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("New home directory %s exists") % new_path)
|
|
|
|
|
if not path.exists(old_path):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Previous home directory %s not found") % old_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUnixGroupDefault(Variable):
|
|
|
|
@ -719,3 +718,6 @@ class VariableUrUnixUserShow(UnixUserHelper, UnixActionHelper, Variable):
|
|
|
|
|
if value:
|
|
|
|
|
if not self.search_ldap_user_name(value):
|
|
|
|
|
raise VariableError(_("%s user not found") % value)
|
|
|
|
|
|
|
|
|
|
def raiseWrongChoice(self, name, choiceVal, value, error):
|
|
|
|
|
raise VariableError(_("Wrong user name"))
|
|
|
|
|