Skip to content

Commit

Permalink
Webgui with session id:
Browse files Browse the repository at this point in the history
	* refs #2559
	* ad some more hints about password
	* focus to password field
	* fix message for wrong password


git-svn-id: file:///var/svn/freetz/trunk@13344 149334a1-2f27-0410-a3b9-fc62619ac1e6
  • Loading branch information
MaxMuster authored and MaxMuster committed Aug 9, 2015
1 parent a27d216 commit 778af81
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
Expand Up @@ -21,7 +21,7 @@ cgi_print_textline "httpd_sessiontimeout" "$MOD_HTTPD_SESSIONTIMEOUT" 5 "$(lang

cat << EOF
<script >
var conftext='$(lang de:"Noch in der Erprobung!\\nZur Sicherheit sollte ein anderer Zugang zur Box vorhanden sein (telnet/ssh).\\nStandard PW ist \"freetz\"!\\n" en:"Still under development!\\nPlease make sure, you have an alternate way to access your box (telnet/ssh).\\nDefault password is \"freetz\"!\\n")'
var conftext='$(lang de:"Noch in der Erprobung!\\nZur Sicherheit sollte ein anderer Zugang zur Box vorhanden sein (telnet/ssh).\\nStandard PW ist \"freetz\", beim PW-Setzen wird es auf \"<User><PW>\" gesetzt!\\n\\nDas PW kann in Konsole so gesetzt werden:\\necho -n \"<Passwort>\" | md5sum | sed \"s/ .*$//\" > /tmp/flash/mod/webmd5\\n" en:"Still under development!\\nPlease make sure, you have an alternate way to access your box (telnet/ssh).\\nDefault password is \"freetz\", changing password will set it to \"<User><PW>\"!\\n\\nYou can set the PW in console with this command:\\necho -n \"<password>\" | md5sum | sed \"s/ .*$//\" > /tmp/flash/mod/webmd5\\n")'
var el=document.getElementById('httpd_newlogin_yes');
var eltime=document.getElementById('httpd_sessiontimeout');
$([ "$MOD_HTTPD_NEWLOGIN" = yes ] || echo "eltime.disabled = true;")
Expand Down
1 change: 1 addition & 0 deletions make/mod/files/root/usr/mww/cgi-bin/login_check.sh
Expand Up @@ -5,6 +5,7 @@ ID_IP=$(cat /tmp/loginsid 2>/dev/null)
SID=${ID_IP%#*}
IP=${ID_IP#*#}
hash=${QUERY_STRING##*hash=}
[ -f /tmp/flash/mod/webmd5 ] || echo -n "465d0ff27bb239292778dc3a0c2f28d9" > /tmp/flash/mod/webmd5
UPWHASH=$(cat /tmp/flash/mod/webmd5 | tr -d '\n' )
myhash="$(echo -n "$SID$UPWHASH" | md5sum | sed 's/[ ]*-.*//')"

Expand Down
5 changes: 3 additions & 2 deletions make/mod/files/root/usr/mww/cgi-bin/login_page.sh
Expand Up @@ -8,7 +8,7 @@ echo "Set-Cookie: SID=$SENDSID;Path=/"

cgi_begin 'login'
# Waren wir schonmal hier? Dann war was falsch!
[ "$WRONGPW" ] && echo "<b>$(lang de:"Passwort falsch!" en:"Wrong password!")</b><p>"
[ "$WRONGPW" = 1 ] && echo "<b>$(lang de:"Passwort falsch!" en:"Wrong password!")</b><p>"

. /usr/mww/cgi-bin/md5hash.sh

Expand All @@ -17,7 +17,8 @@ $(lang de:"Passwort" en:"Password"): <input type="password" id="inp_pw" maxleng
<input type="button" name="go" id="id_go" value="$(lang de:"Anmelden" en:"Login")"
EOF
echo -n "onclick='location.href=\"/cgi-bin/login.cgi?hash=\"+makemd5(document.getElementById(\"inp_pw\").value, \"$SENDSID\"); '>"
echo "onclick='location.href=\"/cgi-bin/login.cgi?hash=\"+makemd5(document.getElementById(\"inp_pw\").value, \"$SENDSID\"); '>"
echo "<script> document.getElementById(\"inp_pw\").focus(); </script>"

cgi_end

Expand Down
2 changes: 1 addition & 1 deletion make/mod/files/root/usr/mww/cgi-bin/pwchange.cgi
Expand Up @@ -10,7 +10,7 @@ cgi_end
exit
fi

if [ -n "${QUERY_STRING##*newhash=}" ]; then
if [ -n "$(echo $QUERY_STRING | sed -n 's%.*newhash=\([0-9a-f]*\).*%\1% p')" ]; then
source /usr/mww/cgi-bin/pwchange_check.sh
else
source /usr/mww/cgi-bin/pwchange_page.sh
Expand Down
2 changes: 1 addition & 1 deletion make/mod/files/root/usr/mww/cgi-bin/pwchange_page.sh
Expand Up @@ -6,7 +6,7 @@ CHALLENGE="$(echo -n "$(date +%s)" | md5sum | sed 's/[ ]*-//')"

cgi_begin '$(lang de:"Passwort &auml;ndern!" en:"Change password!")'
# Waren wir schonmal hier? Dann war was falsch!
[ "$WRONGPW" ] && echo "<b>$(lang de:"altes Passwort war falsch!" en:"Wrong old password!")</b><p>"
[ "$WRONGPW" = 1 ] && echo "<b>$(lang de:"Altes Passwort war falsch!" en:"Wrong old password!")</b><p>"
[ "$(cat /tmp/flash/mod/webmd5 | tr -d '\n' )" = "465d0ff27bb239292778dc3a0c2f28d9" ] && echo "<b>$(lang de:"Standard Passwort gesetzt. Bitte &auml;ndern!" en:"Default password set! Please change it.")</b><p>"

. /usr/mww/cgi-bin/md5hash.sh
Expand Down

0 comments on commit 778af81

Please sign in to comment.