function fn_mve_get_users(&$params, &$fields, &$sortings, &$condition, &$join) { if (isset($params['company_id']) && $params['company_id'] != '') { $condition['company_id'] = db_quote(' AND ?:users.company_id = ?i ', $params['company_id']); } if (Registry::get('runtime.company_id')) { if (empty($params['user_type'])) { $condition['users_company_id'] = db_quote(" AND (?:users.user_id IN (?n) OR (?:users.user_type != ?s AND" . fn_get_company_condition('?:users.company_id', false) . ")) ", fn_get_company_customers_ids(Registry::get('runtime.company_id')), 'C'); } elseif (fn_check_user_type_admin_area($params['user_type'])) { $condition['users_company_id'] = fn_get_company_condition('?:users.company_id'); } elseif ($params['user_type'] == 'C') { $condition['users_company_id'] = db_quote(" AND ?:users.user_id IN (?n) ", fn_get_company_customers_ids(Registry::get('runtime.company_id'))); } } }
if (empty($data)) { $response->addError('ERROR_WRONG_DATA', __('twgadmin_wrong_api_data')); } if ($mode == 'post') { if ($object == 'users') { foreach ($data as $user) { if (!empty($user['user_id'])) { if ($_REQUEST['action'] == 'update') { $result = false; $user_data = db_get_row("SELECT * FROM ?:users WHERE user_id = ?i", $user['user_id']); $notify_user = !empty($user['notify_updated_user']) && $user['notify_updated_user'] == 'Y' ? true : false; if (!empty($user['status']) && !$user['is_complete_data']) { $result = db_query("UPDATE ?:users SET status = ?s WHERE user_id = ?i", $user['status'], $user['user_id']); $force_notification = fn_get_notification_rules(array('notify_user' => $noify_user)); if (!empty($force_notification['C']) && $user['status'] == 'A' && $user_data['status'] == 'D') { Mailer::sendMail(array('to' => $user_data['email'], 'from' => 'company_users_department', 'data' => array('user_data' => $user_data), 'tpl' => 'profiles/profile_activated.tpl', 'company_id' => $user_data['company_id']), fn_check_user_type_admin_area($user_data['user_type']) ? 'A' : 'C', $user_data['lang_code']); } } $temp_auth = null; $result = fn_twg_api_update_user($user, $temp_auth, $notify_user); if (!$result) { $msg = str_replace('[object_id]', $user['user_id'], __('twgadmin_wrong_api_object_data')); $response->addError('ERROR_OBJECT_UPDATE', str_replace('[object]', 'users', __('twgadmin_wrong_api_object_data'))); } } elseif ($_REQUEST['action'] == 'delete') { if (!fn_delete_user($user['user_id'])) { $msg = str_replace('[object_id]', $user['user_id'], __('twgadmin_wrong_api_object_data')); $response->addError('ERROR_OBJECT_DELETE', str_replace('[object]', 'users', __('twgadmin_wrong_api_object_data'))); } } } else {
/** * 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; }
$auth['is_root'] = isset($auth['is_root']) ? $auth['is_root'] : ''; $navigation = array('general' => array('title' => __('general'), 'js' => true), 'addons' => array('title' => __('addons'), 'js' => true)); if (!fn_allowed_for('ULTIMATE:FREE')) { if ($mode == 'update' && (!fn_check_user_type_admin_area($user_type) && !Registry::get('runtime.company_id') || fn_check_user_type_admin_area($user_type) && !Registry::get('runtime.company_id') && $auth['is_root'] == 'Y' && (!empty($user_data['company_id']) || empty($user_data['company_id']) && (!empty($user_data['is_root']) && $user_data['is_root'] != 'Y')) || $user_data['user_type'] == 'V' && Registry::get('runtime.company_id') && $auth['is_root'] == 'Y' && $user_data['user_id'] != $auth['user_id'] && $user_data['company_id'] == Registry::get('runtime.company_id'))) { $navigation['usergroups'] = array('title' => __('usergroups'), 'js' => true); } else { $usergroups = array(); } } if (empty($user_data['api_key'])) { Tygh::$app['view']->assign('new_api_key', Api::generateKey()); } /** * Only admin can set the api key. */ if (fn_check_user_type_admin_area($user_data) && !empty($user_data['user_id']) && ($auth['user_type'] == 'A' || $user_data['api_key'])) { $navigation['api'] = array('title' => __('api_access'), 'js' => true); Tygh::$app['view']->assign('show_api_tab', true); if ($auth['user_type'] != 'A') { Tygh::$app['view']->assign('hide_api_checkbox', true); } } Registry::set('navigation.tabs', $navigation); Tygh::$app['view']->assign('usergroups', $usergroups); Tygh::$app['view']->assign('hide_inputs', !fn_check_editable_permissions($auth, $user_data)); $profile_fields = fn_get_profile_fields($user_type); Tygh::$app['view']->assign('user_type', $user_type); Tygh::$app['view']->assign('profile_fields', $profile_fields); Tygh::$app['view']->assign('user_data', $user_data); Tygh::$app['view']->assign('ship_to_another', fn_check_shipping_billing($user_data, $profile_fields)); if (Registry::get('settings.General.user_multiple_profiles') == 'Y' && !empty($user_id)) {
function content_55e61e6bb11d10_64552035($_smarty_tpl) { if (!is_callable('smarty_block_hook')) { include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php'; } fn_preload_lang_vars(array('contact_information', 'user_profile_info', 'text_multiprofile_notice', 'billing_address', 'shipping_address', 'shipping_address', 'usergroup', 'status', 'no_data', 'allow_api_access', 'api_key', 'new_profile', 'editing_profile', 'editing_profile', 'editing_profile', 'view_all_orders', 'act_on_behalf', 'delete', 'create', 'notify_user')); if ($_smarty_tpl->tpl_vars['user_data']->value) { ?> <?php $_smarty_tpl->tpl_vars["id"] = new Smarty_variable($_smarty_tpl->tpl_vars['user_data']->value['user_id'], null, 0); } else { ?> <?php $_smarty_tpl->tpl_vars["id"] = new Smarty_variable(0, null, 0); } ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <form name="profile_form" action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post" class="form-horizontal form-edit form-table <?php if ($_smarty_tpl->tpl_vars['runtime']->value['company_id'] && $_smarty_tpl->tpl_vars['id']->value && $_smarty_tpl->tpl_vars['user_data']->value['company_id'] != $_smarty_tpl->tpl_vars['runtime']->value['company_id'] && $_smarty_tpl->tpl_vars['id']->value != $_smarty_tpl->tpl_vars['auth']->value['user_id'] || $_smarty_tpl->tpl_vars['hide_inputs']->value) { ?> cm-hide-inputs<?php } ?> "> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null); ob_start(); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("tabsbox", null, null); ob_start(); ?> <?php $_smarty_tpl->tpl_vars['hide_inputs'] = new Smarty_variable(false, null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['user_data']->value['user_type'] == $_smarty_tpl->tpl_vars['auth']->value['user_type'] && $_smarty_tpl->tpl_vars['user_data']->value['is_root'] == 'Y' && $_smarty_tpl->tpl_vars['user_data']->value['user_id'] != $_smarty_tpl->tpl_vars['auth']->value['user_id'] && (!$_smarty_tpl->tpl_vars['user_data']->value['company_id'] || $_smarty_tpl->tpl_vars['user_data']->value['company_id'] == $_smarty_tpl->tpl_vars['auth']->value['company_id'])) { ?> <?php $_smarty_tpl->tpl_vars['hide_inputs'] = new Smarty_variable(true, null, 0); ?> <?php } ?> <?php if (fn_allowed_for("ULTIMATE") && !fn_allow_save_object($_smarty_tpl->tpl_vars['user_data']->value, "users") && $_smarty_tpl->tpl_vars['id']->value && !fn_ult_check_users_usergroup_companies($_smarty_tpl->tpl_vars['id']->value) && $_smarty_tpl->tpl_vars['user_data']->value['user_id'] != $_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <?php $_smarty_tpl->tpl_vars['hide_inputs'] = new Smarty_variable(true, null, 0); ?> <?php } ?> <?php if (fn_allowed_for("MULTIVENDOR") && (!fn_allow_save_object($_smarty_tpl->tpl_vars['user_data']->value, "users") || $_smarty_tpl->tpl_vars['runtime']->value['company_id'] && ($_REQUEST['user_type'] == 'C' || fn_string_not_empty($_smarty_tpl->tpl_vars['user_data']->value['company_id']) && $_smarty_tpl->tpl_vars['user_data']->value['company_id'] != $_smarty_tpl->tpl_vars['runtime']->value['company_id'])) && $_smarty_tpl->tpl_vars['user_data']->value['user_id'] != $_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <?php $_smarty_tpl->tpl_vars['hide_inputs'] = new Smarty_variable(true, null, 0); ?> <?php } ?> <input type="hidden" name="user_id" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" class="cm-no-hide-input" name="selected_section" id="selected_section" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['selected_section']->value, ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" class="cm-no-hide-input" name="user_type" value="<?php echo htmlspecialchars($_REQUEST['user_type'], ENT_QUOTES, 'UTF-8'); ?> " /> <div id="content_general"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:general_content")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:general_content"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_account.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php if ((fn_allowed_for("ULTIMATE") || $_smarty_tpl->tpl_vars['user_type']->value == "V") && $_smarty_tpl->tpl_vars['id']->value != $_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <?php $_smarty_tpl->tpl_vars['zero_company_id_name_lang_var'] = new Smarty_variable(false, null, 0); ?> <?php if (fn_allowed_for("ULTIMATE") && fn_check_user_type_admin_area($_smarty_tpl->tpl_vars['user_type']->value)) { ?> <?php $_smarty_tpl->tpl_vars['zero_company_id_name_lang_var'] = new Smarty_variable('all_vendors', null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("views/companies/components/company_field.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('name' => "user_data[company_id]", 'id' => "user_data_company_id", 'selected' => $_smarty_tpl->tpl_vars['user_data']->value['company_id'], 'zero_company_id_name_lang_var' => $_smarty_tpl->tpl_vars['zero_company_id_name_lang_var']->value, 'disable_company_picker' => $_smarty_tpl->tpl_vars['hide_inputs']->value), 0); ?> <?php } else { ?> <input type="hidden" name="user_data[company_id]" value="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['user_data']->value['company_id']) === null || $tmp === '' ? 0 : $tmp, ENT_QUOTES, 'UTF-8'); ?> "> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:general_content"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => "C", 'title' => __("contact_information")), 0); ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['user_multiple_profiles'] == "Y" && $_smarty_tpl->tpl_vars['id']->value) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("user_profile_info")), 0); ?> <p class="form-note"><?php echo $_smarty_tpl->__("text_multiprofile_notice"); ?> </p> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/multiple_profiles.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['profile_fields']->value['B']) { ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => "B", 'title' => __("billing_address")), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => "S", 'title' => __("shipping_address"), 'body_id' => "sa", 'shipping_flag' => fn_compare_shipping_billing($_smarty_tpl->tpl_vars['profile_fields']->value)), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => "S", 'title' => __("shipping_address"), 'shipping_flag' => false), 0); ?> <?php } ?> </div> <?php if (!fn_allowed_for("ULTIMATE:FREE")) { ?> <?php if ($_smarty_tpl->tpl_vars['id']->value && ((!fn_check_user_type_admin_area($_smarty_tpl->tpl_vars['user_data']->value) || !$_smarty_tpl->tpl_vars['user_data']->value['user_id']) && !$_smarty_tpl->tpl_vars['runtime']->value['company_id'] || fn_check_user_type_admin_area($_smarty_tpl->tpl_vars['user_data']->value) && $_smarty_tpl->tpl_vars['user_data']->value['user_id'] && $_smarty_tpl->tpl_vars['usergroups']->value && !$_smarty_tpl->tpl_vars['runtime']->value['company_id'] && $_smarty_tpl->tpl_vars['auth']->value['is_root'] == 'Y' && ($_smarty_tpl->tpl_vars['user_data']->value['company_id'] != 0 || $_smarty_tpl->tpl_vars['user_data']->value['company_id'] == 0 && $_smarty_tpl->tpl_vars['user_data']->value['is_root'] != 'Y') || $_smarty_tpl->tpl_vars['user_data']->value['user_type'] == 'V' && $_smarty_tpl->tpl_vars['runtime']->value['company_id'] && $_smarty_tpl->tpl_vars['auth']->value['is_root'] == 'Y' && $_smarty_tpl->tpl_vars['user_data']->value['user_id'] != $_smarty_tpl->tpl_vars['auth']->value['user_id'] && $_smarty_tpl->tpl_vars['user_data']->value['company_id'] == $_smarty_tpl->tpl_vars['runtime']->value['company_id'])) { ?> <div id="content_usergroups" class="cm-hide-save-button"> <?php if ($_smarty_tpl->tpl_vars['usergroups']->value) { ?> <table width="100%" class="table table-middle"> <thead> <tr> <th width="50%"><?php echo $_smarty_tpl->__("usergroup"); ?> </th> <th class="right" width="10%"><?php echo $_smarty_tpl->__("status"); ?> </th> </tr> </thead> <?php $_smarty_tpl->tpl_vars['usergroup'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['usergroup']->_loop = false; $_from = $_smarty_tpl->tpl_vars['usergroups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['usergroup']->key => $_smarty_tpl->tpl_vars['usergroup']->value) { $_smarty_tpl->tpl_vars['usergroup']->_loop = true; ?> <tr> <td><a href="<?php echo htmlspecialchars(fn_url("usergroups.manage#group" . (string) $_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup'], ENT_QUOTES, 'UTF-8'); ?> </a></td> <td class="right"> <?php if ($_smarty_tpl->tpl_vars['user_data']->value['usergroups'][$_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id']]) { ?> <?php $_smarty_tpl->tpl_vars["ug_status"] = new Smarty_variable($_smarty_tpl->tpl_vars['user_data']->value['usergroups'][$_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id']]['status'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["ug_status"] = new Smarty_variable("F", null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("common/select_popup.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => $_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id'], 'status' => $_smarty_tpl->tpl_vars['ug_status']->value, 'hidden' => '', 'items_status' => fn_get_predefined_statuses("profiles"), 'extra' => "&user_id=" . (string) $_smarty_tpl->tpl_vars['id']->value, 'update_controller' => "usergroups", 'notify' => true, 'hide_for_vendor' => $_smarty_tpl->tpl_vars['runtime']->value['company_id']), 0); ?> </td> </tr> <?php } ?> </table> <?php } else { ?> <p class="no-items"><?php echo $_smarty_tpl->__("no_data"); ?> </p> <?php } ?> </div> <?php } ?> <?php } ?> <div id="content_addons"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:detailed_content")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:detailed_content"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:detailed_content"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <?php if ($_smarty_tpl->tpl_vars['show_api_tab']->value) { ?> <div id="content_api"> <div class="control-group <?php if ($_smarty_tpl->tpl_vars['hide_api_checkbox']->value) { ?> hidden<?php } ?> "> <div class="controls"> <label class="checkbox" for="sw_api_container"> <input <?php if ($_smarty_tpl->tpl_vars['user_data']->value['api_key'] != '') { ?> checked="checked"<?php } ?> class="cm-combination" type="checkbox" name="user_api_status" value="Y" id="sw_api_container" /><?php echo $_smarty_tpl->__("allow_api_access"); ?> </label> </div> </div> <div id="api_container" <?php if ($_smarty_tpl->tpl_vars['user_data']->value['api_key'] == '') { ?> class="hidden"<?php } ?> > <div class="control-group"> <label class="control-label"><?php echo $_smarty_tpl->__("api_key"); ?> </label> <div class="controls"> <input type="text" class="input-large" name="user_data[api_key]" value="<?php if ($_smarty_tpl->tpl_vars['user_data']->value['api_key']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['user_data']->value['api_key'], ENT_QUOTES, 'UTF-8'); } else { echo htmlspecialchars($_smarty_tpl->tpl_vars['new_api_key']->value, ENT_QUOTES, 'UTF-8'); } ?> " readonly="readonly"/> </div> </div> </div> </div> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:tabs_content")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:tabs_content"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:tabs_content"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php if (!fn_allow_save_object($_smarty_tpl->tpl_vars['user_data']->value, "users") && $_smarty_tpl->tpl_vars['id']->value && $_smarty_tpl->tpl_vars['user_data']->value['user_id'] != $_smarty_tpl->tpl_vars['auth']->value['user_id'] || $_smarty_tpl->tpl_vars['hide_inputs']->value) { ?> <?php $_smarty_tpl->tpl_vars["hide_first_button"] = new Smarty_variable(true, null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['id']->value) { ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:tabs_extra")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:tabs_extra"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:tabs_extra"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo $_smarty_tpl->getSubTemplate("common/tabsbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['tabsbox'], 'group_name' => $_smarty_tpl->tpl_vars['runtime']->value['controller'], 'active_tab' => $_smarty_tpl->tpl_vars['selected_section']->value, 'track' => true), 0); ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if (!$_smarty_tpl->tpl_vars['id']->value) { ?> <?php $_smarty_tpl->tpl_vars["_user_desc"] = new Smarty_variable(fn_get_user_type_description($_smarty_tpl->tpl_vars['user_type']->value), null, 0); ?> <?php ob_start(); echo $_smarty_tpl->__("new_profile"); $_tmp1 = ob_get_clean(); $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_tmp1 . " (" . (string) $_smarty_tpl->tpl_vars['_user_desc']->value . ")", null, 0); } else { ?> <?php if ($_smarty_tpl->tpl_vars['user_data']->value['firstname']) { ?> <?php ob_start(); echo $_smarty_tpl->__("editing_profile"); $_tmp2 = ob_get_clean(); $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_tmp2 . ": " . (string) $_smarty_tpl->tpl_vars['user_data']->value['firstname'] . " " . (string) $_smarty_tpl->tpl_vars['user_data']->value['lastname'], null, 0); ?> <?php } elseif ($_smarty_tpl->tpl_vars['user_data']->value['b_firstname']) { ?> <?php ob_start(); echo $_smarty_tpl->__("editing_profile"); $_tmp3 = ob_get_clean(); $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_tmp3 . ": " . (string) $_smarty_tpl->tpl_vars['user_data']->value['b_firstname'] . " " . (string) $_smarty_tpl->tpl_vars['user_data']->value['b_lastname'], null, 0); ?> <?php } else { ?> <?php ob_start(); echo $_smarty_tpl->__("editing_profile"); $_tmp4 = ob_get_clean(); $_smarty_tpl->tpl_vars["_title"] = new Smarty_variable($_tmp4 . ": " . (string) $_smarty_tpl->tpl_vars['user_data']->value['email'], null, 0); ?> <?php } } ?> <?php $_smarty_tpl->tpl_vars['_title'] = new Smarty_variable(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['_title']->value), null, 0); $_smarty_tpl->tpl_vars["redirect_url"] = new Smarty_variable("profiles.manage%26user_type=" . (string) $_smarty_tpl->tpl_vars['user_data']->value['user_type'], null, 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null); ob_start(); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("tools_list", null, null); ob_start(); ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:update_tools_list")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:update_tools_list"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['user_data']->value['user_type'] == "C") { ?> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("view_all_orders"), 'href' => "orders.manage?user_id=" . (string) $_smarty_tpl->tpl_vars['id']->value)); ?> </li> <?php } ?> <?php if (fn_user_need_login($_smarty_tpl->tpl_vars['user_data']->value['user_type']) && (!$_smarty_tpl->tpl_vars['runtime']->value['company_id'] || $_smarty_tpl->tpl_vars['runtime']->value['company_id'] == $_smarty_tpl->tpl_vars['auth']->value['company_id']) && $_smarty_tpl->tpl_vars['user_data']->value['user_id'] != $_smarty_tpl->tpl_vars['auth']->value['user_id'] && !($_smarty_tpl->tpl_vars['user_data']->value['user_type'] == 'A' && $_smarty_tpl->tpl_vars['user_data']->value['is_root'] == 'Y' && !$_smarty_tpl->tpl_vars['user_data']->value['company_id'])) { ?> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'target' => "_blank", 'text' => __("act_on_behalf"), 'href' => "profiles.act_as_user?user_id=" . (string) $_smarty_tpl->tpl_vars['id']->value)); ?> </li> <li class="divider"></li> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("delete"), 'class' => "cm-confirm cm-post", 'href' => "profiles.delete?user_id=" . (string) $_smarty_tpl->tpl_vars['id']->value . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['redirect_url']->value)); ?> </li> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:update_tools_list"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if ($_smarty_tpl->tpl_vars['id']->value && trim(Smarty::$_smarty_vars['capture']['tools_list']) !== '') { ?> <?php smarty_template_function_dropdown($_smarty_tpl, array('content' => Smarty::$_smarty_vars['capture']['tools_list'])); ?> <?php } ?> <div class="btn-group btn-hover dropleft"> <?php if ($_smarty_tpl->tpl_vars['id']->value) { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/save_changes.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_meta' => "dropdown-toggle", 'but_role' => "submit-link", 'but_name' => "dispatch[profiles." . (string) $_smarty_tpl->tpl_vars['runtime']->value['mode'] . "]", 'but_target_form' => "profile_form", 'save' => $_smarty_tpl->tpl_vars['id']->value), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("create"), 'but_meta' => "dropdown-toggle", 'but_role' => "submit-link", 'but_name' => "dispatch[profiles." . (string) $_smarty_tpl->tpl_vars['runtime']->value['mode'] . "]", 'but_target_form' => "profile_form", 'save' => $_smarty_tpl->tpl_vars['id']->value), 0); ?> <?php } ?> <ul class="dropdown-menu"> <li><a><input type="checkbox" name="notify_customer" value="Y" checked="checked" id="notify_customer" /> <?php echo $_smarty_tpl->__("notify_user"); ?> </a></li> </ul> </div> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['_title']->value, 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'buttons' => Smarty::$_smarty_vars['capture']['buttons']), 0); ?> </form><?php }
function content_55e61e6bba7860_62197896($_smarty_tpl) { if (!is_callable('smarty_block_hook')) { include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php'; } fn_preload_lang_vars(array('user_account_information', 'email', 'password', 'confirm_password', 'account_type', 'customer', 'vendor_administrator', 'administrator', 'tax_exempt', 'language')); echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("user_account_information")), 0); ?> <?php if ($_smarty_tpl->tpl_vars['uid']->value == 1 || fn_check_user_type_admin_area($_smarty_tpl->tpl_vars['user_data']->value) && $_smarty_tpl->tpl_vars['user_data']->value['user_id'] && defined("RESTRICTED_ADMIN") || $_smarty_tpl->tpl_vars['user_data']->value['is_root'] == "Y" || $_smarty_tpl->tpl_vars['auth']->value['is_root'] == "Y" || $_smarty_tpl->tpl_vars['user_data']->value['user_id'] == $_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <input type="hidden" name="user_data[status]" value="A" /> <input type="hidden" name="user_data[user_type]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user_data']->value['user_type'], ENT_QUOTES, 'UTF-8'); ?> " /> <?php } ?> <div class="control-group"> <label for="email" class="control-label cm-required cm-email"><?php echo $_smarty_tpl->__("email"); ?> :</label> <div class="controls"> <input type="text" id="email" name="user_data[email]" class="input-large" size="32" maxlength="128" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user_data']->value['email'], ENT_QUOTES, 'UTF-8'); ?> " /> </div> </div> <div class="control-group"> <label for="password1" class="control-label cm-required"><?php echo $_smarty_tpl->__("password"); ?> :</label> <div class="controls"> <input type="password" id="password1" name="user_data[password1]" class="input-large cm-autocomplete-off" size="32" maxlength="32" value="<?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "update") { ?> <?php } ?> " /> </div> </div> <div class="control-group"> <label for="password2" class="control-label cm-required"><?php echo $_smarty_tpl->__("confirm_password"); ?> :</label> <div class="controls"> <input type="password" id="password2" name="user_data[password2]" class="input-large cm-autocomplete-off" size="32" maxlength="32" value="<?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "update") { ?> <?php } ?> " /> </div> </div> <?php if (($_smarty_tpl->tpl_vars['uid']->value != 1 || defined("RESTRICTED_ADMIN")) && $_smarty_tpl->tpl_vars['user_data']->value['user_id'] != $_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['company_id'] && $_smarty_tpl->tpl_vars['user_data']->value['is_root'] != "Y" || !fn_check_user_type_admin_area($_smarty_tpl->tpl_vars['user_data']->value) || !$_smarty_tpl->tpl_vars['user_data']->value['user_id'] || $_smarty_tpl->tpl_vars['user_data']->value['company_id'] && !$_smarty_tpl->tpl_vars['auth']->value['company_id']) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/select_status.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('input_name' => "user_data[status]", 'id' => "user_data", 'obj' => $_smarty_tpl->tpl_vars['user_data']->value, 'hidden' => false, 'display' => $_smarty_tpl->tpl_vars['display']->value), 0); ?> <?php $_smarty_tpl->tpl_vars["_u_type"] = new Smarty_variable(($tmp = @$_REQUEST['user_type']) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['user_data']->value['user_type'] : $tmp, null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "add") { ?> <input type="hidden" name="user_data[user_type]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_u_type']->value, ENT_QUOTES, 'UTF-8'); ?> " /> <?php } else { ?> <div class="control-group"> <label for="user_type" class="control-label cm-required"><?php echo $_smarty_tpl->__("account_type"); ?> :</label> <?php $_smarty_tpl->tpl_vars["r_url"] = new Smarty_variable(fn_query_remove($_smarty_tpl->tpl_vars['config']->value['current_url'], "user_type"), null, 0); ?> <div class="controls"> <select id="user_type" name="user_data[user_type]"<?php if (!$_smarty_tpl->tpl_vars['redirect_denied']->value) { ?> onchange="Tygh.$.redirect('<?php echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['r_url']->value . "&user_type="), ENT_QUOTES, 'UTF-8'); ?> ' + this.value);"<?php } ?> > <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:account")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:account"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if (!(fn_allowed_for("MULTIVENDOR") && $_smarty_tpl->tpl_vars['runtime']->value['company_id'] && $_smarty_tpl->tpl_vars['_u_type']->value != "A") || $_smarty_tpl->tpl_vars['hide_inputs']->value) { ?> <option value="C" <?php if ($_smarty_tpl->tpl_vars['_u_type']->value == "C") { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__("customer"); ?> </option> <?php } ?> <?php if (@constant('RESTRICTED_ADMIN') != 1 || $_smarty_tpl->tpl_vars['user_data']->value['user_id'] == $_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <?php if (fn_allowed_for("MULTIVENDOR")) { ?> <option value="V" <?php if ($_smarty_tpl->tpl_vars['_u_type']->value == "V") { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__("vendor_administrator"); ?> </option> <?php } ?> <?php if (fn_allowed_for("ULTIMATE") || $_smarty_tpl->tpl_vars['_u_type']->value == "A") { ?> <option value="A" <?php if ($_smarty_tpl->tpl_vars['_u_type']->value == "A") { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__("administrator"); ?> </option> <?php } ?> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:account"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </select> </div> </div> <?php } ?> <div class="control-group"> <label class="control-label" for="tax_exempt"><?php echo $_smarty_tpl->__("tax_exempt"); ?> :</label> <input type="hidden" name="user_data[tax_exempt]" value="N" /> <div class="controls"> <input id="tax_exempt" type="checkbox" name="user_data[tax_exempt]" value="Y" <?php if ($_smarty_tpl->tpl_vars['user_data']->value['tax_exempt'] == "Y") { ?> checked="checked"<?php } ?> /> </div> </div> <?php } } ?> <div class="control-group"> <label class="control-label" for="user_language"><?php echo $_smarty_tpl->__("language"); ?> </label> <div class="controls"> <select name="user_data[lang_code]" id="user_language"> <?php $_smarty_tpl->tpl_vars["language"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["language"]->_loop = false; $_smarty_tpl->tpl_vars["lang_code"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['languages']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["language"]->key => $_smarty_tpl->tpl_vars["language"]->value) { $_smarty_tpl->tpl_vars["language"]->_loop = true; $_smarty_tpl->tpl_vars["lang_code"]->value = $_smarty_tpl->tpl_vars["language"]->key; ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['lang_code']->value, ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['lang_code']->value == $_smarty_tpl->tpl_vars['user_data']->value['lang_code']) { ?> selected="selected"<?php } ?> ><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language']->value['name'], ENT_QUOTES, 'UTF-8'); ?> </option> <?php } ?> </select> </div> </div> <?php }
function content_55d5c539a11507_47603819($_smarty_tpl) { if (!is_callable('smarty_block_hook')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php'; } if (!is_callable('smarty_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } fn_preload_lang_vars(array('text_profile_benefits', 'register_new_account', 'contact_information', 'select_profile', 'text_multiprofile_notice', 'billing_address', 'shipping_address', 'shipping_address', 'billing_address', 'revert', 'usergroup', 'status', 'action', 'active', 'remove', 'available', 'join', 'declined', 'join', 'pending', 'cancel', 'profile_details', 'text_profile_benefits', 'register_new_account', 'contact_information', 'select_profile', 'text_multiprofile_notice', 'billing_address', 'shipping_address', 'shipping_address', 'billing_address', 'revert', 'usergroup', 'status', 'action', 'active', 'remove', 'available', 'join', 'declined', 'join', 'pending', 'cancel', 'profile_details')); if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") { $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null); ob_start(); echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <span style="display: none" class="ls_test_profile_fields"><?php echo htmlspecialchars(var_dump($_smarty_tpl->tpl_vars['profile_fields']->value), ENT_QUOTES, 'UTF-8'); ?> </span> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "add" && $_smarty_tpl->tpl_vars['settings']->value['General']['quick_registration'] == "Y") { ?> <div class="ty-account"> <form name="profiles_register_form" action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post"> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => "C", 'nothing_extra' => "Y", 'register' => true), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_account.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('nothing_extra' => "Y", 'location' => "checkout", 'register' => true, 'section' => "C"), 0); ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:checkout_steps")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:checkout_steps"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:checkout_steps"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php $_smarty_tpl->tpl_vars["image_verification"] = new Smarty_variable($_smarty_tpl->getSubTemplate("common/image_verification.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('option' => "use_for_register", 'align' => "left"), 0)); ?> <?php if ($_smarty_tpl->tpl_vars['image_verification']->value) { ?> <div class="ty-control-group"> <?php echo $_smarty_tpl->tpl_vars['image_verification']->value; ?> </div> <?php } ?> <div class="ty-account-benefits"> <?php echo $_smarty_tpl->__("text_profile_benefits"); ?> </div> <div class="ty-profile-field__buttons buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/register_profile.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[profiles.update]"), 0); ?> </div> </form> </div> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null); ob_start(); echo $_smarty_tpl->__("register_new_account"); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } } else { ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/profile_home_menu.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("tabsbox", null, null); ob_start(); ?> <div class="ty-profile-field ty-account form-wrap" id="content_general"> <form name="profile_form" action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post" enctype="multipart/form-data"> <input id="selected_section" type="hidden" value="general" name="selected_section"/> <input id="default_card_id" type="hidden" value="" name="default_cc"/> <input type="hidden" name="profile_id" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user_data']->value['profile_id'], ENT_QUOTES, 'UTF-8'); ?> " /> <?php $_smarty_tpl->_capture_stack[0][] = array("group", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => "C", 'title' => __("contact_information"), 'ls_upload_img_container' => true), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_account.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("blocks/static_templates/profile_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php if ($_smarty_tpl->tpl_vars['profile_fields']->value['B'] || $_smarty_tpl->tpl_vars['profile_fields']->value['S']) { ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['user_multiple_profiles'] == "Y" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "update") { ?> <div class="clearfix profiles-profile_fields ls_select_profile_wrapper ls_profile_left_container"> <h3 class="ty-subheader"> <?php echo $_smarty_tpl->__("select_profile"); ?> </h3> <div class="ls_profile_contact_details_container"> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/multiple_profiles.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('profile_id' => $_smarty_tpl->tpl_vars['user_data']->value['profile_id']), 0); ?> </div> <div class="ls_profile_contact_details_container"> <p><?php echo $_smarty_tpl->__("text_multiprofile_notice"); ?> </p> </div> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['address_position'] == "billing_first") { ?> <?php $_smarty_tpl->tpl_vars["first_section"] = new Smarty_variable("B", null, 0); ?> <?php $_smarty_tpl->tpl_vars["first_section_text"] = new Smarty_variable($_smarty_tpl->__("billing_address"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["sec_section"] = new Smarty_variable("S", null, 0); ?> <?php $_smarty_tpl->tpl_vars["sec_section_text"] = new Smarty_variable($_smarty_tpl->__("shipping_address"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["body_id"] = new Smarty_variable("sa", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["first_section"] = new Smarty_variable("S", null, 0); ?> <?php $_smarty_tpl->tpl_vars["first_section_text"] = new Smarty_variable($_smarty_tpl->__("shipping_address"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["sec_section"] = new Smarty_variable("B", null, 0); ?> <?php $_smarty_tpl->tpl_vars["sec_section_text"] = new Smarty_variable($_smarty_tpl->__("billing_address"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["body_id"] = new Smarty_variable("ba", null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => $_smarty_tpl->tpl_vars['first_section']->value, 'body_id' => '', 'ship_to_another' => false, 'title' => $_smarty_tpl->tpl_vars['first_section_text']->value), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => $_smarty_tpl->tpl_vars['sec_section']->value, 'body_id' => $_smarty_tpl->tpl_vars['body_id']->value, 'ship_to_another' => $_smarty_tpl->tpl_vars['ship_to_another']->value, 'title' => $_smarty_tpl->tpl_vars['sec_section_text']->value, 'address_flag' => fn_compare_shipping_billing($_smarty_tpl->tpl_vars['profile_fields']->value)), 0); ?> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:account_update")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:account_update"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:account_update"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php echo $_smarty_tpl->getSubTemplate("common/image_verification.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('option' => "use_for_register", 'align' => "center"), 0); ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo Smarty::$_smarty_vars['capture']['group']; ?> <div class="ty-profile-field__buttons buttons-container"> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "add") { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/register_profile.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[profiles.update]", 'but_id' => "save_profile_but"), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/save.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[profiles.update]", 'but_meta' => "ty-btn__secondary", 'but_id' => "save_profile_but"), 0); ?> <input class="ty-profile-field__reset ty-btn ty-btn__tertiary" type="reset" name="reset" value="<?php echo $_smarty_tpl->__("revert"); ?> " id="shipping_address_reset"/> <script type="text/javascript"> (function(_, $) { var address_switch = $('input:radio:checked', '.ty-address-switch'); $("#shipping_address_reset").on("click", function(e) { setTimeout(function() { address_switch.click(); }, 50); }); }(Tygh, Tygh.$)); </script> <?php } ?> </div> </form> </div> <?php $_smarty_tpl->_capture_stack[0][] = array("additional_tabs", null, null); ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "update") { ?> <?php if (!fn_allowed_for("ULTIMATE:FREE")) { ?> <?php if ($_smarty_tpl->tpl_vars['usergroups']->value && !fn_check_user_type_admin_area($_smarty_tpl->tpl_vars['user_data']->value)) { ?> <div id="content_usergroups"> <table class="ty-table"> <tr> <th style="width: 30%"><?php echo $_smarty_tpl->__("usergroup"); ?> </th> <th style="width: 30%"><?php echo $_smarty_tpl->__("status"); ?> </th> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_usergroup_signup'] == "Y") { ?> <th style="width: 40%"><?php echo $_smarty_tpl->__("action"); ?> </th> <?php } ?> </tr> <?php $_smarty_tpl->tpl_vars['usergroup'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['usergroup']->_loop = false; $_from = $_smarty_tpl->tpl_vars['usergroups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['usergroup']->key => $_smarty_tpl->tpl_vars['usergroup']->value) { $_smarty_tpl->tpl_vars['usergroup']->_loop = true; ?> <?php if ($_smarty_tpl->tpl_vars['user_data']->value['usergroups'][$_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id']]) { ?> <?php $_smarty_tpl->tpl_vars["ug_status"] = new Smarty_variable($_smarty_tpl->tpl_vars['user_data']->value['usergroups'][$_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id']]['status'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["ug_status"] = new Smarty_variable("F", null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_usergroup_signup'] == "Y" || $_smarty_tpl->tpl_vars['settings']->value['General']['allow_usergroup_signup'] != "Y" && $_smarty_tpl->tpl_vars['ug_status']->value == "A") { ?> <tr> <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup'], ENT_QUOTES, 'UTF-8'); ?> </td> <td class="ty-center"> <?php if ($_smarty_tpl->tpl_vars['ug_status']->value == "A") { ?> <?php echo $_smarty_tpl->__("active"); ?> <?php $_smarty_tpl->tpl_vars["_link_text"] = new Smarty_variable($_smarty_tpl->__("remove"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["_req_type"] = new Smarty_variable("cancel", null, 0); ?> <?php } elseif ($_smarty_tpl->tpl_vars['ug_status']->value == "F") { ?> <?php echo $_smarty_tpl->__("available"); ?> <?php $_smarty_tpl->tpl_vars["_link_text"] = new Smarty_variable($_smarty_tpl->__("join"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["_req_type"] = new Smarty_variable("join", null, 0); ?> <?php } elseif ($_smarty_tpl->tpl_vars['ug_status']->value == "D") { ?> <?php echo $_smarty_tpl->__("declined"); ?> <?php $_smarty_tpl->tpl_vars["_link_text"] = new Smarty_variable($_smarty_tpl->__("join"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["_req_type"] = new Smarty_variable("join", null, 0); ?> <?php } elseif ($_smarty_tpl->tpl_vars['ug_status']->value == "P") { ?> <?php echo $_smarty_tpl->__("pending"); ?> <?php $_smarty_tpl->tpl_vars["_link_text"] = new Smarty_variable($_smarty_tpl->__("cancel"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["_req_type"] = new Smarty_variable("cancel", null, 0); ?> <?php } ?> </td> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_usergroup_signup'] == "Y") { ?> <td> <a class="cm-ajax" data-ca-target-id="content_usergroups" href="<?php echo htmlspecialchars(fn_url("profiles.usergroups?usergroup_id=" . (string) $_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id'] . "&type=" . (string) $_smarty_tpl->tpl_vars['_req_type']->value), ENT_QUOTES, 'UTF-8'); ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_link_text']->value, ENT_QUOTES, 'UTF-8'); ?> </a> </td> <?php } ?> </tr> <?php } ?> <?php } ?> </table> <!--content_usergroups--></div> <?php } ?> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:tabs")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:tabs"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:tabs"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo Smarty::$_smarty_vars['capture']['additional_tabs']; ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if (trim(Smarty::$_smarty_vars['capture']['additional_tabs']) != '') { ?> <?php echo $_smarty_tpl->getSubTemplate("common/tabsbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['tabsbox'], 'active_tab' => $_REQUEST['selected_section'], 'track' => true), 0); ?> <?php } else { ?> <?php echo Smarty::$_smarty_vars['capture']['tabsbox']; ?> <?php } ?> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null); ob_start(); echo $_smarty_tpl->__("profile_details"); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } } list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } if (trim(Smarty::$_smarty_vars['capture']['template_content'])) { if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") { ?> <span class="cm-template-box template-box" data-ca-te-template="views/profiles/update.tpl" id="<?php echo smarty_function_set_id(array('name' => "views/profiles/update.tpl"), $_smarty_tpl); ?> "><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php echo Smarty::$_smarty_vars['capture']['template_content']; ?> <!--[/tpl_id]--></span><?php } else { echo Smarty::$_smarty_vars['capture']['template_content']; } } } else { echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <span style="display: none" class="ls_test_profile_fields"><?php echo htmlspecialchars(var_dump($_smarty_tpl->tpl_vars['profile_fields']->value), ENT_QUOTES, 'UTF-8'); ?> </span> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "add" && $_smarty_tpl->tpl_vars['settings']->value['General']['quick_registration'] == "Y") { ?> <div class="ty-account"> <form name="profiles_register_form" action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post"> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => "C", 'nothing_extra' => "Y", 'register' => true), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_account.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('nothing_extra' => "Y", 'location' => "checkout", 'register' => true, 'section' => "C"), 0); ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:checkout_steps")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:checkout_steps"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:checkout_steps"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php $_smarty_tpl->tpl_vars["image_verification"] = new Smarty_variable($_smarty_tpl->getSubTemplate("common/image_verification.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('option' => "use_for_register", 'align' => "left"), 0)); ?> <?php if ($_smarty_tpl->tpl_vars['image_verification']->value) { ?> <div class="ty-control-group"> <?php echo $_smarty_tpl->tpl_vars['image_verification']->value; ?> </div> <?php } ?> <div class="ty-account-benefits"> <?php echo $_smarty_tpl->__("text_profile_benefits"); ?> </div> <div class="ty-profile-field__buttons buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/register_profile.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[profiles.update]"), 0); ?> </div> </form> </div> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null); ob_start(); echo $_smarty_tpl->__("register_new_account"); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } } else { ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/profile_home_menu.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("tabsbox", null, null); ob_start(); ?> <div class="ty-profile-field ty-account form-wrap" id="content_general"> <form name="profile_form" action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post" enctype="multipart/form-data"> <input id="selected_section" type="hidden" value="general" name="selected_section"/> <input id="default_card_id" type="hidden" value="" name="default_cc"/> <input type="hidden" name="profile_id" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user_data']->value['profile_id'], ENT_QUOTES, 'UTF-8'); ?> " /> <?php $_smarty_tpl->_capture_stack[0][] = array("group", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => "C", 'title' => __("contact_information"), 'ls_upload_img_container' => true), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_account.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("blocks/static_templates/profile_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php if ($_smarty_tpl->tpl_vars['profile_fields']->value['B'] || $_smarty_tpl->tpl_vars['profile_fields']->value['S']) { ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['user_multiple_profiles'] == "Y" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "update") { ?> <div class="clearfix profiles-profile_fields ls_select_profile_wrapper ls_profile_left_container"> <h3 class="ty-subheader"> <?php echo $_smarty_tpl->__("select_profile"); ?> </h3> <div class="ls_profile_contact_details_container"> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/multiple_profiles.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('profile_id' => $_smarty_tpl->tpl_vars['user_data']->value['profile_id']), 0); ?> </div> <div class="ls_profile_contact_details_container"> <p><?php echo $_smarty_tpl->__("text_multiprofile_notice"); ?> </p> </div> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['address_position'] == "billing_first") { ?> <?php $_smarty_tpl->tpl_vars["first_section"] = new Smarty_variable("B", null, 0); ?> <?php $_smarty_tpl->tpl_vars["first_section_text"] = new Smarty_variable($_smarty_tpl->__("billing_address"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["sec_section"] = new Smarty_variable("S", null, 0); ?> <?php $_smarty_tpl->tpl_vars["sec_section_text"] = new Smarty_variable($_smarty_tpl->__("shipping_address"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["body_id"] = new Smarty_variable("sa", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["first_section"] = new Smarty_variable("S", null, 0); ?> <?php $_smarty_tpl->tpl_vars["first_section_text"] = new Smarty_variable($_smarty_tpl->__("shipping_address"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["sec_section"] = new Smarty_variable("B", null, 0); ?> <?php $_smarty_tpl->tpl_vars["sec_section_text"] = new Smarty_variable($_smarty_tpl->__("billing_address"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["body_id"] = new Smarty_variable("ba", null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => $_smarty_tpl->tpl_vars['first_section']->value, 'body_id' => '', 'ship_to_another' => false, 'title' => $_smarty_tpl->tpl_vars['first_section_text']->value), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profile_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section' => $_smarty_tpl->tpl_vars['sec_section']->value, 'body_id' => $_smarty_tpl->tpl_vars['body_id']->value, 'ship_to_another' => $_smarty_tpl->tpl_vars['ship_to_another']->value, 'title' => $_smarty_tpl->tpl_vars['sec_section_text']->value, 'address_flag' => fn_compare_shipping_billing($_smarty_tpl->tpl_vars['profile_fields']->value)), 0); ?> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:account_update")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:account_update"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:account_update"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php echo $_smarty_tpl->getSubTemplate("common/image_verification.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('option' => "use_for_register", 'align' => "center"), 0); ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo Smarty::$_smarty_vars['capture']['group']; ?> <div class="ty-profile-field__buttons buttons-container"> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "add") { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/register_profile.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[profiles.update]", 'but_id' => "save_profile_but"), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/save.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[profiles.update]", 'but_meta' => "ty-btn__secondary", 'but_id' => "save_profile_but"), 0); ?> <input class="ty-profile-field__reset ty-btn ty-btn__tertiary" type="reset" name="reset" value="<?php echo $_smarty_tpl->__("revert"); ?> " id="shipping_address_reset"/> <script type="text/javascript"> (function(_, $) { var address_switch = $('input:radio:checked', '.ty-address-switch'); $("#shipping_address_reset").on("click", function(e) { setTimeout(function() { address_switch.click(); }, 50); }); }(Tygh, Tygh.$)); </script> <?php } ?> </div> </form> </div> <?php $_smarty_tpl->_capture_stack[0][] = array("additional_tabs", null, null); ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "update") { ?> <?php if (!fn_allowed_for("ULTIMATE:FREE")) { ?> <?php if ($_smarty_tpl->tpl_vars['usergroups']->value && !fn_check_user_type_admin_area($_smarty_tpl->tpl_vars['user_data']->value)) { ?> <div id="content_usergroups"> <table class="ty-table"> <tr> <th style="width: 30%"><?php echo $_smarty_tpl->__("usergroup"); ?> </th> <th style="width: 30%"><?php echo $_smarty_tpl->__("status"); ?> </th> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_usergroup_signup'] == "Y") { ?> <th style="width: 40%"><?php echo $_smarty_tpl->__("action"); ?> </th> <?php } ?> </tr> <?php $_smarty_tpl->tpl_vars['usergroup'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['usergroup']->_loop = false; $_from = $_smarty_tpl->tpl_vars['usergroups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['usergroup']->key => $_smarty_tpl->tpl_vars['usergroup']->value) { $_smarty_tpl->tpl_vars['usergroup']->_loop = true; ?> <?php if ($_smarty_tpl->tpl_vars['user_data']->value['usergroups'][$_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id']]) { ?> <?php $_smarty_tpl->tpl_vars["ug_status"] = new Smarty_variable($_smarty_tpl->tpl_vars['user_data']->value['usergroups'][$_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id']]['status'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["ug_status"] = new Smarty_variable("F", null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_usergroup_signup'] == "Y" || $_smarty_tpl->tpl_vars['settings']->value['General']['allow_usergroup_signup'] != "Y" && $_smarty_tpl->tpl_vars['ug_status']->value == "A") { ?> <tr> <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['usergroup']->value['usergroup'], ENT_QUOTES, 'UTF-8'); ?> </td> <td class="ty-center"> <?php if ($_smarty_tpl->tpl_vars['ug_status']->value == "A") { ?> <?php echo $_smarty_tpl->__("active"); ?> <?php $_smarty_tpl->tpl_vars["_link_text"] = new Smarty_variable($_smarty_tpl->__("remove"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["_req_type"] = new Smarty_variable("cancel", null, 0); ?> <?php } elseif ($_smarty_tpl->tpl_vars['ug_status']->value == "F") { ?> <?php echo $_smarty_tpl->__("available"); ?> <?php $_smarty_tpl->tpl_vars["_link_text"] = new Smarty_variable($_smarty_tpl->__("join"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["_req_type"] = new Smarty_variable("join", null, 0); ?> <?php } elseif ($_smarty_tpl->tpl_vars['ug_status']->value == "D") { ?> <?php echo $_smarty_tpl->__("declined"); ?> <?php $_smarty_tpl->tpl_vars["_link_text"] = new Smarty_variable($_smarty_tpl->__("join"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["_req_type"] = new Smarty_variable("join", null, 0); ?> <?php } elseif ($_smarty_tpl->tpl_vars['ug_status']->value == "P") { ?> <?php echo $_smarty_tpl->__("pending"); ?> <?php $_smarty_tpl->tpl_vars["_link_text"] = new Smarty_variable($_smarty_tpl->__("cancel"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["_req_type"] = new Smarty_variable("cancel", null, 0); ?> <?php } ?> </td> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_usergroup_signup'] == "Y") { ?> <td> <a class="cm-ajax" data-ca-target-id="content_usergroups" href="<?php echo htmlspecialchars(fn_url("profiles.usergroups?usergroup_id=" . (string) $_smarty_tpl->tpl_vars['usergroup']->value['usergroup_id'] . "&type=" . (string) $_smarty_tpl->tpl_vars['_req_type']->value), ENT_QUOTES, 'UTF-8'); ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_link_text']->value, ENT_QUOTES, 'UTF-8'); ?> </a> </td> <?php } ?> </tr> <?php } ?> <?php } ?> </table> <!--content_usergroups--></div> <?php } ?> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "profiles:tabs")); $_block_repeat = true; echo smarty_block_hook(array('name' => "profiles:tabs"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "profiles:tabs"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo Smarty::$_smarty_vars['capture']['additional_tabs']; ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if (trim(Smarty::$_smarty_vars['capture']['additional_tabs']) != '') { ?> <?php echo $_smarty_tpl->getSubTemplate("common/tabsbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['tabsbox'], 'active_tab' => $_REQUEST['selected_section'], 'track' => true), 0); ?> <?php } else { ?> <?php echo Smarty::$_smarty_vars['capture']['tabsbox']; ?> <?php } ?> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null); ob_start(); echo $_smarty_tpl->__("profile_details"); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } } } }
protected function changeUserToGroupLink($group_id, $params) { $status = Response::STATUS_BAD_REQUEST; $data = array(); $user_data = $this->getParentData(); $valid_params = true; if (empty($params['status'])) { $data['message'] = __('api_required_field', array('[field]' => 'status')); $valid_params = false; } $group_type = db_get_field("SELECT `type` FROM ?:usergroups WHERE usergroup_id = ?i", $group_id); if (empty($group_type) || $group_type == 'A' && !in_array($user_data['user_type'], array('A', 'V'))) { $valid_params = false; } $runtime_company_id = Registry::get('runtime.company_id'); if (((!fn_check_user_type_admin_area($user_data) || !$user_data['user_id']) && !$runtime_company_id || fn_check_user_type_admin_area($user_data) && $user_data['user_id'] && !$runtime_company_id && $this->auth['is_root'] == 'Y' && ($user_data['company_id'] != 0 || $user_data['company_id'] == 0 && $user_data['is_root'] != 'Y') || $user_data['user_type'] == 'V' && $runtime_company_id && $this->auth['is_root'] == 'Y' && $user_data['user_id'] != $this->auth['user_id'] && $user_data['company_id'] == $runtime_company_id) && $valid_params) { fn_change_usergroup_status($params['status'], $user_data['user_id'], $group_id, fn_get_notification_rules($params)); if ($params['status'] == 'F') { $status = Response::STATUS_NO_CONTENT; $data['message'] = 'OK'; } else { $status = Response::STATUS_OK; $data['message'] = __('status_changed'); } } return array('status' => $status, 'data' => $data); }
function fn_ult_get_user_info_before(&$condition, &$user_id, &$user_fields) { $usertype = db_get_field('SELECT user_type FROM ?:users WHERE user_id = ?i', $user_id); if (Registry::get('settings.Stores.share_users') == 'Y' || fn_check_user_type_admin_area($usertype)) { if (AREA == 'A') { if (Registry::get('runtime.company_id') && !defined('ORDER_MANAGEMENT')) { $company_customers_ids = db_get_fields("SELECT user_id FROM ?:orders WHERE company_id = ?i", Registry::get('runtime.company_id')); $company_id = db_get_field('SELECT company_id FROM ?:users WHERE user_id = ?i', $user_id); if ($company_id == Registry::get('runtime.company_id') || in_array($user_id, $company_customers_ids) || fn_ult_check_users_usergroup_companies($user_id)) { $condition = ''; } } else { $condition = ''; } } elseif (AREA == 'C') { $condition = ''; } } }
function fn_twg_api_auth_routines($user_login, $password) { $status = true; $field = Registry::get('settings.General.use_email_as_login') == 'Y' ? 'email' : 'user_login'; $condition = ''; if (fn_allowed_for('ULTIMATE')) { if (Registry::get('settings.Stores.share_users') == 'N' && AREA != 'A') { $condition = fn_get_company_condition('?:users.company_id'); } } $user_data = db_get_row("SELECT *\n FROM ?:users\n WHERE {$field} = ?s" . $condition, $user_login); if (empty($user_data)) { $user_data = db_get_row("SELECT *\n FROM ?:users\n WHERE {$field} = ?s AND user_type IN ('A', 'V', 'P')", $user_login); } if (!empty($user_data)) { $user_data['usergroups'] = fn_get_user_usergroups($user_data['user_id']); } if (!empty($user_data) && (!fn_check_user_type_admin_area($user_data) && AREA == 'A' || !fn_check_user_type_access_rules($user_data))) { fn_set_notification('E', __('error'), __('error_area_access_denied')); $status = false; } if (!empty($user_data['status']) && $user_data['status'] == 'D') { fn_set_notification('E', __('error'), __('error_account_disabled')); $status = false; } $salt = isset($user_data['salt']) ? $user_data['salt'] : ''; return array($status, $user_data, $user_login, $password, $salt); }
function fn_send_usergroup_status_notification($user_id, $usergroup_ids, $status) { $user_data = fn_get_user_info($user_id); $prefix = $status == 'A' ? 'activation' : 'disactivation'; Mailer::sendMail(array('to' => $user_data['email'], 'from' => 'company_users_department', 'data' => array('user_data' => $user_data, 'usergroups' => fn_get_usergroups('F', $user_data['lang_code']), 'usergroup_ids' => $usergroup_ids), 'tpl' => 'profiles/usergroup_' . $prefix . '.tpl', 'company_id' => $user_data['company_id']), fn_check_user_type_admin_area($user_data['user_type']) ? 'A' : 'C', $user_data['lang_code']); }