Skip to content

Instantly share code, notes, and snippets.

@paramientos
Created August 29, 2016 15:49
Show Gist options
  • Save paramientos/470f1609a9aaef95a6efcd08611af8a2 to your computer and use it in GitHub Desktop.
Save paramientos/470f1609a9aaef95a6efcd08611af8a2 to your computer and use it in GitHub Desktop.
<?php
/*************************************/
session_start();
$digit = "6";
function generate_code($digit) {
$random_it="";
$letters = "abcdefghjkmnprstuxvyz23456789ABCDEFGHJKMNPRSTUXVYZ";
for ($i=0; $i<$digit; $i++) {
$salla .= $letters{rand(0,strlen($letters)-1)};
}
return $salla;
}
$security_code = generate_code($digit);
$_SESSION['security_code'] = $security_code;
/*************************************/
?>
<center>
<table class="login">
<tr>
<td>
<table>
<tr>
<td style="padding: 0 10px 0 42px; height: 280px; width: 170px;">
<a href="/"><img border=0 src="/images/vesta_logo.png" alt="Vesta Control Panel" style="margin: 0 0 0 0;" /></a>
</td>
<td style="padding: 20px 0 0 0;">
<form method="post" action="/login/" >
<table class="login-box">
<tr>
<td syle="padding: 12px 0 0 2px;">
<?php print __('Username');?>
</td>
</tr>
<tr>
<td>
<input tabindex="1" type="text" size="20px" style="width:240px;" name="user" class="vst-input">
</td>
</tr>
<tr>
<td style="padding: 12px 0 0 2px;">
<?php print __('Password');?>
<span style="padding:0 0 0 14px;">
<a tabindex="5" class="vst-advanced" href="/reset/">
<?php print __('forgot password');?>
</a>
</span>
</td>
</tr>
<tr>
<td>
<input tabindex="2" type="password" size="20px" style="width:240px;" name="password" class="vst-input">
</td>
</tr>
<tr>
<td height="20px">
</td>
</tr>
<tr>
<td>
<div>Security Code : <label style="color: #aaa;"><?php echo $security_code;?></label></div>
<input type="text" tabindex="2" name="security_code" class="vst-input" style="width:240px;"/>
</td>
</tr>
<tr>
<td height="28px">
</td>
</tr>
<tr>
<td style="padding: 0 0 12px 0;">
<input tabindex="3" type="submit" value="<?php print __('Log in');?>" class="button">
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td colspan=2>
<div class="login-bottom">
<div style="height:20px"><?php if (isset($ERROR)) echo $ERROR ?></div>
<a class="vestacp" href="http://vestacp.com" >vestacp.com</a>
</div>
</td>
</tr>
</table>
</tr>
</table>
</center>
</body>
@arafatx
Copy link

arafatx commented Dec 30, 2017

Is this the security question ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment