fix typos in CONFIG_SITE files
[openwrt/svn-archive/openwrt.git] / openwrt / package / webif / files / www / cgi-bin / webif / system-password.sh
1 #!/usr/bin/webif-page
2 <?
3 . /usr/lib/webif/webif.sh
4
5 empty "$FORM_submit" || {
6 SAVED=1
7 validate <<EOF
8 string|FORM_pw1|Password|required min=5|$FORM_pw1
9 EOF
10 equal "$FORM_pw1" "$FORM_pw2" || {
11 ERROR="$ERROR Passwords do not match<br />"
12 }
13 empty "$ERROR" && {
14 RES=$(
15 (
16 echo "$FORM_pw1"
17 sleep 1
18 echo "$FORM_pw2"
19 ) | passwd root 2>&1
20 )
21 equal "$?" 0 || ERROR="<pre>$RES</pre>"
22 }
23 }
24
25 header "System" "Password Change" "@TR<<Password Change>>" '' "$SCRIPT_NAME"
26
27 display_form <<EOF
28 start_form|@TR<<Password Change>>
29 field|@TR<<New Password>>:
30 password|pw1
31 field|@TR<<Confirm Password>>:
32 password|pw2
33 end_form
34 EOF
35
36 footer ?>
37
38 <!--
39 ##WEBIF:name:System:200:Password Change
40 -->