HOME


Mini Shell 1.0
DIR: /proc/self/root/home/islapiiu/sites/villaeffort/admin/login/
Upload File :
Current File : //proc/self/root/home/islapiiu/sites/villaeffort/admin/login/password-reset.php
<?php
$error = NULL;

include '../../db.php';
include '../../function.php';



if (isset($_POST['update'])) {

    $code = $_POST["code"];
    $password = $_POST["password"];
    $confpassword = $_POST["confirmpassword"];

    $code = SelectResetCode($code);
    if (!$code) {
        header('Location:password-reset.php?message=please check your reset code');
    } elseif ($password != $confpassword) {
        header('Location:password-reset.php?message=Password and Confirm password does not match');
    } else {
        $pw = $_POST['password'] . 'galle@123';
        $enPass = md5($pw);

        if (empty($_POST['password'])) {

            $password = $_POST['confirmpassword'] . 'galle@123';
            $enPass = md5($pw);
        }

        $sql = "UPDATE `user` SET `password` = '" . $enPass . "' WHERE resetcode =  '" . $_POST['code'] . "'";
        $db = new DB();

        $db->readQuery($sql);

        header('location: index.php?success=Your Password was reset Successfully');
    }


//    $OldPassOk = User::ChecknewReset($_POST["code"], $_POST["password"]);
//
//    header('Location: ../reset-password.php?message=3');
}
?> 

<!DOCTYPE html>

<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Sublime IT Solution Basic Admin Panel</title>

        <link type="text/css" href="../css/bootstrap.min.css" rel="stylesheet">
        <link type="text/css" href="../css/font-awesome.min.css" rel="stylesheet">

        <link type="text/css" href="../css/theme.css" rel="stylesheet">
        <link type="text/css" href="../css/animate.css" rel="stylesheet">

    </head>
    <body style="background-image: url(../img/bg.jpg)"> 

        <div class="container" id="container" >
            <header>
                <!-- Main comapny header -->
                <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
                    <div class="container">
                        <div class="navbar-header">
                            <a href="#"><img src="../../images/ecovilla.png"/></a>
                        </div>

                    </div>
                </nav>
            </header>
            <section id="form" class="animated fadeInDown">
                <div class="container">    
                    <div id="loginbox" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">                    
                        <div class="panel white-alpha-90" >
                            <div class="panel-heading">
                                <div class="panel-title text-center"><h2><span class="text-primary">Forget Password</span></h2></div>
                            </div>     
                            <div class="panel-body" >
                                <div style="display:none" id="login-alert" class="alert alert-danger col-sm-12"></div>

                                <?php
                                if (isset($_GET['message'])) {
                                    ?>

                                    <div class="alert alert-danger alert-dismissible" role="alert">

                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>

                                        <strong> <?php echo $_GET['message'] ?></strong>

                                    </div>

                                    <?php
                                }
                                ?>
                                <?php
                                if (isset($_GET['success'])) {
                                    ?>

                                    <div class="alert alert-success alert-dismissible" role="alert">

                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>

                                        <strong> <?php echo $_GET['success'] ?></strong>

                                    </div>

                                    <?php
                                }
                                ?>
                                <form id="loginform" action="" method="post" class="form-horizontal" role="form">
                                    <div class="input-group">
                                        <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                        <input id="login-username" type="text" class="form-control" name="code" placeholder="Password Reset Code" name="password" placeholder="New Password" required="true">                                        
                                    </div>
                                    <div class="input-group">
                                        <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                        <input id="login-username" type="password" class="form-control" minlength="8" name="password" placeholder="New Password" required="true">                                        
                                    </div>
                                    <div class="input-group">
                                        <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                        <input id="login-username" type="password" class="form-control" minlength="8" placeholder="Confirm Password" name="confirmpassword" placeholder="Confirm your new Password" required="true">                                        
                                    </div>
                                    <div class="input-group col-xs-12 text-left login-action">
                                        <div class="checkbox">
                                            <label style="padding-top: 15px; margin: 0">

                                                <input class="btn btn-success" type="submit" value="Send Email" name="update"> 
                                            </label>
                                        </div>
                                    </div>
                                    <div style="margin-top:10px" class="form-group">
                                        <div class="col-sm-12 controls">

                                        </div>
                                    </div>
                                </form>     
                            </div>                     
                        </div>  
                    </div>
                </div>
            </section>
            <footer>
                <nav class="navbar navbar-default navbar-fixed-bottom" role="navigation">
                    <div class="container text-center">
                        <div class="footer-content">
                            <a href="http://www.sublime.lk/" target="_blank"> Sublime IT Solution </a>
                        </div>
                    </div><!-- /.container-fluid -->
                </nav>
            </footer>
        </div>

        <script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>
        <script type="text/javascript" src="../js/bootstrap.min.js"></script>

    </body>
</html>