当前位置: 首页>>代码示例>>PHP>>正文


PHP zen_create_random_value函数代码示例

本文整理汇总了PHP中zen_create_random_value函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_create_random_value函数的具体用法?PHP zen_create_random_value怎么用?PHP zen_create_random_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了zen_create_random_value函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ipn_debug_email

function ipn_debug_email($message, $email_address = '', $always_send = false, $subjecttext = 'IPN DEBUG message')
{
    static $paypal_error_counter;
    static $paypal_instance_id;
    if ($email_address == '') {
        $email_address = defined('MODULE_PAYMENT_PAYPAL_DEBUG_EMAIL_ADDRESS') ? MODULE_PAYMENT_PAYPAL_DEBUG_EMAIL_ADDRESS : STORE_OWNER_EMAIL_ADDRESS;
    }
    if (!isset($paypal_error_counter)) {
        $paypal_error_counter = 0;
    }
    if (!isset($paypal_instance_id)) {
        $paypal_instance_id = time() . '_' . zen_create_random_value(4);
    }
    if (defined('MODULE_PAYMENT_PAYPALWPP_DEBUGGING') && MODULE_PAYMENT_PAYPALWPP_DEBUGGING == 'Log and Email' || defined('MODULE_PAYMENT_PAYPAL_IPN_DEBUG') && MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Log and Email' || $always_send) {
        $paypal_error_counter++;
        zen_mail(STORE_OWNER, $email_address, $subjecttext . ' (' . $paypal_instance_id . ') #' . $paypal_error_counter, $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML' => $message), 'debug');
    }
    if (defined('MODULE_PAYMENT_PAYPAL_IPN_DEBUG') && (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Log and Email' || MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Log File' || MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') || defined('MODULE_PAYMENT_PAYPALWPP_DEBUGGING') && (MODULE_PAYMENT_PAYPALWPP_DEBUGGING == 'Log File' || MODULE_PAYMENT_PAYPALWPP_DEBUGGING == 'Log and Email')) {
        ipn_add_error_log($message, $paypal_instance_id);
    }
}
开发者ID:happyxlq,项目名称:lt_svn,代码行数:21,代码来源:paypal_functions.php

示例2: ec_step2_finish


//.........这里部分代码省略.........
             $this->terminateEC('', false, FILENAME_CHECKOUT_PROCESS);
         } else {
             $this->terminateEC('', false, FILENAME_CHECKOUT_CONFIRMATION);
         }
     } else {
         // They're not logged in.  Create an account if necessary, and then log them in.
         // First, see if they're an existing customer, and log them in automatically
         // If Paypal didn't supply us an email address, something went wrong
         if (trim($paypal_ec_payer_info['payer_email']) == '') {
             $this->terminateEC(MODULE_PAYMENT_PAYPALWPP_INVALID_RESPONSE, true);
         }
         // attempt to obtain the user information using the payer_email from the info returned from PayPal, via email address
         $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_paypal_payerid, customers_paypal_ec\r\n              FROM " . TABLE_CUSTOMERS . "\r\n              WHERE customers_email_address = :emailAddress ";
         $sql = $db->bindVars($sql, ':emailAddress', $paypal_ec_payer_info['payer_email'], 'string');
         $check_customer = $db->Execute($sql);
         // debug
         $this->zcLog('ec_step2_finish - 4', 'Not logged in. Looking for account.' . "\n" . $sql . "\n" . print_r($check_customer, true));
         if (!$check_customer->EOF) {
             $acct_exists = true;
             // see if this was only a temp account -- if so, remove it
             if ($check_customer->fields['customers_paypal_ec'] == '1') {
                 // Delete the existing temporary account
                 $this->ec_delete_user($check_customer->fields['customers_id']);
                 $acct_exists = false;
                 // debug
                 $this->zcLog('ec_step2_finish - 5', 'Found temporary account - deleting it.');
             }
         }
         // Create an account, if the account does not exist
         if (!$acct_exists) {
             // debug
             $this->zcLog('ec_step2_finish - 6', 'No ZC account found for this customer. Creating new account.' . "\n" . '$this->new_acct_notify =' . $this->new_acct_notify);
             // Generate a random 8-char password
             $password = zen_create_random_value(8);
             $sql_data_array = array();
             // set the customer information in the array for the table insertion
             $sql_data_array = array('customers_firstname' => $paypal_ec_payer_info['payer_firstname'], 'customers_lastname' => $paypal_ec_payer_info['payer_lastname'], 'customers_email_address' => $paypal_ec_payer_info['payer_email'], 'customers_telephone' => $paypal_ec_payer_info['ship_phone'], 'customers_fax' => '', 'customers_gender' => $paypal_ec_payer_info['payer_gender'], 'customers_newsletter' => '0', 'customers_password' => zen_encrypt_password($password), 'customers_paypal_payerid' => $_SESSION['paypal_ec_payer_id']);
             // insert the data
             $result = zen_db_perform(TABLE_CUSTOMERS, $sql_data_array);
             // grab the customer_id (last insert id)
             $customer_id = $db->Insert_ID();
             // set the Guest customer ID -- for PWA purposes
             $_SESSION['customer_guest_id'] = $customer_id;
             // set the customer address information in the array for the table insertion
             $sql_data_array = array('customers_id' => $customer_id, 'entry_gender' => $paypal_ec_payer_info['payer_gender'], 'entry_firstname' => $paypal_ec_payer_info['payer_firstname'], 'entry_lastname' => $paypal_ec_payer_info['payer_lastname'], 'entry_street_address' => $paypal_ec_payer_info['ship_street_1'], 'entry_suburb' => $paypal_ec_payer_info['ship_street_2'], 'entry_city' => $paypal_ec_payer_info['ship_city'], 'entry_zone_id' => $state_id, 'entry_postcode' => $paypal_ec_payer_info['ship_postal_code'], 'entry_country_id' => $country_id);
             if ($state_id > 0) {
                 $sql_data_array['entry_zone_id'] = $state_id;
                 $sql_data_array['entry_state'] = '';
             } else {
                 $sql_data_array['entry_zone_id'] = 0;
                 $sql_data_array['entry_state'] = $paypal_ec_payer_info['ship_state'];
             }
             // insert the data
             zen_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
             // grab the address_id (last insert id)
             $address_id = $db->Insert_ID();
             // set the address id lookup for the customer
             $sql = "UPDATE " . TABLE_CUSTOMERS . "\r\n                SET customers_default_address_id = :addrID\r\n                WHERE customers_id = :custID";
             $sql = $db->bindVars($sql, ':addrID', $address_id, 'integer');
             $sql = $db->bindVars($sql, ':custID', $customer_id, 'integer');
             $db->Execute($sql);
             // insert the new customer_id into the customers info table for consistency
             $sql = "INSERT INTO " . TABLE_CUSTOMERS_INFO . "\r\n                       (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created)\r\n                VALUES (:custID, 0, now())";
             $sql = $db->bindVars($sql, ':custID', $customer_id, 'integer');
             $db->Execute($sql);
             // send Welcome Email if appropriate
开发者ID:BGCX067,项目名称:ez-commerce-svn-to-git,代码行数:67,代码来源:paypalwpp.php

示例3: generate_cart_id

 /**
  * Method to generate a cart ID
  *
  * @param length of ID to generate
  * @return string cart ID
  */
 function generate_cart_id($length = 5)
 {
     return zen_create_random_value($length, 'digits');
 }
开发者ID:jeking928,项目名称:Dual-Pricing-2.1.6,代码行数:10,代码来源:shopping_cart.php

示例4: log

 function log($message, $token = '')
 {
     static $tokenHash;
     if ($tokenHash == '') {
         $tokenHash = '_' . zen_create_random_value(4);
     }
     if ($token == '') {
         $token = $_SESSION['paypal_ec_token'];
     }
     if ($token == '') {
         $token = time();
     }
     $token .= $tokenHash;
     $file = $this->_logDir . '/' . 'Paypal_CURL_' . $token . '.log';
     if ($fp = @fopen($file, 'a')) {
         fwrite($fp, $message . "\n\n");
         fclose($fp);
     }
 }
开发者ID:dalinhuang,项目名称:kennbikyou,代码行数:19,代码来源:paypal_curl.php

示例5: _debugActions

 /**
  * Used to do any debug logging / tracking / storage as required.
  */
 function _debugActions($response, $order_time = '', $sessID = '')
 {
     global $db;
     if ($order_time == '') {
         $order_time = date("F j, Y, g:i a");
     }
     // convert output to 1-based array for easier understanding:
     $resp_output = $response;
     array_unshift($resp_output, 'Response from gateway' . (isset($response['ErrorDetails']) ? ': ' . $response['ErrorDetails'] : ''));
     // DEBUG LOGGING
     $errorMessage = date('M-d-Y h:i:s') . "\n=================================\n\n" . ($this->commError != '' ? 'Comm results: ' . $this->commErrNo . ' ' . $this->commError . "\n\n" : '') . 'Response Code: ' . $response[0] . ".\nResponse Text: " . $response[3] . "\n\n" . 'Sending to Authorizenet: ' . print_r($this->reportable_submit_data, true) . "\n\n" . 'Results Received back from Authorizenet: ' . print_r($resp_output, true) . "\n\n" . 'CURL communication info: ' . print_r($this->commInfo, true) . "\n";
     if (CURL_PROXY_REQUIRED == 'True') {
         $errorMessage .= 'Using CURL Proxy: [' . CURL_PROXY_SERVER_DETAILS . ']  with Proxy Tunnel: ' . ($this->proxy_tunnel_flag ? 'On' : 'Off') . "\n";
     }
     $errorMessage .= "\nRAW data received: \n" . $this->authorize . "\n\n";
     if (strstr(MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING, 'Log') || strstr(MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING, 'All') || defined('AUTHORIZENET_DEVELOPER_MODE') && in_array(AUTHORIZENET_DEVELOPER_MODE, array('on', 'certify'))) {
         $key = $response[6] . '_' . time() . '_' . zen_create_random_value(4);
         $file = $this->_logDir . '/' . 'AuthNetECheck_Debug_' . $key . '.log';
         if ($fp = @fopen($file, 'a')) {
             fwrite($fp, $errorMessage);
             fclose($fp);
         }
     }
     if ($response[0] != '1' && stristr(MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING, 'Alerts') || strstr(MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING, 'Email')) {
         zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, 'Authorizenet-eCheck Alert ' . $response[7] . ' ' . date('M-d-Y h:i:s') . ' ' . $response[6], $errorMessage, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML' => nl2br($errorMessage)), 'debug');
     }
     // DATABASE SECTION
     // Insert the send and receive response data into the database.
     // This can be used for testing or for implementation in other applications
     // This can be turned on and off if the Admin Section
     if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_STORE_DATA == 'True') {
         $db_response_text = $response[3] . ($this->commError != '' ? ' - Comm results: ' . $this->commErrNo . ' ' . $this->commError : '');
         $db_response_text .= $response[0] == 2 && $response[2] == 4 ? ' NOTICE: Card should be picked up - possibly stolen ' : '';
         $db_response_text .= $response[0] == 3 && $response[2] == 11 ? ' DUPLICATE TRANSACTION ATTEMPT ' : '';
         // Insert the data into the database
         $sql = "insert into " . TABLE_AUTHORIZENET . "  (id, customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values (NULL, :custID, :orderID, :respCode, :respText, :authType, :transID, :sentData, :recvData, :orderTime, :sessID )";
         $sql = $db->bindVars($sql, ':custID', $_SESSION['customer_id'], 'integer');
         $sql = $db->bindVars($sql, ':orderID', preg_replace('/[^0-9]/', '', $response[7]), 'integer');
         $sql = $db->bindVars($sql, ':respCode', $response[0], 'integer');
         $sql = $db->bindVars($sql, ':respText', $db_response_text, 'string');
         $sql = $db->bindVars($sql, ':authType', $response[11], 'string');
         $sql = $db->bindVars($sql, ':transID', $this->transaction_id, 'string');
         $sql = $db->bindVars($sql, ':sentData', print_r($this->reportable_submit_data, true), 'string');
         $sql = $db->bindVars($sql, ':recvData', print_r($response, true), 'string');
         $sql = $db->bindVars($sql, ':orderTime', $order_time, 'string');
         $sql = $db->bindVars($sql, ':sessID', $sessID, 'string');
         $db->Execute($sql);
     }
 }
开发者ID:R-Future,项目名称:zencart,代码行数:52,代码来源:authorizenet_echeck.php

示例6: _log

 function _log($msg, $suffix = '')
 {
     static $key;
     if (!isset($key) || $key == '') {
         $key = time() . '_' . zen_create_random_value(4);
     }
     $file = $this->_logDir . '/' . 'Linkpoint_Debug_' . $suffix . '_' . $key . '.log';
     if ($fp = @fopen($file, 'a')) {
         @fwrite($fp, $msg);
         @fclose($fp);
     }
 }
开发者ID:kirkbauer2,项目名称:kirkzc,代码行数:12,代码来源:linkpoint_api.php

示例7: zen_get_module_directory

 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
// This should be first line of the script:
$zco_notifier->notify('NOTIFY_HEADER_START_PASSWORD_FORGOTTEN');
require DIR_WS_MODULES . zen_get_module_directory('require_languages.php');
// remove from snapshot
$_SESSION['navigation']->remove_current_page();
if (isset($_GET['action']) && $_GET['action'] == 'process') {
    $email_address = zen_db_prepare_input($_POST['email_address']);
    $check_customer_query = "SELECT customers_firstname, customers_lastname, customers_password, customers_id \r\n                           FROM " . TABLE_CUSTOMERS . "\r\n                           WHERE customers_email_address = :emailAddress";
    $check_customer_query = $db->bindVars($check_customer_query, ':emailAddress', $email_address, 'string');
    $check_customer = $db->Execute($check_customer_query);
    if ($check_customer->RecordCount() > 0) {
        $new_password = zen_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
        $crypted_password = zen_encrypt_password($new_password);
        $sql = "UPDATE " . TABLE_CUSTOMERS . "\r\n            SET customers_password = :password\r\n            WHERE customers_id = :customersID";
        $sql = $db->bindVars($sql, ':password', $crypted_password, 'string');
        $sql = $db->bindVars($sql, ':customersID', $check_customer->fields['customers_id'], 'integer');
        $db->Execute($sql);
        $html_msg['EMAIL_CUSTOMERS_NAME'] = $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
        $html_msg['EMAIL_MESSAGE_HTML'] = sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password);
        // send the email
        zen_mail($check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'], $email_address, EMAIL_PASSWORD_REMINDER_SUBJECT, sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password), STORE_NAME, EMAIL_FROM, $html_msg, 'password_forgotten');
        $messageStack->add_session('login', SUCCESS_PASSWORD_SENT, 'success');
        zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    } else {
        $messageStack->add('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND);
    }
}
开发者ID:dalinhuang,项目名称:kakayaga,代码行数:31,代码来源:header_php.php

示例8: email_templates_make_new_passord

function email_templates_make_new_passord($customers_id, $email_address)
{
    global $db;
    $new_password = zen_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
    $crypted_password = zen_encrypt_password($new_password);
    $sql = "UPDATE " . TABLE_CUSTOMERS . "\n          SET customers_password = :password\n          WHERE customers_id = :customersID";
    $sql = $db->bindVars($sql, ':password', $crypted_password, 'string');
    $sql = $db->bindVars($sql, ':customersID', $customers_id, 'integer');
    $db->Execute($sql);
    return $new_password;
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:11,代码来源:functions.php

示例9: logDetails

 function logDetails($details, $location = '', $fname = '')
 {
     global $current_page;
     if ($_SESSION['logfilename'] == '') {
         $_SESSION['logfilename'] = $fname == '' ? date('M-d-Y_h-i-s-') . zen_create_random_value(6) : $fname;
     }
     $location = $location == '' ? $current_page : $location;
     if ($fp = @fopen(DEBUG_LOG_FOLDER . '/zcInstallLog_' . $_SESSION['logfilename'] . '.log', 'a')) {
         fwrite($fp, '---------------' . "\n" . date('M d Y G:i') . ' -- ' . $location . "\n" . $details . "\n\n");
         fclose($fp);
     }
 }
开发者ID:promoweb,项目名称:zc-v1-series,代码行数:12,代码来源:installer.php

示例10: zcLog

 /**
  * Debug Logging support
  */
 function zcLog($stage, $message)
 {
     static $tokenHash;
     if ($tokenHash == '') {
         $tokenHash = '_' . zen_create_random_value(4);
     }
     if (MODULE_PAYMENT_PAYPALDP_DEBUGGING == 'Log and Email' || MODULE_PAYMENT_PAYPALDP_DEBUGGING == 'Log File') {
         $token = isset($_SESSION['paypal_ec_token']) ? $_SESSION['paypal_ec_token'] : preg_replace('/[^0-9.A-Z\\-]/', '', $_GET['token']);
         $token = $token == '' ? date('m-d-Y-h-i') : $token;
         // or time()
         $token .= $tokenHash;
         $file = $this->_logDir . '/' . $this->code . '_Paypal_Action_' . $token . '.log';
         if (defined('PAYPAL_DEV_MODE') && PAYPAL_DEV_MODE == 'true') {
             $file = $this->_logDir . '/' . $this->code . '_Paypal_Debug_' . $token . '.log';
         }
         $fp = @fopen($file, 'a');
         @fwrite($fp, date('M-d-Y h:i:s') . "\n" . $stage . "\n" . $message . "\n=================================\n\n");
         @fclose($fp);
     }
     $this->_doDebug($stage, $message, false);
 }
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:24,代码来源:paypaldp.php

示例11: zen_create_random_value

     $firstname = No_Account;
     $lastname = No_Account;
     $nick = No_Account;
     $street_address = No_Account;
     $suburb = No_Account;
     $city = No_Account;
     $postcode = 33333;
     $dob = '0001-01-01 00:00:00';
     $state = Florida;
     $country = 223;
     $telephone = 5555551212;
     $fax = 5555551212;
     $customers_referrals = No_Account;
     $gender = m;
 }
 $password = zen_create_random_value(15, 'mixed');
 if ($error == true) {
     // hook notifier class
     $zco_notifier->notify('NOTIFY_FAILURE_DURING_NO_ACCOUNT');
 } else {
     $_SESSION['COWOA'] = true;
     $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_nick' => $nick, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => (int) $newsletter, 'customers_email_format' => $email_format, 'customers_default_address_id' => 0, 'customers_password' => zen_encrypt_password($password), 'COWOA_account' => 1, 'customers_authorization' => (int) CUSTOMERS_APPROVAL_AUTHORIZATION);
     if (CUSTOMERS_REFERRAL_STATUS == '2' and $customers_referral != '') {
         $sql_data_array['customers_referral'] = $customers_referral;
     }
     if (ACCOUNT_GENDER == 'true') {
         $sql_data_array['customers_gender'] = $gender;
     }
     if (ACCOUNT_DOB == 'true') {
         $sql_data_array['customers_dob'] = empty($_POST['dob']) || $dob_entered == '0001-01-01 00:00:00' ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_date_raw($_POST['dob']);
     }
开发者ID:Southern-Exposure-Seed-Exchange,项目名称:Zencart-Bootstrap-Theme,代码行数:31,代码来源:no_account.php

示例12: _debugActions

 /**
  * Used to do any debug logging / tracking / storage as required.
  */
 function _debugActions($response, $mode, $order_time = '', $sessID = '')
 {
     global $db, $messageStack, $insert_id;
     if ($order_time == '') {
         $order_time = date("F j, Y, g:i a");
     }
     $response['url'] = $this->form_action_url;
     $this->reportable_submit_data['url'] = $this->form_action_url;
     $errorMessage = date('M-d-Y h:i:s') . "\n=================================\n\n";
     if ($mode == 'Submit-Data') {
         $errorMessage .= 'Sent to Authorizenet: ' . print_r($this->reportable_submit_data, true) . "\n\n";
     }
     if ($mode == 'Response-Data') {
         $errorMessage .= 'Response Code: ' . $response['x_response_code'] . ".\nResponse Text: " . $response['x_response_reason_text'] . "\n\n" . ($response['x_response_code'] == 2 && $response['x_response_reason_code'] == 4 ? ' NOTICE: Card should be picked up - possibly stolen ' : '') . ($response['x_response_code'] == 3 && $response['x_response_reason_code'] == 11 ? ' DUPLICATE TRANSACTION ATTEMPT ' : '') . 'Results Received back from Authorizenet: ' . print_r($response, true) . "\n\n";
     }
     // store log file if log mode enabled
     if (stristr(MODULE_PAYMENT_AUTHORIZENET_DEBUGGING, 'Log') || strstr(MODULE_PAYMENT_AUTHORIZENET_DEBUGGING, 'All') || defined('AUTHORIZENET_DEVELOPER_MODE') && in_array(AUTHORIZENET_DEVELOPER_MODE, array('on', 'certify'))) {
         $key = ($response['x_trans_id'] != '' ? $response['x_trans_id'] . '_' : '') . time() . '_' . zen_create_random_value(4);
         $file = $this->_logDir . '/' . 'SIM_Debug_' . $key . '.log';
         $fp = @fopen($file, 'a');
         @fwrite($fp, $errorMessage);
         @fclose($fp);
     }
     // send email alerts only if in alert mode or if email specifically requested as logging mode
     if (isset($response['x_response_code']) && $response['x_response_code'] != '1' && stristr(MODULE_PAYMENT_AUTHORIZENET_DEBUGGING, 'Alerts') || stristr(MODULE_PAYMENT_AUTHORIZENET_DEBUGGING, 'Email')) {
         zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, 'Authorizenet-SIM Alert ' . $response['x_invoice_num'] . ' ' . date('M-d-Y h:i:s') . ' ' . $response['x_trans_id'], $errorMessage, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML' => nl2br($errorMessage)), 'debug');
     }
     // DATABASE SECTION
     // Insert the send and receive response data into the database.
     // This can be used for testing or for implementation in other applications
     // This can be turned on and off if the Admin Section
     if (MODULE_PAYMENT_AUTHORIZENET_STORE_DATA == 'True' && $mode == 'Response-Data') {
         $db_response_text = $response['x_response_reason_text'];
         $db_response_text .= $response['x_response_code'] == 2 && $response['x_response_reason_code'] == 4 ? ' NOTICE: Card should be picked up - possibly stolen ' : '';
         $db_response_text .= $response['x_response_code'] == 3 && $response['x_response_reason_code'] == 11 ? ' DUPLICATE TRANSACTION ATTEMPT ' : '';
         // Insert the data into the database
         $sql = "insert into " . TABLE_AUTHORIZENET . "  (id, customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values (NULL, :custID, :orderID, :respCode, :respText, :authType, :transID, :sentData, :recvData, :orderTime, :sessID )";
         $sql = $db->bindVars($sql, ':custID', $_SESSION['customer_id'], 'integer');
         $sql = $db->bindVars($sql, ':orderID', preg_replace('/[^0-9]/', '', $insert_id), 'integer');
         $sql = $db->bindVars($sql, ':respCode', $response['x_response_code'], 'integer');
         $sql = $db->bindVars($sql, ':respText', $db_response_text, 'string');
         $sql = $db->bindVars($sql, ':authType', $response['x_type'], 'string');
         $sql = $db->bindVars($sql, ':transID', $response['x_trans_id'], 'string');
         $sql = $db->bindVars($sql, ':sentData', print_r($this->reportable_submit_data, true), 'string');
         $sql = $db->bindVars($sql, ':recvData', print_r($response, true), 'string');
         $sql = $db->bindVars($sql, ':orderTime', $order_time, 'string');
         $sql = $db->bindVars($sql, ':sessID', $sessID, 'string');
         $db->Execute($sql);
     }
 }
开发者ID:dalinhuang,项目名称:yijinhuanxiang,代码行数:53,代码来源:authorizenet.php

示例13: errorLog

 /**
  * @param $errorMessages
  */
 protected function errorLog($errorMessages = array())
 {
     $moduleSetting = 'MODULE_PAYMENT_' . strtoupper($this->code) . '_DEBUGGING';
     if (constant($moduleSetting) == 'Off') {
         return;
     }
     $logDir = defined('DIR_FS_LOGS') ? DIR_FS_LOGS : DIR_FS_SQL_CACHE;
     $message = date('M-d-Y h:i:s') . "\n=================================\n\n";
     foreach ($errorMessages as $errorMessage) {
         $message .= $errorMessage['title'] . "\n\n";
         $message .= $errorMessage['content'] . "\n\n";
         $message .= "=================================\n\n";
     }
     $file = $logDir . '/' . 'Sagepay_Debug_' . time() . '_' . zen_create_random_value(4) . '.log';
     if ($fp = @fopen($file, 'a')) {
         fwrite($fp, $message);
         fclose($fp);
     }
     if (constant($moduleSetting) !== 'Log and Email') {
         return;
     }
     zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, 'Sagepay Form Alert ' . date('M-d-Y h:i:s'), $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML' => nl2br($message)), 'debug');
 }
开发者ID:zencart,项目名称:sagepay,代码行数:26,代码来源:AbstractSagepayAPI.php

示例14: sleep

    $result = $db->Execute($sql);
    if (!($admin_email == $result->fields['admin_email'])) {
        $error = true;
        $email_message = MESSAGE_PASSWORD_SENT;
    }
    // BEGIN SLAM PREVENTION
    if ($error == TRUE && $_POST['admin_email'] != '') {
        if (!isset($_SESSION['login_attempt'])) {
            $_SESSION['login_attempt'] = 0;
        }
        $_SESSION['login_attempt']++;
        sleep(3 * $_SESSION['login_attempt']);
    }
    // END SLAM PREVENTION
    if ($error == false) {
        $new_password = zen_create_random_value((int) ADMIN_PASSWORD_MIN_LENGTH < 7 ? 7 : (int) ADMIN_PASSWORD_MIN_LENGTH);
        $resetToken = time() + ADMIN_PWD_TOKEN_DURATION . '}' . zen_encrypt_password($new_password);
        $sql = "update " . TABLE_ADMIN . " set reset_token = :token: where admin_id = :admID: ";
        $sql = $db->bindVars($sql, ':token:', $resetToken, 'string');
        $sql = $db->bindVars($sql, ':admID:', $result->fields['admin_id'], 'string');
        $db->Execute($sql);
        $html_msg['EMAIL_CUSTOMERS_NAME'] = $result->fields['admin_name'];
        $html_msg['EMAIL_MESSAGE_HTML'] = sprintf(TEXT_EMAIL_MESSAGE_PWD_RESET, $_SERVER['REMOTE_ADDR'], $new_password);
        zen_mail($result->fields['admin_name'], $result->fields['admin_email'], TEXT_EMAIL_SUBJECT_PWD_RESET, sprintf(TEXT_EMAIL_MESSAGE_PWD_RESET, $_SERVER['REMOTE_ADDR'], $new_password), STORE_NAME, EMAIL_FROM, $html_msg, 'password_forgotten_admin');
        $email_message = MESSAGE_PASSWORD_SENT;
    }
}
?>
<!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" <?php 
echo HTML_PARAMS;
开发者ID:nkdyh,项目名称:zencart-1.5,代码行数:31,代码来源:password_forgotten.php


注:本文中的zen_create_random_value函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。