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


PHP fn_get_user_info函数代码示例

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


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

示例1: connectAdmin

 public function connectAdmin($user_data, $is_reconnect = false)
 {
     if (!$this->_initHisPublicKey()) {
         return false;
     }
     $store_info = self::getAdminUrls();
     if (!$is_reconnect && !self::_needToConnect($store_info)) {
         return false;
     }
     $meta = array();
     // Connect admin panel
     $data = array('public_key' => $this->getMyPublicKey(), 'addon_version' => TWIGMO_VERSION, 'engine' => 'cscart', 'engine_version' => PRODUCT_VERSION, 'engine_meta' => PRODUCT_EDITION, 'saas_uid' => fn_twg_get_saas_uid(), 'name' => Registry::get('settings.Company.company_name'));
     if ($store_info['access_id']) {
         $meta['access_id'] = $store_info['access_id'];
     } else {
         $data = array_merge($data, fn_get_user_info($user_data['user_id']));
         $data = array_merge($data, array('email' => $user_data['email'], 'password' => $user_data['password']));
     }
     $data = array_merge($data, $store_info);
     self::_setConnectTTL();
     $response = $this->send('connect.admin', $data, $meta);
     if (!$this->responseIsOk($response) or empty($response['data']['access_id'])) {
         self::_setConnectionErrorNotification();
         return false;
     }
     $new_options = array('version' => TWIGMO_VERSION, 'admin_connection' => array('access_id' => $response['data']['access_id'], 'url' => $data['url']));
     if (!empty($user_data['email'])) {
         $new_options['email'] = $user_data['email'];
     }
     if ($store_info['access_id'] && $response['data']['access_id'] != $store_info['access_id']) {
         // access_id changed - we have to disconnect storefronts
         $customer_connections = TwigmoSettings::get('customer_connections');
         if (is_array($customer_connections)) {
             foreach ($customer_connections as $company_id => $customer_connection) {
                 $customer_connections[$company_id]['access_id'] = '';
             }
             $new_options['customer_connections'] = $customer_connections;
         }
     }
     TwigmoSettings::set($new_options);
     return true;
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:42,代码来源:TwigmoConnector.php

示例2: content_55ccf7c33c4939_75303952


//.........这里部分代码省略.........
            if ($_smarty_tpl->tpl_vars['show_welcome']->value) {
                ?>
    <div class="hidden cm-dialog-auto-open cm-dialog-auto-size" title="<?php 
                echo $_smarty_tpl->__("installer_complete_title");
                ?>
" id="after_install_dialog" data-ca-dialog-class="welcome-screen-dialog">
        <?php 
                $_smarty_tpl->tpl_vars["company"] = new Smarty_variable(fn_get_company_data("1"), null, 0);
                ?>
        <?php 
                if (fn_allowed_for("ULTIMATE")) {
                    ?>
            <?php 
                    ob_start();
                    echo htmlspecialchars(smarty_modifier_unpuny($_smarty_tpl->tpl_vars['company']->value['storefront']), ENT_QUOTES, 'UTF-8');
                    $_tmp1 = ob_get_clean();
                    $_smarty_tpl->tpl_vars['link_storefront'] = new Smarty_variable("http://" . $_tmp1, null, 0);
                    ?>
        <?php 
                } else {
                    ?>
            <?php 
                    ob_start();
                    echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['config']->value['http_location']), ENT_QUOTES, 'UTF-8');
                    $_tmp2 = ob_get_clean();
                    $_smarty_tpl->tpl_vars['link_storefront'] = new Smarty_variable($_tmp2, null, 0);
                    ?>
        <?php 
                }
                ?>
        <div class="welcome-screen">
            <p>
                <?php 
                $_smarty_tpl->tpl_vars['user_data'] = new Smarty_variable(fn_get_user_info($_smarty_tpl->tpl_vars['auth']->value['user_id']), null, 0);
                ?>
                <?php 
                echo $_smarty_tpl->__("welcome_screen.administrator_info", array('[email]' => $_smarty_tpl->tpl_vars['user_data']->value['email']));
                ?>

            </p>
            <div class="welcome-location-wrapper clearfix">
                <div class="welcome-location-block pull-left center">
                    <h4 class="install-title"><?php 
                echo $_smarty_tpl->__("admin_panel");
                ?>
</h4>
                    <div class="welcome-screen-location welcome-screen-admin">
                        <div class="welcome-screen-overlay">
                            <a class="btn cm-dialog-closer welcome-screen-overlink"><?php 
                echo $_smarty_tpl->__("welcome_screen.go_admin_panel");
                ?>
</a>
                        </div>
                    </div>
                    <div class="welcome-screen-arrow"></div>
                    <p>
                        <?php 
                echo $_smarty_tpl->__("welcome_screen.go_settings_wizard");
                ?>

                    </p>
                    <?php 
                $_smarty_tpl->tpl_vars['c_url'] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
                ?>
                    <a class="cm-dialog-opener cm-ajax btn btn-primary strong" data-ca-target-id="content_settings_wizard" title="<?php 
                echo $_smarty_tpl->__("settings_wizard");
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:67,代码来源:e3bbaed6b9c1024ee236cf10769292ed9861b2dc.tygh.index.tpl.php

示例3: fn_set_notification

        if ($gift_cert_data['amount'] < $min || $gift_cert_data['amount'] > $max) {
            fn_set_notification('E', __('error'), __('gift_cert_error_amount', array('[max]' => $max, '[min]' => $min)));
            Tygh::$app['ajax']->assign('return_status', $gift_cert_data['status']);
        } elseif (fn_change_gift_certificate_status($_REQUEST['id'], $_REQUEST['status'], '', fn_get_notification_rules($_REQUEST))) {
            fn_set_notification('N', __('notice'), __('status_changed'));
        } else {
            fn_set_notification('E', __('error'), __('error_status_not_changed'));
            Tygh::$app['ajax']->assign('return_status', $gift_cert_data['status']);
        }
        exit;
    }
    return array(CONTROLLER_STATUS_OK, 'gift_certificates' . $suffix);
}
if ($mode == 'add') {
    if (!empty($_REQUEST['user_id'])) {
        $user_data = fn_get_user_info($_REQUEST['user_id']);
        $gift_cert_data = array('send_via' => 'E', 'recipient' => "{$user_data['firstname']} {$user_data['lastname']}", 'sender' => Registry::get('settings.Company.company_name'), 'email' => $user_data['email'], 'address' => $user_data['s_address'], 'address_2' => $user_data['s_address_2'], 'city' => $user_data['s_city'], 'country' => $user_data['s_country'], 'state' => $user_data['s_state'], 'zipcode' => $user_data['s_zipcode'], 'phone' => $user_data['phone']);
        Tygh::$app['view']->assign('gift_cert_data', $gift_cert_data);
    }
    Tygh::$app['view']->assign('templates', fn_get_gift_certificate_templates());
    Tygh::$app['view']->assign('states', fn_get_all_states());
    Tygh::$app['view']->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
} elseif ($mode == 'update') {
    $gift_cert_id = intval($_REQUEST['gift_cert_id']);
    $gift_cert_data = fn_get_gift_certificate_info($gift_cert_id);
    if (empty($gift_cert_data) || !empty($gift_cert_id) && !fn_check_company_id('gift_certificates', 'gift_cert_id', $gift_cert_id)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    // [Page sections]
    Registry::set('navigation.tabs', array('detailed' => array('title' => __('detailed_info'), 'js' => true), 'log' => array('title' => __('history'), 'js' => true)));
    // [/Page sections]
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:gift_certificates.php

示例4: fn_get_payment_method_data

 if (isset($cart['payment_id'])) {
     $cart['payment_method_data'] = fn_get_payment_method_data($cart['payment_id']);
 }
 if (!empty($auth['user_id'])) {
     //if the error occurred during registration, but despite this, the registration was performed, then the variable should be cleared.
     unset($_SESSION['failed_registration']);
     if (!empty($_REQUEST['profile_id'])) {
         $cart['profile_id'] = $_REQUEST['profile_id'];
     } elseif (!empty($_REQUEST['profile']) && $_REQUEST['profile'] == 'new') {
         $cart['profile_id'] = 0;
     } elseif (empty($cart['profile_id'])) {
         $cart['profile_id'] = db_get_field("SELECT profile_id FROM ?:user_profiles WHERE user_id = ?i AND profile_type='P'", $auth['user_id']);
     }
     // Here check the previous and the current checksum of user_data - if they are different, recalculate the cart.
     $current_state = fn_crc32(serialize($cart['user_data']));
     $cart['user_data'] = fn_get_user_info($auth['user_id'], empty($_REQUEST['profile']), $cart['profile_id']);
     if ($current_state != fn_crc32(serialize($cart['user_data']))) {
         $cart['recalculate'] = true;
     }
 } else {
     $_user_data = fn_restore_post_data('user_data');
     if (!empty($_user_data)) {
         $_SESSION['failed_registration'] = true;
     } else {
         unset($_SESSION['failed_registration']);
     }
     fn_add_user_data_descriptions($cart['user_data']);
     if (!empty($_REQUEST['action'])) {
         Tygh::$app['view']->assign('checkout_type', $_REQUEST['action']);
     }
 }
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:checkout.php

示例5: array

    return;
}
if ($mode == 'userlog') {
    $params = $_REQUEST;
    if (AREA == 'C') {
        $params['user_id'] = $auth['user_id'];
    }
    if (empty($params['user_id'])) {
        if (AREA == 'C') {
            return array(CONTROLLER_STATUS_REDIRECT, 'auth.login_form?return_url=' . urlencode(Registry::get('config.current_url')));
        } else {
            return array(CONTROLLER_STATUS_NO_PAGE);
        }
    }
    if (AREA == 'A') {
        $user = fn_get_user_info($params['user_id'], false);
        if (fn_allowed_for('ULTIMATE')) {
            if (empty($user)) {
                return array(CONTROLLER_STATUS_NO_PAGE);
            }
            if (Registry::get('settings.Stores.share_users') == 'Y' && Registry::get('runtime.company_id')) {
                $orders_ids = db_get_fields("SELECT order_id FROM ?:orders WHERE user_id = ?i AND company_id = ?i", $params['user_id'], Registry::get('runtime.company_id'));
                if (empty($orders_ids)) {
                    return array(CONTROLLER_STATUS_NO_PAGE);
                }
            }
        }
        Registry::get('view')->assign('user', $user);
    } else {
        fn_add_breadcrumb(__('reward_points_log'));
    }
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:31,代码来源:reward_points.post.php

示例6: fn_promotion_post_processing

/**
 * Promotions post processing
 *
 * @param string $status_to new order status
 * @param string $status_from original order status
 * @param array $order_info order information
 * @param array $force_notification Array with notification rules
 * @return boolean always true
 */
function fn_promotion_post_processing($status_to, $status_from, $order_info, $force_notification = array())
{
    $order_statuses = fn_get_statuses(STATUSES_ORDER, array(), true);
    $notify_user = isset($force_notification['C']) ? $force_notification['C'] : (!empty($order_statuses[$status_to]['params']['notify']) && $order_statuses[$status_to]['params']['notify'] == 'Y' ? true : false);
    $status_from_is_positive = fn_status_is_positive($order_statuses[$status_from]);
    $status_to_is_positive = fn_status_is_positive($order_statuses[$status_to]);
    if (empty($order_info['promotions'])) {
        return false;
    }
    // Process numbers of usage for Open statuses
    if ($status_to != $status_from && fn_status_is_positive($order_statuses[$status_from], true) != fn_status_is_positive($order_statuses[$status_to], true)) {
        // Post processing
        if (fn_status_is_positive($order_statuses[$status_to], true)) {
            db_query("UPDATE ?:promotions SET number_of_usages = number_of_usages + 1 WHERE promotion_id IN (?n)", array_keys($order_info['promotions']));
        } else {
            db_query("UPDATE ?:promotions SET number_of_usages = number_of_usages - 1 WHERE promotion_id IN (?n)", array_keys($order_info['promotions']));
        }
    }
    if ($status_to != $status_from && $status_from_is_positive != $status_to_is_positive) {
        // Apply pending actions
        foreach ($order_info['promotions'] as $k => $v) {
            if (!empty($v['bonuses'])) {
                foreach ($v['bonuses'] as $bonus) {
                    // Assign usergroup
                    if ($bonus['bonus'] == 'give_usergroup') {
                        $is_ug_already_assigned = false;
                        if (empty($order_info['user_id'])) {
                            continue;
                        }
                        // Don't assing a disabled usergroup
                        $system_usergroups = fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), CART_LANGUAGE);
                        if (!empty($system_usergroups[$bonus['value']]['status']) && in_array($system_usergroups[$bonus['value']]['status'], array('A', 'H'))) {
                            if ($order_statuses[$status_to]['params']['inventory'] == 'D') {
                                // Don't assing the usergroup to the user if it's already assigned
                                $current_user_usergroups = fn_get_user_usergroups($order_info['user_id']);
                                foreach ($current_user_usergroups as $ug) {
                                    if (isset($ug['usergroup_id']) && $bonus['value'] == $ug['usergroup_id'] && in_array($ug['status'], array('A', 'H'))) {
                                        $is_ug_already_assigned = true;
                                        break;
                                    }
                                }
                                if (!$is_ug_already_assigned) {
                                    db_query("REPLACE INTO ?:usergroup_links SET user_id = ?i, usergroup_id = ?i, status = 'A'", $order_info['user_id'], $bonus['value']);
                                    $activated = true;
                                }
                            } else {
                                db_query("UPDATE ?:usergroup_links SET status = 'F' WHERE user_id = ?i AND usergroup_id = ?i", $order_info['user_id'], $bonus['value']);
                                $activated = false;
                            }
                            if ($notify_user == true && !$is_ug_already_assigned) {
                                $prefix = $activated == true ? 'activation' : 'disactivation';
                                Mailer::sendMail(array('to' => $order_info['email'], 'from' => 'company_users_department', 'data' => array('user_data' => fn_get_user_info($order_info['user_id']), 'usergroups' => fn_get_usergroups(array('status' => array('A', 'H')), $order_info['lang_code']), 'usergroup_ids' => (array) $bonus['value']), 'tpl' => 'profiles/usergroup_' . $prefix . '.tpl', 'company_id' => $order_info['company_id']), 'C', $order_info['lang_code']);
                            }
                        } else {
                            if (AREA == 'C') {
                                fn_set_notification('E', __('error'), __('unable_to_assign_usergroup'));
                            }
                        }
                    } elseif ($bonus['bonus'] == 'give_coupon') {
                        $promotion_data = fn_get_promotion_data($bonus['value']);
                        if (empty($promotion_data)) {
                            continue;
                        }
                        if ($status_to_is_positive) {
                            fn_promotion_update_condition($promotion_data['conditions']['conditions'], 'add', 'auto_coupons', $bonus['coupon_code']);
                            if ($notify_user == true) {
                                Mailer::sendMail(array('to' => $order_info['email'], 'from' => 'company_users_department', 'data' => array('promotion_data' => $promotion_data, 'bonus_data' => $bonus, 'order_info' => $order_info), 'tpl' => 'promotions/give_coupon.tpl', 'company_id' => $order_info['company_id']), 'C', $order_info['lang_code']);
                            }
                        } else {
                            fn_promotion_update_condition($promotion_data['conditions']['conditions'], 'remove', 'auto_coupons', $bonus['coupon_code']);
                        }
                        db_query("UPDATE ?:promotions SET conditions = ?s, conditions_hash = ?s, users_conditions_hash = ?s WHERE promotion_id = ?i", serialize($promotion_data['conditions']), fn_promotion_serialize($promotion_data['conditions']['conditions']), fn_promotion_serialize_users_conditions($promotion_data['conditions']['conditions']), $bonus['value']);
                    }
                }
            }
        }
    }
    return true;
}
开发者ID:askzap,项目名称:ultimate,代码行数:88,代码来源:fn.promotions.php

示例7: fn_get_element_condition

function fn_get_element_condition($table_id, $element_hash, $for_calculate = false)
{
    $auth =& $_SESSION['auth'];
    $element_id = db_get_field("SELECT element_id FROM ?:sales_reports_table_elements WHERE element_hash = ?s", $element_hash);
    $data = db_get_row("SELECT * FROM ?:sales_reports_elements WHERE element_id = ?i", $element_id);
    $cond = db_get_fields("SELECT ids FROM ?:sales_reports_table_element_conditions WHERE table_id = ?i AND element_hash = ?s", $table_id, $element_hash);
    foreach ($cond as $k => $v) {
        $data['conditions'][$v] = $v;
        if (!$for_calculate) {
            if ($data['code'] == 'product') {
                $data['conditions'][$v] = fn_get_product_data($v, $auth, CART_LANGUAGE, true, false, false);
            }
            if ($data['code'] == 'user') {
                $data['conditions'][$v] = fn_get_user_info($v, false);
            }
            if ($data['code'] == 'order') {
                $data['conditions'][$v] = db_get_row("SELECT * FROM ?:orders WHERE order_id = ?i", $v);
            }
        }
    }
    return $data = empty($data) ? false : $data;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:22,代码来源:fn.sales_reports.php

示例8: fn_twg_get_user_info

/**
 * Get user info
 */
function fn_twg_get_user_info($user_id)
{
    $profile = array();
    if (!$user_id) {
        $profile['user_id'] = 0;
    } else {
        $profile = fn_get_user_info($user_id);
        if (empty($profile)) {
            return false;
        }
    }
    if (AREA == 'C' && !empty($_SESSION['cart']['user_data'])) {
        $profile = array_merge($profile, $_SESSION['cart']['user_data']);
    }
    // Clear empty profile fields
    if (!empty($profile['fields'])) {
        $profile['fields'] = array_filter($profile['fields']);
    }
    $profile['ship_to_another']['profile'] = fn_check_shipping_billing($profile, fn_get_profile_fields());
    $checkout_pfields = fn_get_profile_fields('O');
    $profile['ship_to_another']['cart'] = fn_check_shipping_billing($profile, $checkout_pfields) || !fn_compare_shipping_billing($checkout_pfields);
    if ($user_id) {
        $profile['b_email'] = !empty($profile['b_email']) ? $profile['b_email'] : $profile['email'];
        $profile['s_email'] = !empty($profile['s_email']) ? $profile['s_email'] : $profile['email'];
    }
    return $profile;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:30,代码来源:func.php

示例9: die

* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
//
// $Id: affiliate_plans.php 10229 2010-07-27 14:21:39Z 2tl $
//
if (!defined('AREA')) {
    die('Access denied');
}
if ($mode == 'html_file') {
    $_tout = 5;
    if (empty($action)) {
        $action = 'partner';
    }
    $_rurl = $action == 'partner' ? fn_url("profiles.add?aff_id=" . $auth['user_id'], 'C', 'http') : fn_url(Registry::get('config.http_location') . '/' . Registry::get('config.customer_index') . "?aff_id={$auth['user_id']}");
    $_u_data = fn_get_user_info($auth['user_id']);
    $_u_name = empty($_u_data['firstname']) ? '' : $_u_data['firstname'];
    $_u_name .= empty($_u_name) || empty($_u_data['lastname']) ? '' : ' ';
    $_u_name .= empty($_u_data['lastname']) ? '' : $_u_data['lastname'];
    $view->assign('_tout', $_tout);
    $view->assign('_rurl', $_rurl);
    $view->assign('_u_name', $_u_name);
    $file_content = trim($view->display('affiliate/redirect.tpl', false));
    // FIX-TEMPLATE
    header("Content-type: text/html");
    header("Content-disposition: attachment; filename={$action}.html");
    echo $file_content;
    exit;
}
$affiliate_plan = fn_get_affiliate_plan_data_by_partner_id($auth['user_id']);
if (!empty($affiliate_plan['plan_id'])) {
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:affiliate_plans.php

示例10: array

 if (!empty($_REQUEST['user_id']) && !empty($_REQUEST['user_type'])) {
     if ($_REQUEST['user_id'] == $auth['user_id'] && defined('RESTRICTED_ADMIN') && !in_array($_REQUEST['user_type'], array('A', ''))) {
         return array(CONTROLLER_STATUS_REDIRECT, 'profiles.update?user_id=' . $_REQUEST['user_id']);
     }
 }
 if (fn_is_restricted_admin($_REQUEST) == true) {
     return array(CONTROLLER_STATUS_DENIED);
 }
 // copy to add below this line
 $profile_id = !empty($_REQUEST['profile_id']) ? $_REQUEST['profile_id'] : 0;
 $_uid = !empty($profile_id) ? db_get_field("SELECT user_id FROM ?:user_profiles WHERE profile_id = ?i", $profile_id) : $auth['user_id'];
 $user_id = empty($_REQUEST['user_id']) ? $mode == 'add' ? '' : $_uid : $_REQUEST['user_id'];
 if (!empty($_REQUEST['profile']) && $_REQUEST['profile'] == 'new') {
     $user_data = fn_get_user_info($user_id, false);
 } else {
     $user_data = fn_get_user_info($user_id, true, $profile_id);
 }
 $saved_user_data = fn_restore_post_data('user_data');
 if (!empty($saved_user_data)) {
     $user_data = fn_array_merge($user_data, $saved_user_data);
 }
 if ($mode == 'update') {
     if (empty($user_data)) {
         return array(CONTROLLER_STATUS_NO_PAGE);
     }
 }
 $user_data['user_id'] = empty($user_data['user_id']) ? !empty($user_id) ? $user_id : 0 : $user_data['user_id'];
 $user_data['user_type'] = empty($user_data['user_type']) ? 'C' : $user_data['user_type'];
 $user_type = !empty($_REQUEST['user_type']) ? $_REQUEST['user_type'] : $user_data['user_type'];
 $usergroups = fn_get_usergroups(fn_check_user_type_admin_area($user_type) ? array('status' => array('A', 'H')) : array('type' => 'C', 'status' => array('A', 'H')), CART_LANGUAGE);
 $auth['is_root'] = isset($auth['is_root']) ? $auth['is_root'] : '';
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:profiles.php

示例11: fn_change_company_status

/**
 * Fucntion changes company status. Allowed statuses are A(ctive) and D(isabled)
 *
 * @param int $company_id
 * @param string $status_to A or D
 * @param string $reason The reason of the change
 * @param string $status_from Previous status
 * @param boolean $skip_query By default false. Update query might be skipped if status is already changed.
 * @return boolean True on success or false on failure
 */
function fn_change_company_status($company_id, $status_to, $reason = '', &$status_from = '', $skip_query = false, $notify = true)
{
    /**
     * Actions before change company status
     *
     * @param int    $company_id  Company ID
     * @param string $status_to   Status to letter
     * @param string $reason      Reason text
     * @param string $status_from Status from letter
     * @param bool   $skip_query  Skip query flag
     * @param bool   $notify      Notify flag
     */
    fn_set_hook('change_company_status_pre', $company_id, $status_to, $reason, $status_from, $skip_query, $notify);
    if (empty($status_from)) {
        $status_from = db_get_field("SELECT status FROM ?:companies WHERE company_id = ?i", $company_id);
    }
    if (!in_array($status_to, array('A', 'P', 'D')) || $status_from == $status_to) {
        return false;
    }
    $result = $skip_query ? true : db_query("UPDATE ?:companies SET status = ?s WHERE company_id = ?i", $status_to, $company_id);
    if (!$result) {
        return false;
    }
    $company_data = fn_get_company_data($company_id);
    $account = $username = '';
    if ($status_from == 'N' && ($status_to == 'A' || $status_to == 'P')) {
        if (Registry::get('settings.Vendors.create_vendor_administrator_account') == 'Y') {
            if (!empty($company_data['request_user_id'])) {
                $password_change_timestamp = db_get_field("SELECT password_change_timestamp FROM ?:users WHERE user_id = ?i", $company_data['request_user_id']);
                $_set = '';
                if (empty($password_change_timestamp)) {
                    $_set = ", password_change_timestamp = 1 ";
                }
                db_query("UPDATE ?:users SET company_id = ?i, user_type = 'V'{$_set} WHERE user_id = ?i", $company_id, $company_data['request_user_id']);
                $username = fn_get_user_name($company_data['request_user_id']);
                $account = 'updated';
                $msg = __('new_administrator_account_created') . '<a href="' . fn_url('profiles.update?user_id=' . $company_data['request_user_id']) . '">' . __('you_can_edit_account_details') . '</a>';
                fn_set_notification('N', __('notice'), $msg, 'K');
            } else {
                $_company_data = $company_data + unserialize($company_data['request_account_data']);
                $_company_data['status'] = 'A';
                if (!empty($_company_data['request_account_name'])) {
                    $_company_data['admin_username'] = $_company_data['request_account_name'];
                }
                $user_data = fn_create_company_admin($_company_data, $_company_data['fields'], false);
                if (!empty($user_data['user_id'])) {
                    $username = $user_data['user_login'];
                    $account = 'new';
                }
            }
        }
    }
    if (empty($user_data)) {
        $user_id = db_get_field("SELECT user_id FROM ?:users WHERE company_id = ?i AND is_root = 'Y' AND user_type = 'V'", $company_id);
        $user_data = fn_get_user_info($user_id);
    }
    /**
     * Actions between change company status and send mail
     *
     * @param int    $company_id   Company ID
     * @param string $status_to    Status to letter
     * @param string $reason       Reason text
     * @param string $status_from  Status from letter
     * @param bool   $skip_query   Skip query flag
     * @param bool   $notify       Notify flag
     * @param array  $company_data Company data
     * @param array  $user_data    User data
     * @param bool   $result       Updated flag
     */
    fn_set_hook('change_company_status_before_mail', $company_id, $status_to, $reason, $status_from, $skip_query, $notify, $company_data, $user_data, $result);
    if ($notify && !empty($company_data['email'])) {
        $e_username = '';
        $e_account = '';
        $e_password = '';
        if ($status_from == 'N' && ($status_to == 'A' || $status_to == 'P')) {
            $e_username = $username;
            $e_account = $account;
            if ($account == 'new') {
                $e_password = $user_data['password1'];
            }
        }
        $mail_template = fn_strtolower($status_from . '_' . $status_to);
        Mailer::sendMail(array('to' => $company_data['email'], 'from' => 'default_company_support_department', 'data' => array('user_data' => $user_data, 'reason' => $reason, 'status' => __($status_to == 'A' ? 'active' : 'disabled'), 'e_username' => $e_username, 'e_account' => $e_account, 'e_password' => $e_password), 'company_id' => $company_id, 'tpl' => 'companies/status_' . $mail_template . '_notification.tpl'), 'A');
    }
    return $result;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:96,代码来源:fn.companies.php

示例12: _getUserDataFromDatabase

 protected function _getUserDataFromDatabase($email)
 {
     $user_id = fn_is_user_exists(0, array('email' => $email));
     if (!$user_id) {
         return true;
     }
     $user_info = fn_get_user_info($user_id);
     if (!empty($user_info)) {
         $data = array('BuyerRegEnd' => gmdate("Y-m-d H:i:s", $user_info['timestamp']));
         return $data;
     }
     $data = array('BuyerRegStart' => gmdate("Y-m-d H:i:s", time()));
     return $data;
 }
开发者ID:AlekseyChuyan,项目名称:triggmine_cs_cart,代码行数:14,代码来源:integrator.php

示例13: fn_recover_password_generate_key

/**
 * Generate ekey.
 *
 * @param string $user_email
 * @return bool
 */
function fn_recover_password_generate_key($user_email, $notify = true)
{
    $result = true;
    if ($user_email) {
        $condition = '';
        if (fn_allowed_for('ULTIMATE')) {
            if (Registry::get('settings.Stores.share_users') == 'N' && AREA != 'A') {
                $condition = fn_get_company_condition('?:users.company_id');
            }
        }
        $uid = db_get_field("SELECT user_id FROM ?:users WHERE email = ?s" . $condition, $user_email);
        $u_data = fn_get_user_info($uid, false);
        if (isset($u_data['status']) && $u_data['status'] == 'D') {
            fn_set_notification('E', __('error'), __('error_account_disabled'));
            return false;
        }
        if (!empty($u_data['email'])) {
            $ekey = fn_generate_ekey($u_data['user_id'], 'U', SECONDS_IN_DAY);
            if ($notify) {
                Mailer::sendMail(array('to' => $u_data['email'], 'from' => 'default_company_users_department', 'data' => array('ekey' => $ekey, 'zone' => $u_data['user_type']), 'tpl' => 'profiles/recover_password.tpl'), fn_check_user_type_admin_area($u_data['user_type']) ? 'A' : 'C', $u_data['lang_code']);
                fn_set_notification('N', __('information'), __('text_password_recovery_instructions_sent'));
            } else {
                $result = array('company_id' => $u_data['company_id'], 'key' => $ekey, 'user_type' => $u_data['user_type']);
            }
        } else {
            fn_set_notification('E', __('error'), __('error_login_not_exists'));
            $result = false;
        }
    } else {
        fn_set_notification('E', __('error'), __('error_login_not_exists'));
        $result = false;
    }
    return $result;
}
开发者ID:askzap,项目名称:ultimate,代码行数:40,代码来源:fn.users.php

示例14: fn_get_profile_fields

 //
 // Prepare customer info
 //
 $profile_fields = fn_get_profile_fields('O', $customer_auth);
 $cart['profile_id'] = empty($cart['profile_id']) ? 0 : $cart['profile_id'];
 Registry::get('view')->assign('profile_fields', $profile_fields);
 //Get user profiles
 $user_profiles = fn_get_user_profiles($customer_auth['user_id']);
 Registry::get('view')->assign('user_profiles', $user_profiles);
 //Get countries and states
 Registry::get('view')->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
 Registry::get('view')->assign('states', fn_get_all_states());
 Registry::get('view')->assign('usergroups', fn_get_usergroups('C', DESCR_SL));
 if (!empty($customer_auth['user_id']) && (empty($cart['user_data']) || !empty($_REQUEST['profile_id']) && $cart['profile_id'] != $_REQUEST['profile_id'])) {
     $cart['profile_id'] = !empty($_REQUEST['profile_id']) ? $_REQUEST['profile_id'] : 0;
     $cart['user_data'] = fn_get_user_info($customer_auth['user_id'], true, $cart['profile_id']);
     fn_filter_hidden_profile_fields($cart['user_data'], 'O');
 }
 if (!empty($cart['user_data'])) {
     $cart['ship_to_another'] = fn_check_shipping_billing($cart['user_data'], $profile_fields);
 }
 //
 // Get products info
 // and shipping rates
 //
 // Clean up saved shipping rates
 // unset($_SESSION['shipping_rates']);
 if (!empty($shipping_rates)) {
     define('CACHED_SHIPPING_RATES', true);
 }
 $cart['calculate_shipping'] = true;
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:order_management.php

示例15: fn_send_usergroup_status_notification

function fn_send_usergroup_status_notification($user_id, $usergroup_ids, $status)
{
    $user_data = fn_get_user_info($user_id);
    Registry::get('view_mail')->assign('user_data', $user_data);
    Registry::get('view_mail')->assign('usergroups', fn_get_usergroups('F', $user_data['lang_code']));
    Registry::get('view_mail')->assign('usergroup_ids', $usergroup_ids);
    $prefix = $status == 'A' ? 'activation' : 'disactivation';
    fn_send_mail($user_data['email'], Registry::get('settings.Company.company_users_department'), 'profiles/usergroup_' . $prefix . '_subj.tpl', 'profiles/usergroup_' . $prefix . '.tpl', array(), $user_data['lang_code']);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:9,代码来源:usergroups.php


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