MyBB Community Forums

Full Version: Add secret PIN to ACP login
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10
I just added this to my new forum and it works great.
Thanks @ poster
Could this be taken further to give a login pin system similar to Libertyreserve or other online banks?

ex; [Image: VDnWLYQ.png]
Yep.

Assign an id and a name to the form, we shall call it "login". This means, on line 382, replace

<form method="post" action="{$_SERVER['PHP_SELF']}{$query_string}">

with

<form method="post" action="{$_SERVER['PHP_SELF']}{$query_string}" id="login" name="login">

Two lines above, you will find "print <<<EOF". Add after:

<script type="text/javascript">
<!--
function insertText(pin)
{     
document.login.pin.value+=pin;
}
//-->
</script>

Next, find:

            <div class="label"{$login_label_width}><label for="pin">Secret PIN</label></div>
            <div class="field"><input type="password" name="pin" id="pin" class="text_input" /></div> 

Between the "/>" and the "</div>", add this:

<input type="button" name="insertTxt" onClick="insertText('0');" value="0"/>
<input type="button" name="insertTxt" onClick="insertText('1');" value="1"/>
<input type="button" name="insertTxt" onClick="insertText('2');" value="2"/>
<input type="button" name="insertTxt" onClick="insertText('3');" value="3"/>
<input type="button" name="insertTxt" onClick="insertText('4');" value="4"/>
<input type="button" name="insertTxt" onClick="insertText('5');" value="5"/>
<input type="button" name="insertTxt" onClick="insertText('6');" value="6"/>
<input type="button" name="insertTxt" onClick="insertText('7');" value="7"/>
<input type="button" name="insertTxt" onClick="insertText('8');" value="8"/>
<input type="button" name="insertTxt" onClick="insertText('9');" value="9"/>

I borrowed some of the code off the internet, specifically here and adapted it to fit Paul's modifications. Remember, it uses JavaScript so an Admin MUST have that enabled to use this, otherwise they can type it out manually.

There shouldn't be any issues, but I did not test this on a MyBB environment, only on a fresh HTML page.
I still wish there was a way to have to enter multiple pins not just one.

I would have like to enter 10 different pins if I could.
Very helpful! Thanks paul
Very nice dude, thanks heaps for this.
this one must be default option for any admin
Very nice dude, thanks heaps for this.
I want to thank whichever developer added this to the 1.8 core. I have the code on my 1.8 test board set to something similar to what you'd see in an ssh key, then I set my Mac up so that when I type a terminal command, it copies to my clipboard.

It didn't work as perfectly with this modification, for some reason unknown to me. But add this to password protecting directories, and you've probably avoided a lot of the risk of having your ACP compromised.
Pages: 1 2 3 4 5 6 7 8 9 10