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


PHP mslib_fe::getUser方法代码示例

本文整理汇总了PHP中mslib_fe::getUser方法的典型用法代码示例。如果您正苦于以下问题:PHP mslib_fe::getUser方法的具体用法?PHP mslib_fe::getUser怎么用?PHP mslib_fe::getUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mslib_fe的用法示例。


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

示例1: foreach

 $requiredCols[] = 'title';
 $requiredCols[] = 'www';
 foreach ($requiredCols as $requiredCol) {
     if (!isset($user[$requiredCol])) {
         $user[$requiredCol] = '';
     }
 }
 if (!isset($user['tx_multishop_source_id']) && $user['uid']) {
     $user['tx_multishop_source_id'] = $user['uid'];
 }
 $user = mslib_befe::rmNullValuedKeys($user);
 $query = $GLOBALS['TYPO3_DB']->INSERTquery('fe_users', $user);
 $res = $GLOBALS['TYPO3_DB']->sql_query($query);
 $uid = $GLOBALS['TYPO3_DB']->sql_insert_id();
 if ($uid) {
     $user_check = mslib_fe::getUser($uid);
     $name = array();
     if ($user['company'] != '') {
         $name[] = $user['company'];
     }
     if ($user['name'] != '' and !in_array($user['name'], $name)) {
         $name[] = $user['name'];
     }
     if ($user['email'] != '' and !in_array($user['email'], $name)) {
         $name[] = 'email: ' . $user['email'];
     }
     $content .= implode(" / ", $name) . ' has been added.<br />';
     // custom hook that can be controlled by third-party
     // plugin
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_customer_import.php']['msCustomerImporterInsertUserPostHook'])) {
         $params = array('user' => &$user, 'item' => &$item, 'user_check' => &$user_check, 'prefix_source_name' => $this->post['prefix_source_name']);
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:admin_customer_import.php

示例2: round

 }
 if ($row['is_checkout']) {
     // lets find out how long the user did to finish the checkout
     $str2 = "SELECT crdate FROM tx_multishop_cart_contents c where c.session_id='" . $row['session_id'] . "' and c.id < '" . $row['id'] . "'  and page_uid='" . $this->shop_pid . "' order by c.id asc limit 1";
     $qry2 = $GLOBALS['TYPO3_DB']->sql_query($str2);
     $row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry2);
     $time = $row['crdate'] - $row2['crdate'];
     if ($time >= 60) {
         $time_label = round($time / 60) . ' minutes';
     } else {
         $time_label = $time . ' seconds';
     }
     $tr_rows[] = '<th class="text-right" width="100">' . $this->pi_getLL('time_needed_to_finish_checkout') . '</th><td>' . $time_label . '</td>';
 } else {
     if ($row['customer_id']) {
         $user = mslib_fe::getUser($row['customer_id']);
         $cart['user'] = $user;
     }
 }
 if ($cart['user']['username']) {
     $tr_rows[] = '<th class="text-right" width="100">' . $this->pi_getLL('username') . '</th><td>' . $cart['user']['username'] . '</td>';
 }
 if ($cart['user']['first_name']) {
     $tr_rows[] = '<th class="text-right" width="100">' . $this->pi_getLL('name') . '</th><td>' . $cart['user']['first_name'] . ' ' . $cart['user']['middle_name'] . ' ' . $cart['user']['last_name'] . '</td>';
 }
 if ($cart['user']['company']) {
     $tr_rows[] = '<th class="text-right" width="100">' . $this->pi_getLL('company') . '</th><td>' . $cart['user']['company'] . '</td>';
 }
 if ($cart['user']['telephone']) {
     $tr_rows[] = '<th class="text-right" width="100">' . $this->pi_getLL('telephone') . '</th><td>' . $cart['user']['telephone'] . '</td>';
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:admin_shopping_cart_stats.php

示例3: loginAsUser

 public function loginAsUser($uid, $section = '')
 {
     if (!is_numeric($uid)) {
         return false;
     }
     $user = mslib_fe::getUser($uid);
     if ($user['uid']) {
         $GLOBALS['TSFE']->fe_user->logoff();
         $GLOBALS['TSFE']->loginUser = 0;
         $fe_user = $GLOBALS['TSFE']->fe_user;
         $fe_user->createUserSession(array('uid' => $uid));
         $fe_user->user = $fe_user->getRawUserByUid($uid);
         $fe_user->fetchGroupData();
         $GLOBALS['TSFE']->loginUser = 1;
         /*
          * Old style, dont use this anymore. use above approach which uses the $uid
         // auto login the user
         $loginData=array(
         	'uname'=>$user['username'],
         	//usernmae
         	'uident'=>$user['password'],
         	//password
         	'status'=>'login'
         );
         $GLOBALS['TSFE']->fe_user->checkPid=0; //do not use a particular pid
         $info=$GLOBALS['TSFE']->fe_user->getAuthInfoArray();
         $user=$GLOBALS['TSFE']->fe_user->fetchUserRecord($info['db_user'], $loginData['uname']);
         $GLOBALS['TSFE']->fe_user->createUserSession($user);
         */
         // auto login the user
         if (is_numeric($this->conf['login_as_customer_target_pid'])) {
             $targetPid = $this->conf['login_as_customer_target_pid'];
         } else {
             $targetPid = $this->shop_pid;
         }
         $redirect_url = $this->FULL_HTTP_URL . mslib_fe::typolink($targetPid);
         //hook to let other plugins further manipulate the redirect link
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['loginAsUserRedirectLinkPreProc'])) {
             $params = array('user' => $user, 'redirect_url' => &$redirect_url, 'section' => &$section);
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['loginAsUserRedirectLinkPreProc'] as $funcRef) {
                 \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
             }
         }
         if ($redirect_url) {
             header("Location: " . $redirect_url);
         }
         exit;
     }
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:49,代码来源:class.mslib_befe.php

示例4: die

<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
//add order
if ($this->post['proceed_order']) {
    $unique_id = md5($this->post['first_name'] . $this->post['last_name'] . $this->post['company'] . $this->post['tx_multishop_pi1']['telephone']);
    if ($this->post['customer_id']) {
        $user = mslib_fe::getUser($this->post['customer_id']);
        if ($user['uid']) {
            $customer_id = $user['uid'];
            $this->post = array_merge($this->post, $user);
            $this->post['tx_multishop_pi1']['telephone'] = $this->post['telephone'];
        }
    } else {
        $str = "SELECT uid from fe_users where (username='" . addslashes($unique_id) . "')";
        $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
        if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry) > 0) {
            // use current account
            $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
            $customer_id = $row['uid'];
        }
    }
    if (!$customer_id) {
        $insertArray = array();
        $insertArray['page_uid'] = $this->shop_pid;
        $insertArray['company'] = $this->post['company'];
        $insertArray['name'] = $this->post['first_name'] . ' ' . $this->post['middle_name'] . ' ' . $this->post['last_name'];
        $insertArray['name'] = preg_replace('/\\s+/', ' ', $insertArray['name']);
        $insertArray['first_name'] = $this->post['first_name'];
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:admin_processed_manual_order.php

示例5: die

<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
if ($this->ADMIN_USER) {
    $jsonData = array();
    if (is_numeric($this->post['tx_multishop_pi1']['customer_id'])) {
        $customer = mslib_fe::getUser($this->post['tx_multishop_pi1']['customer_id']);
        if ($customer['uid']) {
            $actionButtons = array();
            if ($customer['email']) {
                $actionLink = 'mailto:' . $customer['email'];
                $actionButtons['email'] = '<a href="' . $actionLink . '" class="btn btn-xs btn-default"><i class="fa fa-envelope-o"></i> ' . $this->pi_getLL('email') . '</a>';
            }
            if ($customer['telephone']) {
                $actionLink = 'callto:' . $customer['telephone'];
                $actionButtons['call'] = '<a href="' . $actionLink . '" class="btn btn-xs btn-default"><i class="fa fa-phone-square"></i> ' . $this->pi_getLL('call') . '</a>';
            }
            $address = array();
            $address[] = rawurlencode($customer['address']);
            $address[] = rawurlencode($customer['zip']);
            $address[] = rawurlencode($customer['city']);
            $address[] = rawurlencode($customer['country']);
            $actionLink = 'http://maps.google.com/maps?daddr=' . implode('+', $address);
            $actionButtons['travel_guide'] = '<a href="' . $actionLink . '" rel="nofollow" target="_blank" class="btn btn-xs btn-default"><i class="fa fa-map-marker"></i> ' . $this->pi_getLL('travel_guide') . '</a>';
            $jsonData['html'] = '';
            if ($customer['company']) {
                $jsonData['html'] .= '<h1>' . $customer['company'] . '</h1>';
            }
            if ($customer['name']) {
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:get_admin_customers_listing_details.php

示例6: sendCreateAccountConfirmationLetter

 function sendCreateAccountConfirmationLetter($customer_id, $password = '')
 {
     if (!is_numeric($customer_id)) {
         return false;
     }
     $page = mslib_fe::getCMScontent('email_create_account_confirmation', $GLOBALS['TSFE']->sys_language_uid);
     if ($page[0]['content']) {
         $newCustomer = mslib_fe::getUser($customer_id);
         // loading the email confirmation letter eof
         // replacing the variables with dynamic values
         $array1 = array();
         $array2 = array();
         $array1[] = '###GENDER_SALUTATION###';
         $array2[] = mslib_fe::genderSalutation($this->post['gender']);
         $array1[] = '###BILLING_COMPANY###';
         $array2[] = $newCustomer['company'];
         $array1[] = '###FULL_NAME###';
         $array2[] = $newCustomer['name'];
         $array1[] = '###BILLING_NAME###';
         $array2[] = $newCustomer['name'];
         $array1[] = '###BILLING_FIRST_NAME###';
         $array2[] = $newCustomer['first_name'];
         $array1[] = '###BILLING_LAST_NAME###';
         $last_name = $newCustomer['last_name'];
         if ($newCustomer['middle_name']) {
             $last_name = $newCustomer['middle_name'] . ' ' . $last_name;
         }
         $array2[] = $last_name;
         $array1[] = '###CUSTOMER_EMAIL###';
         $array2[] = $newCustomer['email'];
         $array1[] = '###BILLING_EMAIL###';
         $array2[] = $newCustomer['email'];
         $array1[] = '###BILLING_ADDRESS###';
         $array2[] = $newCustomer['address'];
         $array1[] = '###BILLING_TELEPHONE###';
         $array2[] = $newCustomer['telephone'];
         $array1[] = '###BILLING_MOBILE###';
         $array2[] = $newCustomer['mobile'];
         $array1[] = '###LONG_DATE###';
         // ie woensdag 23 juni, 2010
         $long_date = strftime($this->pi_getLL('full_date_format'));
         $array2[] = $long_date;
         $array1[] = '###CURRENT_DATE_LONG###';
         // ie woensdag 23 juni, 2010
         $long_date = strftime($this->pi_getLL('full_date_format'));
         $array2[] = $long_date;
         $array1[] = '###STORE_NAME###';
         $array2[] = $this->ms['MODULES']['STORE_NAME'];
         $array1[] = '###CUSTOMER_ID###';
         $array2[] = $customer_id;
         $link = $this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=confirm_create_account&tx_multishop_pi1[hash]=' . $newCustomer['tx_multishop_code']);
         $array1[] = '###LINK###';
         $array2[] = '<a href="' . $link . '" rel="noreferrer">' . htmlspecialchars($this->pi_getLL('click_here_to_confirm_registration')) . '</a>';
         $array1[] = '###CONFIRMATION_LINK###';
         $array2[] = '<a href="' . $link . '" rel="noreferrer">' . htmlspecialchars($this->pi_getLL('click_here_to_confirm_registration')) . '</a>';
         $array1[] = '###USERNAME###';
         $array2[] = $newCustomer['email'];
         $array1[] = '###PASSWORD###';
         $array2[] = $password;
         if ($page[0]['content']) {
             $page[0]['content'] = str_replace($array1, $array2, $page[0]['content']);
         }
         if ($page[0]['name']) {
             $page[0]['name'] = str_replace($array1, $array2, $page[0]['name']);
         }
         $user = array();
         $user['name'] = $newCustomer['first_name'];
         $user['email'] = $newCustomer['email'];
         mslib_fe::mailUser($user, $page[0]['name'], $page[0]['content'], $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME']);
         return true;
     }
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:72,代码来源:class.mslib_fe.php

示例7: convertCartToOrder

 function convertCartToOrder($cart)
 {
     // var for total amount
     $tax_separation = array();
     $total_price = 0;
     $order = array();
     $address = $cart['user'];
     // check for NULL, convert to empty string - typo3 v6.x related bug
     if (is_array($address) && count($address)) {
         foreach ($address as $key => $val) {
             if ($val == null || $val == null) {
                 $address[$key] = '';
             }
         }
     }
     // if store country is different from customer country and user provided valid VAT id, change VAT rate to zero
     $this->ms['MODULES']['DISABLE_VAT_RATE'] = 0;
     if ($this->ms['MODULES']['DISABLE_VAT_FOR_FOREIGN_CUSTOMERS_WITH_COMPANY_VAT_ID'] and $address['tx_multishop_vat_id']) {
         if (strtolower($address['country']) != strtolower($this->tta_shop_info['country'])) {
             $this->ms['MODULES']['DISABLE_VAT_RATE'] = 1;
         }
     }
     /*
      * always use *_tax and *_total_tax_rate, unless need different calc for country/region
      * WARNING: *_country_* and *_region_* not always have value, depends on the tax ruleset
      * -----------------------------------------------------------------------------------------
      */
     $orders_tax['shipping_tax'] = (string) $address['shipping_tax'];
     $orders_tax['shipping_country_tax'] = (string) $address['shipping_country_tax'];
     $orders_tax['shipping_region_tax'] = (string) $address['shipping_region_tax'];
     $orders_tax['shipping_total_tax_rate'] = (string) $address['shipping_total_tax_rate'];
     $orders_tax['shipping_country_tax_rate'] = (string) $address['shipping_country_tax_rate'];
     $orders_tax['shipping_region_tax_rate'] = (string) $address['shipping_region_tax_rate'];
     if ($this->ms['MODULES']['DISABLE_VAT_RATE']) {
         $orders_tax['shipping_tax'] = 0;
         $orders_tax['shipping_country_tax'] = 0;
         $orders_tax['shipping_region_tax'] = 0;
         $orders_tax['shipping_total_tax_rate'] = 0;
         $orders_tax['shipping_country_tax_rate'] = 0;
         $orders_tax['shipping_region_tax_rate'] = 0;
     }
     // ----------------------------------------------------------------------------------------
     $orders_tax['payment_tax'] = (string) $address['payment_tax'];
     $orders_tax['payment_country_tax'] = (string) $address['payment_country_tax'];
     $orders_tax['payment_region_tax'] = (string) $address['payment_region_tax'];
     $orders_tax['payment_total_tax_rate'] = (string) $address['payment_total_tax_rate'];
     $orders_tax['payment_country_tax_rate'] = (string) $address['payment_country_tax_rate'];
     $orders_tax['payment_region_tax_rate'] = (string) $address['payment_region_tax_rate'];
     if ($this->ms['MODULES']['DISABLE_VAT_RATE']) {
         $orders_tax['payment_tax'] = 0;
         $orders_tax['payment_country_tax'] = 0;
         $orders_tax['payment_region_tax'] = 0;
         $orders_tax['payment_total_tax_rate'] = 0;
         $orders_tax['payment_country_tax_rate'] = 0;
         $orders_tax['payment_region_tax_rate'] = 0;
     }
     // ----------------------------------------------------------------------------------------
     $grand_total = array();
     $grand_total['shipping_tax'] = $orders_tax['shipping_tax'];
     $grand_total['payment_tax'] = $orders_tax['payment_tax'];
     $tax_separation[$orders_tax['shipping_total_tax_rate'] * 100]['shipping_tax'] += $orders_tax['shipping_tax'];
     $tax_separation[$orders_tax['payment_total_tax_rate'] * 100]['payment_tax'] += $orders_tax['payment_tax'];
     if ($this->ms['MODULES']['DISABLE_VAT_RATE']) {
         $grand_total['shipping_tax'] = 0;
         $grand_total['payment_tax'] = 0;
         $tax_separation[$orders_tax['shipping_total_tax_rate'] * 100]['shipping_tax'] = 0;
         $tax_separation[$orders_tax['payment_total_tax_rate'] * 100]['payment_tax'] = 0;
         if (!$this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
             $address['shipping_method_costs'] = mslib_fe::taxDecimalCrop($address['shipping_method_costs'], 2, false);
             $address['payment_method_costs'] = mslib_fe::taxDecimalCrop($address['payment_method_costs'], 2, false);
         }
     }
     // add shipping & payment costs
     if ($address['shipping_method_costs']) {
         $grand_total['shipping_cost'] = $address['shipping_method_costs'];
         $total_price = $total_price + $address['shipping_method_costs'];
         $tax_separation[$orders_tax['shipping_total_tax_rate'] * 100]['shipping_costs'] = $address['shipping_method_costs'];
     }
     if ($address['payment_method_costs']) {
         $grand_total['payment_cost'] = $address['payment_method_costs'];
         $total_price = $total_price + $address['payment_method_costs'];
         $tax_separation[$orders_tax['payment_total_tax_rate'] * 100]['payment_costs'] = $address['payment_method_costs'];
     }
     $customer_id = '';
     // first the account
     if ($GLOBALS['TSFE']->fe_user->user['uid']) {
         $customer_id = $GLOBALS['TSFE']->fe_user->user['uid'];
     } else {
         $tmp_user = mslib_fe::getUser($address['email'], 'email');
         if ($tmp_user['uid']) {
             $customer_id = $tmp_user['uid'];
         }
     }
     //hook to let other plugins further manipulate the create table query
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_user.php']['convertCartToOrderGetCustomerIdPreProc'])) {
         $params = array('address' => &$address, 'cart' => &$cart, 'customer_id' => &$customer_id);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_user.php']['convertCartToOrderGetCustomerIdPreProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
//.........这里部分代码省略.........
开发者ID:bvbmedia,项目名称:multishop,代码行数:101,代码来源:class.tx_mslib_cart.php

示例8: die

<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
$user = mslib_fe::getUser($this->get['tx_multishop_pi1']['hash'], 'code');
if ($user['uid'] and !$user['tx_multishop_optin_crdate']) {
    $updateArray = array();
    $updateArray['disable'] = 0;
    $updateArray['tx_multishop_optin_crdate'] = time();
    $updateArray['tx_multishop_optin_ip'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR');
    $query = $GLOBALS['TYPO3_DB']->UPDATEquery('fe_users', 'uid=' . $user['uid'], $updateArray);
    $res = $GLOBALS['TYPO3_DB']->sql_query($query);
    // auto login the user
    $loginData = array('uname' => $user['username'], 'uident' => $user['password'], 'status' => 'login');
    $GLOBALS['TSFE']->fe_user->checkPid = 0;
    //do not use a particular pid
    $info = $GLOBALS['TSFE']->fe_user->getAuthInfoArray();
    $user = $GLOBALS['TSFE']->fe_user->fetchUserRecord($info['db_user'], $loginData['uname']);
    $GLOBALS['TSFE']->fe_user->createUserSession($user);
    $this->cart_page_uid .= '_' . $user['uid'];
    // auto login the user
    // RELOAD CART CONTENTS
    $query = $GLOBALS['TYPO3_DB']->SELECTquery('*', 'tx_multishop_cart_contents', 'customer_id=\'' . $user['uid'] . '\' and is_checkout=0', '', 'id desc', '1');
    $res = $GLOBALS['TYPO3_DB']->sql_query($query);
    $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
    if (is_array($row) && $row['contents']) {
        $cart = unserialize($row['contents']);
        //$GLOBALS['TSFE']->fe_user->setKey('ses', $this->cart_page_uid, $cart);
        //$GLOBALS['TSFE']->storeSessionData();
        require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.tx_mslib_cart.php';
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:confirm_create_account.php

示例9: createOrder

 function createOrder($address)
 {
     if (is_numeric($address['uid'])) {
         $customer_id = $address['uid'];
     } else {
         if (!$address['email']) {
             return false;
         }
         $tmp_user = mslib_fe::getUser($address['email'], 'email');
         if ($tmp_user['uid']) {
             $customer_id = $tmp_user['uid'];
         }
     }
     if (!$customer_id) {
         // add new account
         $insertArray = array();
         $insertArray['page_uid'] = $this->shop_pid;
         $insertArray['company'] = $address['company'];
         $insertArray['name'] = $address['first_name'] . ' ' . $address['middle_name'] . ' ' . $address['last_name'];
         $insertArray['name'] = preg_replace('/\\s+/', ' ', $insertArray['name']);
         $insertArray['first_name'] = $address['first_name'];
         $insertArray['last_name'] = $address['last_name'];
         $insertArray['username'] = $address['email'];
         $insertArray['email'] = $address['email'];
         $insertArray['street_name'] = $address['street_name'];
         if (!$insertArray['street_name']) {
             $insertArray['street_name'] = $address['address'];
         }
         $insertArray['address_number'] = $address['address_number'];
         $insertArray['address_ext'] = $address['address_ext'];
         if ($address['address']) {
             $insertArray['address'] = $address['address'];
         } else {
             $insertArray['address'] = $insertArray['street_name'] . ' ' . $insertArray['address_number'] . $insertArray['address_ext'];
             $insertArray['address'] = preg_replace('/\\s+/', ' ', $insertArray['address']);
         }
         $insertArray['zip'] = $address['zip'];
         $insertArray['telephone'] = $address['telephone'];
         $insertArray['city'] = $address['city'];
         $insertArray['country'] = $address['country'];
         $insertArray['usergroup'] = $this->conf['fe_customer_usergroup'];
         $insertArray['pid'] = $this->conf['fe_customer_pid'];
         $insertArray['tstamp'] = time();
         $insertArray['tx_multishop_newsletter'] = $address['tx_multishop_newsletter'];
         $insertArray['password'] = mslib_befe::getHashedPassword(mslib_befe::generateRandomPassword(10, $insertArray['username']));
         $query = $GLOBALS['TYPO3_DB']->INSERTquery('fe_users', $insertArray);
         $res = $GLOBALS['TYPO3_DB']->sql_query($query);
         if ($res) {
             $customer_id = $GLOBALS['TYPO3_DB']->sql_insert_id();
         }
     }
     if ($customer_id) {
         if ($this->ms['MODULES']['DISABLE_VAT_FOR_FOREIGN_CUSTOMERS_WITH_COMPANY_VAT_ID']) {
             // if store country is different than customer country change VAT rate to zero
             if ($address['country'] && $address['tx_multishop_vat_id']) {
                 $iso_customer = mslib_fe::getCountryByName($address['country']);
                 if ($iso_customer['cn_iso_nr'] != $this->ms['MODULES']['COUNTRY_ISO_NR']) {
                     $this->ms['MODULES']['DISABLE_VAT_RATE'] = 1;
                 }
             }
             // if store country is different than customer country change VAT rate to zero eof
         }
         // now add the order
         $insertArray = array();
         $insertArray['customer_id'] = $customer_id;
         $insertArray['page_uid'] = $this->shop_pid;
         $insertArray['language_id'] = 0;
         if (is_numeric($address['language_id'])) {
             $insertArray['language_id'] = $address['language_id'];
         }
         $insertArray['status'] = '';
         if (isset($address['status']) && $address['status'] > 0) {
             // Set order status
             $insertArray['status'] = $address['status'];
         } else {
             // get default orders status
             $status = mslib_fe::getDefaultOrdersStatus($this->sys_language_uid);
             if (is_array($status) && isset($status['id']) && $status['id'] > 0) {
                 $insertArray['status'] = $status['id'];
             }
         }
         $insertArray['customer_comments'] = $this->post['customer_comments'];
         $insertArray['billing_company'] = $address['company'];
         $insertArray['billing_first_name'] = $address['first_name'];
         $insertArray['billing_middle_name'] = $address['middle_name'];
         $insertArray['billing_last_name'] = $address['last_name'];
         $insertArray['billing_name'] = preg_replace('/ +/', ' ', $address['first_name'] . ' ' . $address['middle_name'] . ' ' . $address['last_name']);
         $insertArray['billing_email'] = $address['email'];
         $insertArray['billing_gender'] = $address['gender'];
         $insertArray['billing_birthday'] = $address['birthday'];
         if (!$address['street_name']) {
             $address['street_name'] = $address['address'];
         }
         $insertArray['billing_building'] = $address['building'];
         $insertArray['billing_street_name'] = $address['street_name'];
         $insertArray['billing_address_number'] = $address['address_number'];
         $insertArray['billing_address_ext'] = $address['address_ext'];
         $insertArray['billing_address'] = $address['street_name'] . ' ' . $address['address_number'] . $address['address_ext'];
         $insertArray['billing_address'] = preg_replace('/\\s+/', ' ', $insertArray['billing_address']);
         $insertArray['billing_room'] = '';
//.........这里部分代码省略.........
开发者ID:bvbmedia,项目名称:multishop,代码行数:101,代码来源:class.tx_mslib_order.php

示例10: die

<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
if (mslib_fe::loggedin()) {
    // user is already signed in
    $content .= $this->pi_getLL('you_are_already_signed_in');
} else {
    if ($this->get['tx_multishop_pi1']['createAccountNonOptInCompleted']) {
        $customerSession = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_multishop_customer');
        $customer_id = $customerSession['customer_id'];
        $newCustomer = mslib_fe::getUser($customer_id);
        $page = mslib_fe::getCMScontent('create_account_thank_you_page', $GLOBALS['TSFE']->sys_language_uid);
        if ($page[0]['content']) {
            // loading the email confirmation letter eof
            // replacing the variables with dynamic values
            $array1 = array();
            $array2 = array();
            $array1[] = '###GENDER_SALUTATION###';
            $array2[] = mslib_fe::genderSalutation($newCustomer['gender']);
            $array1[] = '###BILLING_COMPANY###';
            $array2[] = $newCustomer['company'];
            $array1[] = '###FULL_NAME###';
            $array2[] = $newCustomer['name'];
            $array1[] = '###BILLING_NAME###';
            $array2[] = $newCustomer['name'];
            $array1[] = '###BILLING_FIRST_NAME###';
            $array2[] = $newCustomer['first_name'];
            $array1[] = '###BILLING_LAST_NAME###';
            $last_name = $newCustomer['last_name'];
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:default.php

示例11: ucfirst

                    //}
                    $jsonData_content .= '
					<tr class="removeTableCellBorder msAdminSubtotalRow">
						<td colspan="' . ($colspan + 1) . '"><hr></td>
					</tr>';
                    $jsonData_content .= '
					<tr class="removeTableCellBorder msAdminSubtotalRow">
						<td colspan="' . $colspan . '" class="text-right"><strong>' . ucfirst($this->pi_getLL('total')) . '</strong></td>
						<td class="text-right"><strong>' . mslib_fe::amount2Cents($order['grand_total'], $customer_currency, 1, 0) . '</strong></td>
					</tr>';
                }
                $jsonData_content .= '</tbody></table>
				';
                $extraDetails = array();
                if ($order['cruser_id']) {
                    $user = mslib_fe::getUser($order['cruser_id']);
                    if ($user['username']) {
                        $customer_edit_link = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_customer&tx_multishop_pi1[cid]=' . $user['uid'] . '&action=edit_customer');
                        $extraDetails['right'][] = $this->pi_getLL('ordered_by') . ': <strong><a href="' . $customer_edit_link . '">' . $user['username'] . '</a></strong><br />';
                    }
                }
                if ($order['ip_address']) {
                    $extraDetails['right'][] = $this->pi_getLL('ip_address', 'IP address') . ': <strong>' . $order['ip_address'] . '</strong><br />';
                }
                if ($order['http_referer']) {
                    $domain = parse_url($order['http_referer']);
                    if ($domain['host']) {
                        $extraDetails['left'][] = $this->pi_getLL('referrer', 'Referrer') . ': <strong><a href="' . $order['http_referer'] . '" target="_blank" rel="noreferrer">' . $domain['host'] . '</a></strong>';
                    }
                }
                if (count($extraDetails)) {
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:get_admin_orders_listing_details.php

示例12: foreach

 			if ($database['orders_products'][$key]['orders_products_id']==$record2['orders_products_id']) {
 				$database['orders_products'][$key]['products_price']=$database['orders_products'][$key]['products_price']-$record2['options_values_price'];
 				$database['orders_products'][$key]['final_price']=$database['orders_products'][$key]['final_price']-$record2['options_values_price'];
 			}
 		}
 	}
 }
 */
 foreach ($database['orders'] as $key => $record) {
     $user = array();
     $customer_id = '';
     if (count($tx_multishop_customer_ids)) {
         $customer_id = $tx_multishop_customer_ids[$record['customers_id']];
         $user = mslib_fe::getUser($customer_id, 'uid');
     } else {
         $user = mslib_fe::getUser($record['customers_email_address'], 'email');
     }
     if ($user['uid']) {
         $row = array();
         $row['page_uid'] = $this->post['page_uid'];
         $row['customer_id'] = $user['uid'];
         $row['billing_name'] = $user['name'];
         $row['billing_first_name'] = $user['first_name'];
         $row['billing_last_name'] = $user['last_name'];
         $row['billing_company'] = $user['company'];
         $row['billing_building'] = $user['building'];
         $row['billing_address'] = $user['address'];
         $row['billing_address_number'] = $user['address_number'];
         $row['billing_address_ext'] = $user['address_ext'];
         $row['billing_city'] = $user['city'];
         $row['billing_zip'] = $user['zip'];
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:administration.php

示例13: array

if ($this->ms['MODULES']['DISABLE_BIRTHDATE_IN_ADMIN_CUSTOMER_FORM']) {
    $subpartsTemplateWrapperRemove['###BIRTHDATE_BLOCK###'] = '';
}
$subparts['template'] = $this->cObj->substituteMarkerArrayCached($subparts['template'], array(), $subpartsTemplateWrapperRemove);
// load enabled countries to array
$str2 = "SELECT * from static_countries sc, tx_multishop_countries_to_zones c2z, tx_multishop_shipping_countries c where c.page_uid='" . $this->showCatalogFromPage . "' and sc.cn_iso_nr=c.cn_iso_nr and c2z.cn_iso_nr=sc.cn_iso_nr group by c.cn_iso_nr order by sc.cn_short_en";
//$str2="SELECT * from static_countries c, tx_multishop_countries_to_zones c2z where c2z.cn_iso_nr=c.cn_iso_nr order by c.cn_short_en";
$qry2 = $GLOBALS['TYPO3_DB']->sql_query($str2);
$enabled_countries = array();
while (($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry2)) != false) {
    $enabled_countries[] = $row2;
}
$regex = "/^[^\\\\W][a-zA-Z0-9\\\\_\\\\-\\\\.]+([a-zA-Z0-9\\\\_\\\\-\\\\.]+)*\\\\@[a-zA-Z0-9\\\\_\\\\-\\\\.]+([a-zA-Z0-9\\\\_\\\\-\\\\.]+)*\\\\.[a-zA-Z]{2,4}\$/";
$regex_for_character = "/[^0-9]\$/";
if (!$this->post && is_numeric($this->get['tx_multishop_pi1']['cid'])) {
    $user = mslib_fe::getUser($this->get['tx_multishop_pi1']['cid']);
    $this->post = $user;
    // custom hook that can be controlled by third-party plugin
    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_edit_customer.php']['adminEditCustomerPreloadData'])) {
        $params = array('user' => $user);
        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_edit_customer.php']['adminEditCustomerPreloadData'] as $funcRef) {
            \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
        }
    }
}
$head = '';
$head .= '
<script type="text/javascript">
	jQuery(document).ready(function($) {
		jQuery.h5Validate.addPatterns({
			email: /^(([^<>()[\\]\\.,;:\\s@"]+(\\.[^<>()[\\]\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:admin_edit_customer.php

示例14: saveUserData

 function saveUserData()
 {
     $checkEmail = mslib_fe::getUser($this->getEmail(), 'email');
     // if quick_checkout == 1 then update the fe_users
     if ($checkEmail['tx_multishop_quick_checkout']) {
         $customer_id = $checkEmail['uid'];
         // add the user
         $updateArray = array();
         if ($this->username) {
             $updateArray['username'] = $this->username;
         } else {
             $updateArray['username'] = $this->email;
         }
         $updateArray['email'] = $this->email;
         // fe user table holds integer as value: 0 is male, 1 is female
         // but in tt_address its varchar: m is male, f is female
         switch ($this->gender) {
             case '0':
             case 'm':
                 // male
                 $updateArray['gender'] = '0';
                 break;
             case '1':
             case 'f':
                 // female
                 $updateArray['gender'] = '1';
                 break;
             case '2':
             case 'c':
                 // couple
                 $updateArray['gender'] = '2';
                 break;
         }
         $updateArray['password'] = mslib_befe::getHashedPassword($this->password);
         $updateArray['first_name'] = $this->first_name;
         $updateArray['middle_name'] = $this->middle_name;
         $updateArray['last_name'] = $this->last_name;
         $updateArray['name'] = $this->name;
         $updateArray['company'] = $this->company;
         $updateArray['country'] = $this->country;
         $updateArray['street_name'] = $this->address;
         $updateArray['address_number'] = $this->address_number;
         $updateArray['address_ext'] = $this->address_ext;
         $updateArray['address'] = $updateArray['street_name'] . ' ' . $updateArray['address_number'];
         if ($updateArray['address_ext']) {
             $updateArray['address'] .= '-' . $updateArray['address_ext'];
         }
         $updateArray['address'] = preg_replace('/\\s+/', ' ', $updateArray['address']);
         $updateArray['zip'] = $this->zip;
         $updateArray['city'] = $this->city;
         $updateArray['telephone'] = $this->telephone;
         $updateArray['mobile'] = $this->mobile;
         if (isset($this->newsletter) && !empty($this->newsletter)) {
             $updateArray['tx_multishop_newsletter'] = $this->newsletter;
         } else {
             $updateArray['tx_multishop_newsletter'] = '';
         }
         $updateArray['disable'] = 1;
         $updateArray['tstamp'] = time();
         $updateArray['usergroup'] = $this->ref->conf['fe_customer_usergroup'];
         $updateArray['pid'] = $this->ref->conf['fe_customer_pid'];
         $updateArray['tx_multishop_code'] = md5(uniqid('', true));
         $updateArray['crdate'] = time();
         $updateArray['page_uid'] = $this->ref->shop_pid;
         $updateArray['tx_multishop_quick_checkout'] = 0;
         if (isset($this->ref->cookie['HTTP_REFERER']) && !empty($this->ref->cookie['HTTP_REFERER'])) {
             $updateArray['http_referer'] = $this->ref->cookie['HTTP_REFERER'];
         } else {
             $updateArray['http_referer'] = '';
         }
         $updateArray['ip_address'] = $this->ref->REMOTE_ADDR;
         if (is_array($this->customFields) and count($this->customFields)) {
             foreach ($this->customFields as $key => $val) {
                 $updateArray[$key] = $val;
             }
         }
         $query = $GLOBALS['TYPO3_DB']->UPDATEquery('fe_users', 'uid=\'' . $customer_id . '\'', $updateArray);
         $res = $GLOBALS['TYPO3_DB']->sql_query($query);
         if ($customer_id) {
             // ADD CUSTOMER_ID TO THE CART CONTENTS
             if ($customer_id) {
                 $updateArray = array();
                 $updateArray['customer_id'] = $customer_id;
                 $updateArray['page_uid'] = $this->ref->shop_pid;
                 $str = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_cart_contents', 'session_id=\'' . $customer_id . '\'', $updateArray);
                 $res = $GLOBALS['TYPO3_DB']->sql_query($str);
             }
             //hook to let other plugins further manipulate the create table query
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_user.php']['updateUserPostProc'])) {
                 $params = array('customer_id' => &$customer_id);
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_user.php']['updateUserPostProc'] as $funcRef) {
                     \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
                 }
             }
             return $customer_id;
         }
     } else {
         // add the user
         $insertArray = array();
         if ($this->username) {
//.........这里部分代码省略.........
开发者ID:bvbmedia,项目名称:multishop,代码行数:101,代码来源:class.tx_mslib_user.php


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