<?php require_once 'common/config/config.inc.php'; require_once SOURCE_ROOT . 'components/class.validation.inc.php'; require_once SOURCE_ROOT . 'classes/class.customer_login.php'; $objCustomerLogin = new CustomerLogin(); /* This is used to forgot password purpose */ if (isset($_POST['Submit'])) { /* Create users instance*/ $objCustomerLogin->forgotPasswordMail($_POST); header('location:forgot_password.php'); exit; }
<?php require_once 'common/config/config.inc.php'; require_once SOURCE_ROOT . 'classes/class.customer_login.php'; //For retaining the values in the form if ($_SESSION['sessArrLoginData']) { $arrSessionData = $objCore->removePrefix($_SESSION['sessArrLoginData'], 3); @extract($arrSessionData); $_SESSION['sessArrLoginData'] = ''; } else { $Process = $_GET['frmProcess']; } if ($_SESSION['sessCustomerFirstName']) { $objCustomerLogin = new CustomerLogin(); $objCustomerLogin->doCustomerLogout(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Customer Login</title> <meta name="language" content="en" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <link rel="stylesheet" media="all" type="text/css" href="common/css/reset.css" />
<?php require_once 'common/config/config.inc.php'; require_once SOURCE_ROOT . 'classes/class.customer_login.php'; //here object is created $objCustomerLogin = new CustomerLogin(); //customer session is checked whether it is valid or not if (!$objCustomerLogin->checkCustomerSession()) { header('location:login.php'); die; } if (isset($_SESSION['sessCartDetails'])) { $arrCartDetails = $_SESSION['sessCartDetails']; //$_SESSION['sessCartDetails']= array(); require "components/ups/usps.php"; $usps = new USPS(); $usps->setServer("http://Production.ShippingAPIs.com/ShippingAPI.dll"); $usps->setUserName("760BODYZ6562"); $usps->setService("All"); $usps->setOrigZip("30076"); $usps->setContainer("Flat Rate Box"); $usps->setMachinable("true"); $usps->setSize("LARGE"); } //Code for getting Billing Details $arrCols = array('CustomerFirstName', 'CustomerLastName', 'CustomerEmailID', 'CustomerPhone', 'CustomerAddressOne', 'CustomerAddressTwo', 'CustomerCountry', 'CustomerState', 'CustomerCity', 'CustomerZipcode', 'CustomerShippingPhone', 'CustomerShippingAddressOne', 'CustomerShippingAddressTwo', 'CustomerShippingCountry', 'CustomerShippingState', 'CustomerShippingCity', 'CustomerShippingZipcode', 'CustomerIsAddressSame'); //$varTable = TABLE_CUSTOMERS.' INNER JOIN '.TABLE_CARD_INFO.' ON '.TABLE_CUSTOMERS.'.pkCustomerID ='.TABLE_CARD_INFO.'.fkCustomerID'; $varWhere = 'pkCustomerID = \'' . $_SESSION['sessCustomerID'] . '\''; $arrCustomerRecord = $objGeneral->getRecord(TABLE_CUSTOMERS, $arrCols, $varWhere); @extract($arrCustomerRecord[0]); //Listing countries
/** * Authenticates a user. * The example implementation makes sure if the username and password * are both 'demo'. * In practical applications, this should be changed to authenticate * against some persistent user identity storage (e.g. database). * @return boolean whether authentication succeeds. */ public function authenticate() { /*$users=array( // username => password 'demo'=>'demo', 'admin'=>'admin', );*/ $users = array(); if ($this->usertype == "registration") { if ($_POST['LoginForm']['logintype'] == 'company') { //echo "fsfs"; //echo "<pre>";print_r($this->username);die; $users = Login::model()->findByAttributes(array('email' => $this->username), 'status=:status', array(':status' => 1)); // Yii::app()->session['loggedId'] =$users->id; //echo "<pre>";print_r($users); $users = $users->attributes; //echo "<pre>";print_r($users);die; } else { //echo "Mohit";die; $users = CustomerLogin::model()->findByAttributes(array('email' => $this->username)); //Yii::app()->session['loggedId'] =$users->id; //echo "fsfsf"."<pre>";print_r($users);die; $users = $users->attributes; /* if(empty($users)) $this->errorCode=self::ERROR_USERNAME_INVALID; elseif(!empty($users->password) && $users->password!==md5($this->password)) $this->errorCode=self::ERROR_PASSWORD_INVALID; elseif(!empty($users->status) && $users->status !==1) $this->errorCode=self::STATUS_NOT_ACTIVE; else{ $this->_id = $users->id; $this->errorCode=self::ERROR_NONE; } return !$this->errorCode; */ } //echo "<pre>";print_r($users['password']);die; } else { //echo "fsfs"; //echo "<pre>";print_r($_REQUEST);die; $uName = $_POST['LoginForm']['username']; $uPass = md5($_POST['LoginForm']['password']); $users = Admin::model()->findByAttributes(array('username' => $this->username)); if (empty($users)) { $this->errorCode = self::ERROR_USERNAME_INVALID; } elseif (!empty($users['password']) && $users['password'] !== md5($this->password)) { $this->errorCode = self::ERROR_PASSWORD_INVALID; } elseif (!empty($users['status']) && $users['status'] != 1) { $this->errorCode = self::STATUS_NOT_ACTIVE; } else { $this->_id = $users->id; $this->errorCode = self::ERROR_NONE; } return !$this->errorCode; } //echo $users['password'];die; // code for company if (empty($users)) { $this->errorCode = self::ERROR_USERNAME_INVALID; } elseif (!empty($users->password) && $users->password !== md5($this->password)) { $this->errorCode = self::ERROR_PASSWORD_INVALID; } elseif (!empty($users->status) && $users->status !== 1) { $this->errorCode = self::STATUS_NOT_ACTIVE; } else { //echo $users->id;die; $this->_id = $users->id; $this->errorCode = self::ERROR_NONE; } return !$this->errorCode; }
<?php require_once 'common/config/config.inc.php'; require_once SOURCE_ROOT . 'classes/class.customer.php'; require_once SOURCE_ROOT . 'classes/class.customer_login.php'; require_once SOURCE_ROOT . 'components/class.validation.inc.php'; $objCustomer = new Customer(); $objCustomerLogin = new CustomerLogin(); $varProcess = $_POST['frmProcess']; //print_r($_POST);die; switch ($varProcess) { case 'saveCustomer': //$varUserID = $objUser->saveUser($_POST); if ($objCustomer->saveCustomer($_POST)) { header('location:welcome.php'); die; } else { header('location:registration.php'); die; } break; case 'editCustomer': if ($objCustomer->saveCustomer($_POST)) { header('location:view_profile.php'); die; } else { header('location:change_personal_details.php'); die; } break; case 'EditAccountDetails':
<?php require_once 'common/config/config.inc.php'; require_once SOURCE_ROOT . 'classes/class.customer_login.php'; require_once SOURCE_ROOT . 'components/class.validation.inc.php'; $objCustomerLogin = new CustomerLogin(); if ($_POST['submit']) { if ($objCustomerLogin->doCustomerLogin($_POST)) { if ($_SESSION['sessCartDetails']) { if ($_POST['frmProcess'] == 'checkout') { header('location:check_out.php'); } else { header('location:edit_account_details.php?frmProcess=checkout'); } } else { header('location:view_profile.php'); } } else { header('location:login.php'); } } else { header('location:index.php'); } die;