HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/selfanalyse/school/index.php
<?php
include_once('../wp-config.php');
global $wpdb;

/**
 * hello test
 */

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
global $current_user;
get_currentuserinfo();
$user_id = $current_user->ID;
// if($user_id!='')
// {
//     header("location: dashboard.php");
//     exit();
// }
if ( is_user_logged_in() ) {
header("location: dashboard");
}


if(isset($_POST['submit']))
{
	$login=$_REQUEST['user_name'];	
	$password=$_REQUEST['password'];
	
	$creds = array();

	$creds['user_login'] = $login;
	$creds['user_password'] = $password;
	$creds['remember'] = true;
	$user = wp_signon( $creds, false );
	if(is_wp_error($user)){
		$error= $user->get_error_message();
	} else {
		if($user->ID!='0'){
		echo $redirect_to=get_site_url().'/school/dashboard.php';
			header("Location: " . $redirect_to );
		}
	}
	
	
}
?>
<!DOCTYPE html>
<html dir="ltr">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="../assets/images/favicon.png">
    <title> LOGIN </title>
    <!-- Custom CSS -->
    <link href="dist/css/style.min.css" rel="stylesheet">
</head>

<body>
    <div class="main-wrapper">
        <!-- ============================================================== -->
        <!-- Preloader - style you can find in spinners.css -->
        <!-- ============================================================== -->
        <div class="preloader">
            <div class="lds-ripple">
                <div class="lds-pos"></div>
                <div class="lds-pos"></div>
            </div>
        </div>
        <!-- ============================================================== -->
        <!-- Preloader - style you can find in spinners.css -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Login box.scss -->
        <!-- ============================================================== -->
        <div class="auth-wrapper d-flex no-block justify-content-center align-items-center position-relative"
            style="background:url(../assets/images/big/auth-bg.jpg) no-repeat center center;">
            <div class="auth-box row">
                <div class="col-lg-7 col-md-5 modal-bg-img" style="background: rgba(169,184,200,.15);">
                	<img src="../wp-content/themes/shineolympiad/images/csc-olympiad-logo.png" style="width: 75%;margin: 0 auto;display:block;padding: 10em 0em;">
                </div>
                <div class="col-lg-5 col-md-7 bg-white">
                    <div class="p-3">
                        <h2 class="mt-3 text-center">Sign In</h2>
                        <p class="text-center">Enter your email address and password to access admin panel.</p>
                        <form class="mt-4" method="post" action="">
                            <div class="row">
                            	<p  style="color: red;font-size: 15px;">
                                <?php if(isset($error)) echo $error; ?></p>
                                <div class="col-lg-12">
                                    <div class="form-group">
                                        <label class="text-dark" for="uname">Username</label>
                                         <input type="text" name="user_name" class="form-control" placeholder="Username Or Email"
                                         id="w_user" required>   
                                    </div>
                                </div>
                                <div class="col-lg-12">
                                    <div class="form-group">
                                        <label class="text-dark" for="pwd">Password</label>
                                        <input type="password" name="password" class="form-control" placeholder="Password"  id="w_pass" required>
                                    </div>
                                </div>
                                <div class="col-lg-12 text-center">
                                    <input type="button" class="btn btn-success btn-block"
                                        id="w_login" value="Login">
                                </div>
                                <div class="col-lg-12 text-center mt-5">
                                    Don't have an account? <a href="#" class="text-danger">Sign Up</a>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <!-- ============================================================== -->
        <!-- Login box.scss -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- All Required js -->
    <!-- ============================================================== -->
    <script src="assets/libs/jquery/dist/jquery.min.js "></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="assets/libs/popper.js/dist/umd/popper.min.js "></script>
    <script src="assets/libs/bootstrap/dist/js/bootstrap.min.js "></script>
    <!-- ============================================================== -->
    <!-- This page plugin js -->
    <!-- ============================================================== -->
    <script>
        $(".preloader ").fadeOut();
    </script>
    <script>
        $(document).ready(function() {
            /*********login function */
            jQuery('#w_login').click(function() {

                jQuery("#loader").css('display', 'inline-table');
                var w_user = jQuery("#w_user").val();
                var w_pass = jQuery("#w_pass").val();
                if (w_user == '') {
                    alert("Please enter user login");
                    jQuery("#w_user").focus();
                    jQuery("#loader").css('display', 'none');
                } else if (w_pass == '') {
                    alert("Please enter password");
                    jQuery("#w_user").focus();
                    jQuery("#loader").css('display', 'none');
                } else {
                    var arr = {
                        "user_login": w_user,
                        "user_pass": w_pass
                    };
                    var url = 'backend/authenticate_login.php';
                    jQuery.ajax({
                        url: url,
                        type: 'POST',
                        data: JSON.stringify(arr),
                        contentType: 'application/json; charset=utf-8',
                        dataType: 'json',
                        success: function(data) {
                            var status = data[0].status;
                            if (status == 0) {
                                alert(data[0].message);
                            } else if (status == 1) {
                               //toastr.success(data[0].message);
                                window.location = "dashboard";
                            }
                        }
                    });
                }
            });


        });
    </script>



</body>

</html>