Last active
January 1, 2016 06:39
-
-
Save dLobatog/8106711 to your computer and use it in GitHub Desktop.
comtrend gigabit 802.11n router movistar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pwdAdmin = 'PASSWORD IN PLAIN TEXT'; | |
pwdSupport = 'support'; | |
pwdUser = 'user'; | |
function btnApply() { | |
var loc = 'password.cgi?'; | |
with ( document.forms[0] ) { | |
var idx = userName.selectedIndex; | |
switch ( idx ) { | |
case 0: | |
alert("No username is selected."); | |
return; | |
case 1: | |
if ( pwdOld.value == pwdAdmin ) | |
break; | |
else { | |
alert("Old admin password is wrong."); | |
return; | |
} | |
case 2: | |
if ( pwdOld.value == pwdSupport ) | |
break; | |
else { | |
alert("Old support password is wrong."); | |
return; | |
} | |
case 3: | |
if ( pwdOld.value == pwdUser ) | |
break; | |
else { | |
alert("Old user password is wrong."); | |
return; | |
} | |
} | |
if ( pwdNew.value != pwdCfm.value ) { | |
alert("The passwords do not match."); | |
return; | |
} | |
var str = new String(); | |
str = pwdNew.value; | |
if ( str.length > 16 ) { | |
alert('Password should not be longer than 16 characters.'); | |
return; | |
} | |
if ( str.indexOf(' ') != -1 ) { | |
alert('Password cannot contain a space.'); | |
return; | |
} | |
switch ( idx ) { | |
case 2: | |
loc += 'sptPassword=' + encodeUrl(pwdNew.value); | |
break; | |
case 3: | |
loc += 'usrPassword=' + encodeUrl(pwdNew.value); | |
break; | |
default: | |
loc += 'adminPassword=' + encodeUrl(pwdNew.value); | |
break; | |
} | |
var code = 'location="' + loc + '"'; | |
eval(code); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment