Beispiel #1
0
require_once 'Auth.php';
require_once 'Forgot.php';
require_once 'Login.php';
require_once 'Register.php';
if (isset($_POST['login'])) {
    $login = new Login();
    $login->login();
    print $login->printOutput();
} else {
    if (isset($_POST['forgot'])) {
        $forgot = new Forgot();
        $forgot->forgot();
        print $forgot->printOutput();
    } else {
        if (isset($_POST['register'])) {
            $register = new Register();
            $register->register();
            print $register->printOutput();
        } else {
            if (isset($_POST["accept"])) {
                $auth = new Auth();
                try {
                    $auth->authenticate();
                } catch (Exception $ex) {
                    $auth->acceptTerms();
                    print $auth->printOutput();
                }
            }
        }
    }
}
Beispiel #2
0
</html>



<?php 
$db = new mysqli('localhost', 'root', '', 'Library');
/*if(isset($_POST['logout'])){
	session_destroy();
	header("Location: main.php");
}*/
if (isset($_POST['register'])) {
    include 'register.php';
    $r = new Register();
    if ($r) {
        //true if $r is not null
        if ($r->register()) {
            header("Location: succ_reg.html");
        }
    }
}
if (isset($_POST['login'])) {
    $email = $_POST['email'];
    # $password = md5($_POST['password']);
    # $password = hash('sha256', $_POST['password']);
    $password = $_POST['password'];
    if (validateLogin($email, $password)) {
        header("Location: direct.php");
    } else {
        echo 'invalid email/password';
    }
}
Beispiel #3
0
	</div>	
	
	
	<div class="footer">
		
	</div>
</body>
</html>

<?php 
if (isset($_POST['signUP'])) {
    include 'registerClass.php';
    $r = new Register();
    if ($r) {
        //true if $r is not null
        $temp = $r->register();
        if ($temp == true) {
            $_SESSION['name'] = $_POST['nameUp'];
            $_SESSION['email'] = $_POST['emailUp'];
            header("Location: index.php");
            die;
        }
    }
}
if (isset($_POST['login'])) {
    $email = $_POST['emailIn'];
    $password = md5($_POST['passwordIn']);
    if (validateLogin($email, $password)) {
        header("Location: index.php");
        die;
    } else {