by

Thank the author with a small contribution using PayPal.

0
85 Views
2 Badges
Top 5% !
Specified
Popularity: 4232nd place
Created
Modified Dec 24, 2013
This snippet is Public
No tags for this snippet yet.
LanguageJavaScript
SourceGithub

comtrend gigabit 802.11n router movistar

comtrend gigabit 802.11n router movistar: 
gistfile1.js
post this code
<iframe id="embedFrame" style="width:600px; height:300px;" src="http://www.snip2code.com/Embed/13739/comtrend-gigabit-802-11n-router-movistar"></iframe>
Click on the embed code to copy it into your clipboard Width:Height:
Leave empty to retrieve all the content First Line:Last Line:
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);
   }
}


If you want to be updated about similar snippets, Sign in and follow our Channels
Originally posted on https://gist.github.com/8106711