[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/ -> affiliate_affiliate.php (source)

   1  <?php
   2  /*

   3  $Id: affiliate_affiliate.php 3 2006-05-27 04:59:07Z user $

   4  

   5    OSC-Affiliate

   6  

   7    osCMax Power E-Commerce

   8    http://oscdox.com

   9  

  10    Copyright 2006 osCMax

  11  

  12    Released under the GNU General Public License

  13  */
  14  
  15  // Most of this file is changed or moved to BTS - Basic Template System - format.

  16  // For adding in contribution or modification - parts of this file has been moved to: catalog\templates\fallback\contents\<filename>.tpl.php as a default (sub 'fallback' with your current template to see if there is a template specife change).

  17  //       catalog\templates\fallback\contents\<filename>.tpl.php as a default (sub 'fallback' with your current template to see if there is a template specife change).

  18  // (Sub 'fallback' with your current template to see if there is a template specific file.)

  19  
  20    require ('includes/application_top.php');
  21    if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
  22      $affiliate_username = tep_db_prepare_input($HTTP_POST_VARS['affiliate_username']);
  23      $affiliate_password = tep_db_prepare_input($HTTP_POST_VARS['affiliate_password']);
  24  
  25  // Check if username exists

  26      $check_affiliate_query = tep_db_query("select affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . tep_db_input($affiliate_username) . "'");
  27  
  28      if (!tep_db_num_rows($check_affiliate_query)) {
  29        $HTTP_GET_VARS['login'] = 'fail';
  30      } else {
  31        $check_affiliate = tep_db_fetch_array($check_affiliate_query);
  32  
  33  // Check that password is good

  34        if (!tep_validate_password($affiliate_password, $check_affiliate['affiliate_password'])) {
  35          $HTTP_GET_VARS['login'] = 'fail';
  36        } else {
  37          $affiliate_id = $check_affiliate['affiliate_id'];
  38          tep_session_register('affiliate_id');
  39          $date_now = date('Ymd');
  40          tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_date_of_last_logon = now(), affiliate_number_of_logons = affiliate_number_of_logons + 1 where affiliate_id = '" . $affiliate_id . "'");
  41          tep_redirect(tep_href_link(FILENAME_AFFILIATE_SUMMARY,'','SSL'));
  42        }
  43      }
  44    }
  45    require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE);
  46    $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
  47  
  48    $content = CONTENT_AFFILIATE;
  49    include (bts_select('main', $content_template)); // BTSv1.5

  50    require (DIR_WS_INCLUDES . 'application_bottom.php');
  51  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7