Esempio n. 1
0
        }
    } else {
        header("Location:index.php?for_err=1");
        exit;
    }
}


if (isset($_REQUEST['login_submit'])) {
    unset($_SESSION['sohorepro_userid']);
    unset($_SESSION['sohorepro_companyid']);
    unset($_SESSION['sohorepro_username']);
    $emailid = mysql_real_escape_string($_POST['email_id']);
    $pass = mysql_real_escape_string($_POST['password']);

    $user_login = UserLogin($emailid, $pass);
    $chk_cus_status = CheckCusStatus($user_login[0]['cus_compname']);

//    
//   
//    
//    foreach ($user_login as $login_pre){
//        $check_status[] =  StatusCheckComp($login_pre['cus_compname']);
//    }
//    
//    
//    $cus_details = CustomerDetails($check_status[0]);

    if ((count($user_login) > 0)) {
        $_SESSION['sohorepro_userid'] = $user_login[0]['cus_id'];
        $_SESSION['sohorepro_companyid'] = $user_login[0]['cus_compname'];
Esempio n. 2
0
    $sql_result = mysql_query($query);
    if (mysql_num_rows($sql_result) > 0) {
        echo '1';
    } else {
        echo '0';
    }
}
//Reference Value Set
if (isset($_POST['referece_set_fav']) && $_POST['referece_set_fav'] != '') {
    $_SESSION['ref_val'] = $_POST['referece_set_fav'];
}
if (isset($_POST['usr_name_chk']) && $_POST['usr_name_chk'] != '') {
    $reference = $_POST['reference_login'];
    $user_name = $_POST['usr_name_chk'];
    $user_pass = $_POST['usr_pass_chk'];
    $user_login = UserLogin($user_name, $user_pass);
    $chk_cus_status = CheckCusStatus($user_login[0]['cus_compname']);
    if (count($user_login[0]) > 0) {
        $_SESSION['sohorepro_userid'] = $user_login[0]['cus_id'];
        $_SESSION['sohorepro_companyid'] = $user_login[0]['cus_compname'];
        $_SESSION['sohorepro_username'] = $user_login[0]['cus_contact_name'];
        $ip = md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR']);
        $items_guest = ItemsTemp($ip);
        foreach ($items_guest as $items) {
            $check_spl_price = GetSplPriceProduct($items['product_id'], $user_login[0]['cus_compname']);
            $unit_prc = count($check_spl_price) == '' ? ProdPriceForAdd($items['product_id']) : GetSplPriceProduct($items['product_id'], $user_login[0]['cus_compname']);
            $query = "INSERT INTO sohorepro_checkout SET product_id     = '" . $items['product_id'] . "', quantity = '" . $items['quantity'] . "', unit_price = '" . $unit_prc . "', user_id = '" . $user_login[0]['cus_id'] . "', staff_id = '0', company_id = '" . $user_login[0]['cus_compname'] . "', reference = '" . $reference . "', shipping_add_id = '0' ";
            $res = mysql_query($query);
        }
        $query = "DELETE FROM sohorepro_checkout_guest WHERE ip = '" . $ip . "' ";
        mysql_query($query);
Esempio n. 3
0
<?php

session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . "/data-layer/dbCommunication.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/service-layer/serviceLayer.php";
if (isset($_POST['login'])) {
    $Username = $_POST['username'];
    $Password = $_POST['password'];
    $output = UserLogin($Username, $Password);
    var_dump($output);
    // If success, redirect to dashboard.php
}
if (isset($_POST['register'])) {
    echo "why";
    $Username = $_POST['username'];
    $Password = $_POST['password'];
    $output = CreateUser($Username, $Password);
    var_dump($output);
}
// Verify that we're authorized
if (!isset($_SESSION["Token"]) || !IsAuthorized()) {
    // Redirect to index.php
    header("Location: index.php");
}
$_SESSION["LastMessageID"] = 0;
/**
   $output = CreateGame("GameTest", "Evan");
   if(IsUserTurn($_SESSION["Username"], $_SESSION["GameID"]))
       HitPlayer("Evan");
   if(IsUserTurn($_SESSION["Username"], $_SESSION["GameID"]))
       FoldPlayer();
Esempio n. 4
0
<?php

if (isset($_POST['Nickname']) && isset($_POST['Passwort'])) {
    if (!UserLogin($_POST['Nickname'], sha1($_POST['Passwort']))) {
        include "Content/Error.html";
    } else {
        restore_include_path();
        include "Profil/index.php";
    }
}
Esempio n. 5
0
    $out = IsExistingUser($_POST['Nom'], $_POST['password']);
    echo $out;
    if ($out === false) {
        $Error = true;
    } else {
        /*if(session_status() == PHP_SESSION_NONE)
                {
                    session_start();
                    session_destroy();
                }
        */
        echo $out;
        $_SESSION['IDUsager'] = $out;
        echo $_SESSION['IDUsager'];
        HEADER("Location: index.php");
        UserLogin($_SESSION['IDUsager']);
    }
}
?>

<div class="container">
<div class="col-md-offset-3 col-md-6 col-xs-12">
    <div class="panel panel-default">
        <div class="page-header">
            <div class="panel-title">
                <h1>Connection</h1>
            </div>
        </div>
            <div class="panel-body">
                <form method="post">
                    <div class="form-group">
Esempio n. 6
0
<?php
include './admin/config.php';
include './admin/db_connection.php';
include './admin/include/class.phpmailer.php';
include './admin/mail_template.php';
if(isset($_REQUEST['login_submit']))
{ 
    unset($_SESSION['sohorepro_userid']);
    unset($_SESSION['sohorepro_companyid']);
    unset($_SESSION['sohorepro_username']); 
    
    $emailid= mysql_real_escape_string($_POST['email_id']);
    $pass= mysql_real_escape_string($_POST['password']);
    $rememberme= mysql_real_escape_string($_POST['rememberme']);

    $user_login = UserLogin($emailid,$pass); 
    $chk_cus_status = CheckCusStatus($user_login[0]['cus_compname']);
    
//    echo '<pre>';
//    print_r($user_login);
//    echo '</pre>';
//    exit;
//    
//   
//    
//    foreach ($user_login as $login_pre){
//        $check_status[] =  StatusCheckComp($login_pre['cus_compname']);
//    }
//    
//    
Esempio n. 7
0
    is_api();
    $json = file_get_contents('php://input');
    $jsonarray = json_decode($json, true);
    $username = $jsonarray["username"];
    $password = $jsonarray["password"];
    if (empty($username)) {
        die(ErrorCode::CODE("1004"));
    }
    if (empty($password)) {
        die(ErrorCode::CODE("1005"));
    }
    if (inject_check($username)) {
        die(ErrorCode::CODE("1006"));
    }
    $data = array("username" => $username, "password" => $password);
    $info = UserLogin($data);
    die($info);
});
if_post("/Encrypt.json", function () {
    is_api();
    $json = file_get_contents('php://input');
    $jsonarray = json_decode($json, true);
    $userinfo = GetUserinfoJson($jsonarray['token']);
    $md5 = md5($userinfo['username'] . $userinfo['id'] . $userinfo['create_at'] . $userinfo['create_ip'] . $jsonarray['key']);
    $key = Crypt3Des::encrypt($jsonarray['pass'], $md5);
    $md5Key = MD5($key);
    $md5Key = base64_encode($md5Key . $md5Key . $md5Key);
    if (!empty($jsonarray['num'])) {
        die('{"encrypt":"' . substr($md5Key, strlen($md5Key) - $jsonarray['num'], $jsonarray['num']) . '"}');
    } else {
        die('{"encrypt":"' . $md5Key . '"}');
Esempio n. 8
0
<?php

include './admin/config.php';
include './admin/mail_template.php';
if (isset($_REQUEST['order_val']) == '1') {
    extract($_POST);
    $cus_contact_name = $reg_fname . ' ' . $reg_lname;
    $sql = "INSERT INTO sohorepro_customers SET\r\r\n             cus_fname = '" . $reg_fname . "',             \r\r\n             cus_lname = '" . $reg_lname . "',\r\r\n             cus_email = '" . $reg_email_id . "',\r\r\n             cus_pass = '******',\r\r\n             cus_compname = '" . $customer_id_new . "',\r\r\n             cus_contact_name = '" . $cus_contact_name . "',\r\r\n             cus_contact_email = '" . $reg_email_id . "',\r\r\n             cus_contact_phone = '" . $reg_user_phone . "',             \r\r\n             cus_status   = '1' ";
    mysql_query($sql);
    $notifi_to_iser = CreateUsrNoti($customer_id_new, $reg_contactname);
    //Check If Added the product in Guest
    $chk_prf_guest = ChkPrdGuest();
    if (count($chk_prf_guest) > 0) {
        //Check User Login
        $user_login = UserLogin($reg_email_id, $reg_password);
        if (count($user_login) > 0) {
            $_SESSION['sohorepro_userid'] = $user_login[0]['cus_id'];
            $_SESSION['sohorepro_companyid'] = $user_login[0]['cus_compname'];
            $_SESSION['sohorepro_username'] = $user_login[0]['cus_contact_name'];
            header("Location:shoppingcart.php?ref=" . $new_usr_ref);
        } else {
            echo 'Credentials In-Correct';
        }
    } else {
        header("Location:existing_customer.php?new_user=succ&cus_id=" . $customer_id_new);
    }
}
if (isset($_REQUEST['new_company_add']) == '1') {
    extract($_POST);
    $comp_name_exist = checkcomp($reg_compname);
    if (count($comp_name_exist) > 0) {