Exemple #1
0
} else {
    $success = '';
}
if (isset($_POST["btnSubmit"])) {
    $email = mysql_real_escape_string($_POST["email_in"]);
    $password = mysql_real_escape_string($_POST["password_in"]);
    $data_login = array('email' => $email, 'password' => md5($password));
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        $error['email'] = $lang['error_email_valid'];
    }
    if (empty($error)) {
        if (!verifyLoginCustomer($data_login)) {
            $_SESSION['error_warning'] = $lang['error_failed_login'];
            header('Location:login.html');
        } else {
            $customer_data = getCustomerByEmail($data_login);
            if ($customer_data['status'] == 0) {
                $_SESSION['error_warning'] = $lang['error_failed_activation'];
                header('Location:login.html');
            } else {
                $success = $lang['success_login'];
                $_SESSION['coin_id'] = $customer_data['customer_id'];
                $_SESSION['start'] = time();
                $_SESSION['expire'] = $_SESSION['start'] + 1 * 60;
                header('Location:' . mainPageURL());
            }
        }
    } else {
        $_SESSION['error_warning'] = $error['email'];
        header('Location:login.html');
    }
Exemple #2
0
<?php

if (isset($logged)) {
    header("location:" . mainPageURL());
}
if (isset($_POST['emails'])) {
    $emails = $_POST['emails'];
} else {
    $emails = '';
}
if (isset($_POST["btnGet"])) {
    $emails = mysql_real_escape_string($_POST['emails']);
    if (verifyDuplicateCustomer($emails, "email")) {
        $code = sha1(uniqid(mt_rand(), true));
        $data_emails = array('email' => $emails);
        $customer = getCustomerByEmail($data_emails);
        $edit_data = array('customerId' => $customer['customer_id'], 'fcode' => $code);
        $edit_query = editCustomer($edit_data);
        if ($edit_query) {
            $subject = $lang['text_password_reset'];
            $body = "Dear " . $customer['username'] . ", \n\t\t\t\t\t<br><br/>\n\t\t\t\t\tPlease <a href='" . mainPageURL() . "resetpassword/" . base64_encode(urlencode($emails)) . "/" . $code . ".html'>Click Here</a> to reset your password.<br/><br/>\n\t\t\t\t\tIf the above link does not work, you can paste the following address into your browser:<br/><br/>\n\t\t\t\t\t" . mainPageURL() . "resetpassword/" . base64_encode(urlencode($emails)) . "/" . $code . ".html<br/><br/>\n\t\t\t\t\t<br/>\n\t\t\t\t\tEnjoy your awesome first auction experience with " . $lang['text_company_name'] . ".\n\t\t\t\t\t<br /><br /> \n\t\t\t\t\tThank You! \n\t\t\t\t\t<br /><br />\n\t\t\t\t\tNOTE:If you did not request for this email. Kindly ignore it.\n\t\t\t\t\t<br /><br />\n\t\t\t\t\tBest Regards,\n\t\t\t\t\t" . $lang['text_company_name'] . " Management Team";
            $data_mail = array('to_name' => $customer['username'], 'to_email' => $emails, 'subject' => $subject, 'body' => $body);
            sendMail($data_mail);
            $_SESSION['success'] = $lang['success_mail_password'];
            header("location:login.html");
        } else {
            $error_warning = $lang['error_query'];
        }
    } else {
        $error_warning = $lang['error_email_not_exist'];
    }