function checkDuplicatMail()
{
    $user = new PublicUser();
    if (isset($_POST['action'])) {
        $email = $_POST['uemail'];
        $phone = $_POST['phone'];
        if ($email != '') {
            if ($user->check_duplicate_user($email)) {
                $data['status'] = '0';
                $data['message'] = "* Email ID already exists";
            } else {
                $data['status'] = '1';
            }
        } else {
            if ($user->check_duplicate_user($phone, 'phone')) {
                $data['status'] = '0';
                $data['message'] = "* Phone Number Already Exists!";
            } else {
                $data['status'] = '1';
            }
        }
        echo json_encode($data);
    }
}
Beispiel #2
0
// $ip = $mainController->getRealIpAddr();
// print $ip;
$username = $_POST['username'];
$password = $_POST['password'];
// If non empty values
if (isset($username) && isset($password)) {
    $username = stripcslashes($username);
    $passoword = stripcslashes($password);
    $mainController = new LoginController();
    $ip = $mainController->getRealIpAddr();
    $record = $mainController->getLoginRecordByIp($ip);
    // Run validations
    if (Validate::username($username) && Validate::password($password)) {
        $username = preg_replace("/[^a-zA-Z0-9_\\-]+/", "", $username);
        // user credentials passed the validations
        $publicUser = new PublicUser($username, $password);
        $result = $publicUser->getUserByUsername($username);
        if ($result) {
            // username found
            if (password_verify($password, $result['password']) && (int) $result['blocked'] !== 1) {
                print_r($result);
                $user = new User($result['username'], $result['password'], $result['administrator']);
                $_SESSION["usertype"] = $user->getUserPrivilege();
                $_SESSION["username"] = $user->getUsername();
                $_SESSION["ip"] = $user->getRealIpAddr();
                header("location:frontend/index.php");
                exit;
            } elseif ((int) $result['blocked'] === 1) {
                header("location:blocked.html");
                exit;
            } else {
Beispiel #3
0
<?php

global $session, $main_db;
$user = new User();
$post = new posts();
$p_user = new PublicUser();
$hotline = $post->get_single_post_by('hotline');
$logo = $post->get_single_post_by('logo');
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title> Ink City </title>
<!--    Twitter bootstrap -->
    <link rel="stylesheet" href="<?php 
echo get_stylesheet_files('bootstrap');
?>
">
     <link rel="stylesheet" href="<?php 
echo get_stylesheet_files('bootstrap-theme');
?>
">
<!--    Font Awesome -->
     <link rel="stylesheet" href="<?php 
echo get_stylesheet_files('font-awesome');
?>
">
Beispiel #4
0
 function __construct($username, $hashed, $admin)
 {
     parent::__construct($username, $hashed);
     $this->administrator = $admin;
 }