summaryrefslogtreecommitdiff
path: root/templates/system/login/user/node.def
blob: ea03736224950075784cc18ede9262460b042158 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
tag:
type: txt
help: User account information
commit:expression: $VAR(authentication/encrypted-password) != ""
                   || $VAR(authentication/plaintext-password) != ""
                   ; "user password must be specified"
syntax:expression: pattern $VAR(@) "^[a-zA-Z_][a-zA-Z0-9_-]*\\$?$" ; "invalid user name $VAR(@)"
# line continuation and $() expansion are done by cli, not sh.
# need mandatory encrypted password.
end:expression: "if [ -d /tmp/vyatta-delete-system-login-user-$VAR(@).$PPID ]; \
then rm -rf /tmp/vyatta-delete-system-login-user-$VAR(@).$PPID && exit 0; \
fi && \
sudo /opt/vyatta/sbin/vyatta_update_login_user.pl \
  '$VAR(@)' '$VAR(full-name/@)' '$VAR(authentication/encrypted-password/@)' \
  '$VAR(level/@)'"
delete:expression: "if [ x$VAR(@) == x ]; then exit 1; fi && \
if [ x$VAR(@) == xroot ]; then \
  echo Cannot delete user \"root\" 1>&2 && exit 2; \
fi && \
if mkdir /tmp/vyatta-delete-system-login-user-$VAR(@).$PPID >& /dev/null; \
then \
  if ! sudo /opt/vyatta/sbin/vyatta_update_login_user.pl -d '$VAR(@)'; then \
    rm -rf /tmp/vyatta-delete-system-login-user-$VAR(@).$PPID; \
    exit 1; \
  fi; \
else \
  exit 1; \
fi"