Skip to content

Commit

Permalink
#21 Reset Password
Browse files Browse the repository at this point in the history
  • Loading branch information
opticod committed Jan 9, 2016
1 parent 499b9bd commit d8e11b7
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
55 changes: 55 additions & 0 deletions controller/reset.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

<!DOCTYPE html>
<html>
<head>
<title>Anwesha - Reset Password</title>
<style>
body{
background:#efefef;
overflow-x:hidden;
}
.box{
position:absolute;
left:50%;
top:50%;
transform:translate(-50%,-50%);
background:#fff;
width:40%;
padding:1em;
box-shadow: 0.5em 0.5em 0.25em #888888;
border-radius:0.5em;
}
#anwlogo{
position:absolute;
top:0;
left:0;
padding:0.5em;
width:5em;
}
#iitplogo{
position:absolute;
bottom:0;
right:0;
padding:0.5em;
width:5em;
}
</style>
</head>
<body>
<a href="http://2016.anwesha.info"><img id="anwlogo" src="http://2016.anwesha.info/images/logo-icon.png"></a>
<a href="http://iitp.ac.in"><img id="iitplogo" src="http://2016.anwesha.info/images/80x80xiitp_logo.png.pagespeed.ic.lT8byNYLqW.png"></a>
<div class="box">
<?php
if ($verification[0] = -1){
echo "Password Reset was unsuccessfull. If you think this is an error, contact the administrator.";
} else {
echo "Password Reset was successfull!";

} ?>

<br>

</div>
<b></b>
</body>
</html>
15 changes: 15 additions & 0 deletions controller/verifyReset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
require('model/model.php');
require('dbConnection.php');
$conn = mysqli_connect(SERVER_ADDRESS,USER_NAME,PASSWORD,DATABASE);
$id = $match[1];
if(!(isset($_POST['resetPswd']) && !empty($_POST['resetPswd']))){
header('Content-type:application/json');
echo json_encode(array(-1,array('Reset Password not given.')));
die();
}
$resetPswd=mysql_prep($_POST['resetPswd']);
$verification = People::checkResetPassword($id,$resetPswd,$conn);
mysqli_close($conn);
include('controller/reset.html');
?>

0 comments on commit d8e11b7

Please sign in to comment.