function fn_ebay_check_license($silent = false, $skip_messages = false) { // addons.ebay.ebay_license_number $license_number = Registry::get(str_rot13('nqqbaf.ronl.ronl_yvprafr_ahzore')); $_SESSION['eauth'] = time(); if (empty($license_number)) { if (!$silent) { // ebay_empty_license_number fn_set_notification('E', __('error'), __(str_rot13('ronl_rzcgl_yvprafr_ahzore'))); } return false; } else { // Some HD checking code $data = Helpdesk::getLicenseInformation($license_number, array('edition' => 'EBAY')); list($license_status, , $messages) = Helpdesk::parseLicenseInformation($data, array(), false); if (!empty($messages) && !$skip_messages) { foreach ($messages as $message) { fn_set_notification($message['type'], $message['title'], $message['text']); } } if ($license_status == 'ACTIVE') { return 'A'; } elseif ($license_status == '') { // Timeout fn_set_notification('E', __('error'), __('unable_to_check_license')); return 'T'; } else { return 'I'; } } }
function fn_settings_actions_upgrade_center_license_number(&$new_value, &$old_value) { if (empty($new_value)) { $new_value = $old_value; fn_set_notification('E', __('error'), __('license_number_cannot_be_empty')); return false; } $mode = fn_get_storage_data('store_mode'); $data = Helpdesk::getLicenseInformation($new_value); list($license_status, $updates, $messages) = Helpdesk::parseLicenseInformation($data, $_SESSION['auth'], true); if ($license_status == 'ACTIVE' && ($mode != 'full' || empty($old_value))) { fn_set_storage_data('store_mode', 'full'); $_SESSION['mode_recheck'] = true; } else { if ($license_status != 'ACTIVE') { $new_value = $old_value; } } }
function fn_ebay_check_license($silent = false, $skip_messages = false) { // addons.ebay.ebay_license_number $license_number = Registry::get(str_rot13('nqqbaf.ronl.ronl_yvprafr_ahzore')); Tygh::$app['session']['eauth'] = time(); if (empty($license_number)) { if (!$silent) { // ebay_empty_license_number fn_set_notification('E', __('error'), __(str_rot13('ronl_rzcgl_yvprafr_ahzore'))); } return false; } else { // Some HD checking code $data = Helpdesk::getLicenseInformation($license_number, array('edition' => 'EBAY')); list($license_status, , $messages, $params) = Helpdesk::parseLicenseInformation($data, array(), false); if (!$skip_messages) { foreach ($messages as $key => $message) { if ($message['type'] == 'E') { fn_set_notification($message['type'], $message['title'], $message['text']); } } } if (isset($params['trial_left_time'])) { fn_set_storage_data('ebay_trial_expiry_time', TIME + $params['trial_left_time']); } if (in_array($license_status, array('ACTIVE', 'TRIAL'))) { return 'A'; } elseif ($license_status == '') { // Timeout fn_set_notification('E', __('error'), __('unable_to_check_license')); return 'T'; } else { return 'I'; } } }
Settings::instance()->resetAllVendorsSettings($k); } } } $_suffix = ".manage"; if (defined('AJAX_REQUEST')) { exit; } } if ($mode == 'change_store_mode') { if ($_REQUEST['store_mode'] == 'full') { if (empty($_REQUEST['license_number'])) { fn_set_storage_data('store_mode_errors', serialize(array('empty_number' => array('type' => 'E', 'title' => __('error'), 'text' => __('license_number_cannot_be_empty'))))); } else { $data = Helpdesk::getLicenseInformation($_REQUEST['license_number'], array('store_mode_selector' => 'Y')); list($license_status, $updates, $messages) = Helpdesk::parseLicenseInformation($data, $auth, false); if ($license_status == 'ACTIVE') { // Save data Settings::instance()->updateValue('license_number', $_REQUEST['license_number']); fn_set_storage_data('store_mode', 'full'); } else { if (empty($messages)) { $messages['unable_to_check'] = array('type' => 'E', 'title' => __('error'), 'text' => __('unable_to_check_license')); } fn_set_storage_data('store_mode_errors', serialize($messages)); fn_set_storage_data('store_mode_license', $_REQUEST['license_number']); } $_SESSION['mode_recheck'] = true; } } else { // Free or Trial mode
public function AddItems($products = array(), $template, $images_data) { $credentials = $this->credentials; $currency = CART_PRIMARY_CURRENCY; $company = fn_get_company_placement_info(0); $site = $template['site']; $items = ''; $i = 0; $item_hashes = array(); foreach ($products as $k => $product) { $i += 1; $shipping = $this->prepareShipping($product, $template); $price = fn_format_price($product['price']); $uuid = md5($product['product_id'] . Helpdesk::getStoreKey() . $product['ebay_template_id']); $payments = '<PaymentMethods>' . implode("</PaymentMethods>\n<PaymentMethods>", $template['payment_methods']) . '</PaymentMethods>'; if (in_array('PayPal', $template['payment_methods'])) { $payments .= "\n<PayPalEmailAddress>{$template['paypal_email']}</PayPalEmailAddress>"; } if ($product['override'] == "Y") { $title = substr(strip_tags($product['ebay_title']), 0, 80); $description = !empty($product['ebay_description']) ? $product['ebay_description'] : $product['full_description']; } else { $title = substr(strip_tags($product['product']), 0, 80); $description = $product['full_description']; } $hash_data = array('price' => $price, 'title' => $title, 'description' => $description); $picture_details = ''; if (!empty($product['main_pair']) && !empty($product['main_pair']['detailed']) && !empty($product['main_pair']['detailed']['http_image_path'])) { if ($images_data[md5($product['main_pair']['detailed']['http_image_path'])]) { $picture_details .= "<PictureURL>" . $images_data[md5($product['main_pair']['detailed']['http_image_path'])] . "</PictureURL>\n"; } else { $picture_details .= "<PictureURL>" . $product['main_pair']['detailed']['http_image_path'] . "</PictureURL>\n"; } } if ($product['image_pairs']) { foreach ($product['image_pairs'] as $image_pair) { if (!empty($image_pair['detailed']) && !empty($image_pair['detailed']['http_image_path'])) { if ($images_data[md5($image_pair['detailed']['http_image_path'])]) { $picture_details .= "<PictureURL>" . $images_data[md5($image_pair['detailed']['http_image_path'])] . "</PictureURL>\n"; } } } } $picture_details = empty($picture_details) ? '' : "<PictureDetails>\n{$picture_details}</PictureDetails>"; $product_features = ''; if (!empty($product['product_features'])) { $hash_data['product_features'] = serialize($product['product_features']); $product_features = '<ItemSpecifics>' . fn_prepare_xml_product_features($product['product_features']) . '</ItemSpecifics>'; } $product_options = ''; $inventory_combinations = db_get_array("SELECT combination FROM ?:product_options_inventory WHERE product_id = ?i AND amount > 0 AND combination != ''", $product['product_id']); if (!empty($product['product_options']) && !empty($inventory_combinations)) { $params = array('page' => 1, 'product_id' => $product['product_id']); $product_options = '<Variations>' . fn_prepare_xml_product_options($params, $product, $images_data) . '</Variations>'; } if (empty($product_options)) { $start_price = <<<EOT <StartPrice currencyID="{$currency}">{$price}</StartPrice> EOT; $product_quantity = <<<EOT <Quantity>{$product['amount']}</Quantity> EOT; } else { $start_price = ''; $product_quantity = ''; } $product_out_of_weight = array(); if ($product['weight'] == 0) { $product_out_of_weight[] = $product['product_id']; } $location = fn_get_country_name($company['company_country']); $items .= <<<EOT <AddItemRequestContainer> <MessageID>{$i}</MessageID> <Item> <UUID>{$uuid}</UUID> <Site>{$site}</Site> <ListingType>FixedPriceItem</ListingType> <Currency>{$currency}</Currency> <PrimaryCategory> <CategoryID>{$template['category']}</CategoryID> </PrimaryCategory> <SecondaryCategory> <CategoryID>{$template['sec_category']}</CategoryID> </SecondaryCategory> <ConditionID>{$template['condition_id']}</ConditionID> <CategoryMappingAllowed>true</CategoryMappingAllowed> <Country>{$company['company_country']}</Country> <PostalCode>{$company['company_zipcode']}</PostalCode> <Location>{$location}</Location> <Title><![CDATA[{$title}]]></Title> <Description><![CDATA[{$description}]]></Description> {$payments} <ListingDuration>{$template['ebay_duration']}</ListingDuration> <DispatchTimeMax>{$template['dispatch_days']}</DispatchTimeMax> {$shipping} {$picture_details} {$product_features} {$product_options} {$start_price} {$product_quantity} </Item> </AddItemRequestContainer> EOT; $item_hashes[$k] = fn_crc32(implode('_', $hash_data)); } $xml = <<<EOT <?xml version="1.0" encoding="utf-8"?> <AddItemsRequest xmlns="urn:ebay:apis:eBLBaseComponents"> {$credentials} <MessageID>1</MessageID> {$items} </AddItemsRequest> EOT; list($trans_id, $result) = $this->_request($xml, 'AddItems'); $_result = array(); if ($result->Ack != 'Failure') { if ($result->AddItemResponseContainer) { $count = 0; foreach ($result->AddItemResponseContainer as $k => $item) { if (!empty($item->Errors)) { $this->_errors($item, $trans_id, 'AddItems'); } $_result[$count] = (array) $item; $_result[$count]['product_hash'] = $item_hashes[$count]; $count++; } } } if (!empty($product_out_of_weight) && $template['shipping_type'] == 'C') { fn_set_notification('W', __('warning'), __('product_out_of_weight', array("[ids]" => implode(",", $product_out_of_weight)))); } return array($trans_id, $_result); }
// // Success login // if (!empty($user_data) && !empty($password) && fn_generate_salted_password($password, $salt) == $user_data['password']) { // Regenerate session_id for security reasons Session::regenerateId(); // // If customer placed orders before login, assign these orders to this account // if (!empty($auth['order_ids'])) { foreach ($auth['order_ids'] as $k => $v) { db_query("UPDATE ?:orders SET ?u WHERE order_id = ?i", array('user_id' => $user_data['user_id']), $v); } } fn_login_user($user_data['user_id']); Helpdesk::auth(); // Set system notifications if (Registry::get('config.demo_mode') != true && AREA == 'A') { // If username equals to the password if (!fn_is_development() && fn_compare_login_password($user_data, $password)) { $lang_var = 'warning_insecure_password_email'; fn_set_notification('E', __('warning'), __($lang_var, array('[link]' => fn_url('profiles.update'))), 'S', 'insecure_password'); } if (empty($user_data['company_id']) && !empty($user_data['user_id'])) { // Insecure admin script if (!fn_is_development() && Registry::get('config.admin_index') == 'admin.php') { fn_set_notification('E', __('warning'), __('warning_insecure_admin_script', array('[href]' => Registry::get('config.resources.admin_protection_url'))), 'S'); } if (!fn_is_development() && is_file(Registry::get('config.dir.root') . '/install/index.php')) { fn_set_notification('W', __('warning'), __('delete_install_folder'), 'S'); }
private static function _getLicenseStatus($license_data) { if (empty($license_data['license_number'])) { return false; } $result = Helpdesk::checkStoreImportAvailability($license_data['license_number'], General::VERSION_FOR_LICENSE_CHECK); if ($result) { $si_data = unserialize(Settings::instance()->getValue('si_data', 'store_import')); $si_data['license_data'] = $license_data; Settings::instance()->updateValue('si_data', serialize($si_data), 'store_import'); } return $result; }
/** * Return product UUID * @return string */ public function getUUID() { return md5($this->id . Helpdesk::getStoreKey() . $this->template_id); }
$uc_settings = Settings::instance()->getValues('Upgrade_center'); $is_valid = fn_get_contents(Registry::get('config.resources.updates_server') . '/index.php?dispatch=validators.validate_request&token=' . $_REQUEST['token'] . '&license_key=' . $uc_settings['license_number']); if ($is_valid == 'valid') { $data = simplexml_load_string(urldecode($_REQUEST['request'])); Helpdesk::processMessages($data->Messages); echo 'OK'; exit(0); } else { return array(CONTROLLER_STATUS_NO_PAGE); } } } } if ($mode == 'auth') { header('Content-Type: image/png'); echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlJJREFUeNqkUztoVEEUPfN5k7gf4q4J6yduxKDRQhBEUCQ2KbaJCiI2Wtgt0cJCUEGxshJs/EBSWCoWFhKxULtFDUYXBUFMjJFl1WVBVkX39/a9N96ZfbtuoYU4cLgz8+45986ZeUxrjf8ZMjfBTIxxjqzgyAiJpBT0Qf4ZXKDCGR4whhni/ZQ0ASE7mE4cH9qYGFYRpRhlciHATeyA1owQtFpurVgYbXwqmsKXJVU1AhlDrjerquU3IShREqkDhGRGbQrGVDQ9MkwCmbaAtAJJU9mQV1/4CFAMKh8QFB5Dv7kDXi2DE5kxe1xw1afIuqSd2/MK2DZN5ebcdbRe3QLqXyG3H4Vz+DbE1gNdsjG9DVjYDs03HrbtPr1iozbrwU3g46eBveeIyqAXZi0Zvt8V4F13w/PGTy1gxdQ8nMmrVhSPzgCll8Cuk9CxNcQlsuch+JtAkL8B/f4hWGobMDlNF5yCfnKJkvqBLQfhGTJBB0AQ9Aiw0AM9fw3IXQTuHmu/lJ0noCvL0NQFG9nTFfCJ7PcIuKZdIyCmKDGbB358Bgo5YO0O23bwZREsseG3gAeXABm+5FLnnjvDmlWvgDlRS5JujQr0tQVIsFpFyaSw14eMv5gZ2zd+RDZq0d6rMpUNoRdmT6lINX/v3U3yICuelYGJVUi7nh6NrxsaEPGoRD8ZphTgONSBA04QBIf2ghZvLL6oLBWX6/fPL+G5eR3p9RGkzo5h/+YYdkNjpXG347IfRgsfdHB8e/sdc9NlzJY9lI3AAIFKQvzjn0xyaPwSYACS4hG3ZjB6zgAAAABJRU5ErkJggg=='); if (Tygh::$app['session']['auth']['area'] == 'A' && !empty(Tygh::$app['session']['auth']['user_id'])) { $domains = ''; if (fn_allowed_for('ULTIMATE')) { $storefronts = db_get_fields('SELECT storefront FROM ?:companies WHERE storefront != ""'); if (!empty($storefronts)) { $domains = implode(',', $storefronts); } } $extra_fields = array('token' => Helpdesk::token(true), 'store_key' => Helpdesk::getStoreKey(), 'domains' => $domains); $data = Helpdesk::getLicenseInformation('', $extra_fields); Helpdesk::parseLicenseInformation($data, $auth); } exit; } return array(CONTROLLER_STATUS_NO_PAGE);