本文整理汇总了PHP中fn_set_notification函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_set_notification函数的具体用法?PHP fn_set_notification怎么用?PHP fn_set_notification使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_set_notification函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fn_settings_actions_addons_access_restrictions_admin_reverse_ip_access
/**
* Reverse IP filter
*/
function fn_settings_actions_addons_access_restrictions_admin_reverse_ip_access(&$new_value, $old_value)
{
$ip = fn_get_ip(true);
if ($new_value == 'Y') {
$ip_data = db_get_row("SELECT item_id, status FROM ?:access_restriction WHERE ip_from = ?i AND ip_to = ?i AND type IN ('aas', 'aab', 'aar')", $ip['host'], $ip['host']);
if (empty($ip_data) || empty($ip_data['item_id'])) {
// Add IP
$restrict_ip = array('ip_from' => $ip['host'], 'ip_to' => $ip['host'], 'type' => 'aas', 'timestamp' => TIME, 'expires' => '0', 'status' => 'A');
$__data = array();
$__data['item_id'] = db_query("REPLACE INTO ?:access_restriction ?e", $restrict_ip);
$__data['type'] = 'aas';
foreach (fn_get_translation_languages() as $__data['lang_code'] => $_v) {
$__data['reason'] = __('store_admin', '', $__data['lang_code']);
db_query("REPLACE INTO ?:access_restriction_reason_descriptions ?e", $__data);
}
fn_set_notification('W', __('warning'), __('your_ip_added', array('[ip]' => long2ip($ip['host']))));
} elseif (empty($ip_data['status']) || $ip_data['status'] != 'A') {
// Change IP status to available
db_query("UPDATE ?:access_restriction SET ?u WHERE item_id = ?i", array('status' => 'A'), $ip_data['item_id']);
fn_set_notification('W', __('warning'), __('your_ip_enabled', array('[ip]' => long2ip($ip['host']))));
}
} else {
// Delete IP
$ips_data = db_get_array("SELECT item_id, type FROM ?:access_restriction WHERE ip_from <= ?i AND ip_to >= ?i AND type IN ('aas', 'aab', 'aar')", $ip['host'], $ip['host']);
if (!empty($ips_data)) {
foreach ($ips_data as $ip_data) {
db_query("DELETE FROM ?:access_restriction WHERE item_id = ?i", $ip_data['item_id']);
db_query("DELETE FROM ?:access_restriction_reason_descriptions WHERE item_id = ?i AND type = ?s", $ip_data['item_id'], $ip_data['type']);
}
fn_set_notification('W', __('warning'), __('your_ip_removed', array('[ip]' => long2ip($ip['host']))));
}
}
return true;
}
示例2: fn_settings_actions_addons_webmail
function fn_settings_actions_addons_webmail(&$new_value, $old_value)
{
if ($new_value == 'A') {
// Copy data directory to "var"
$dir_data = DIR_ROOT . '/var/webmail';
if (fn_copy(DIR_ADDONS . 'webmail/lib/webmail/data', $dir_data) == false) {
$msg = fn_get_lang_var('text_cannot_write_directory');
fn_set_notification('E', fn_get_lang_var('error'), str_replace('[directory]', $dir_data, $msg));
$new_value = 'D';
return false;
}
$config = Registry::get('config');
$_settings = $dir_data . '/settings/settings.xml';
// 1 step, generate config file
$xml = simplexml_load_file($_settings);
$xml->Common->DBLogin = $config['db_user'];
$xml->Common->DBPassword = $config['db_password'];
$xml->Common->DBName = $config['db_name'];
$xml->Common->DBHost = $config['db_host'];
if (fn_put_contents($_settings, $xml->asXML()) == false) {
$msg = fn_get_lang_var('cannot_write_file');
fn_set_notification('E', fn_get_lang_var('error'), str_replace('[file]', $_settings, $msg));
$new_value = 'D';
return false;
}
include DIR_ADDONS . 'webmail/lib/webmail/web/class_settings.php';
include DIR_ADDONS . 'webmail/lib/webmail/web/class_dbstorage.php';
// Init mailbee core
$null = null;
$settings =& Settings::CreateInstance();
$dbStorage =& DbStorageCreator::CreateDatabaseStorage($null);
$dbStorage->Connect();
$dbStorage->CreateTables($settings->DbPrefix);
}
}
示例3: fn_api_auth_routines
function fn_api_auth_routines($request, $auth)
{
$status = true;
$user_login = !empty($request['user_login']) ? trim($request['user_login']) : '';
$password = !empty($request['password']) ? $request['password'] : '';
$field = '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');
}
}
$user_data = db_get_row("SELECT * FROM ?:users WHERE {$field} = ?s" . $condition, $user_login);
if (empty($user_data)) {
$user_data = db_get_row("SELECT * FROM ?:users 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['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);
}
示例4: getScheme
/**
* Creates and returns XmlScheme object for addon
*
* @param string $addon_id Addon name
* @param string $path Path to addons
* @return AXmlScheme object
*/
public static function getScheme($addon_id, $path = '')
{
if (empty($path)) {
$path = Registry::get('config.dir.addons');
}
libxml_use_internal_errors(true);
if (!isset(self::$schemas[$addon_id])) {
$_xml = self::readXml($path . $addon_id . '/addon.xml');
if ($_xml !== FALSE) {
$versions = self::getVersionDefinition();
$version = isset($_xml['scheme']) ? (string) $_xml['scheme'] : '1.0';
self::$schemas[$addon_id] = new $versions[$version]($_xml);
} else {
$errors = libxml_get_errors();
$text_errors = array();
foreach ($errors as $error) {
$text_errors[] = self::displayXmlError($error, $_xml);
}
libxml_clear_errors();
if (!empty($text_errors)) {
fn_set_notification('E', __('xml_error'), '<br/>' . implode('<br/>', $text_errors));
}
return false;
}
}
return self::$schemas[$addon_id];
}
示例5: fn_settings_actions_addons_google_sitemap
function fn_settings_actions_addons_google_sitemap(&$new_value, $old_value)
{
if ($new_value == 'A') {
fn_set_notification('W', __('warning'), __('google_sitemap.generate_map'));
}
return true;
}
示例6: import
public function import($db_already_cloned)
{
General::setProgressTitle(__CLASS__);
if (!$db_already_cloned) {
if (!General::cloneImportedDB($this->store_data)) {
return false;
}
} else {
General::setEmptyProgressBar(__('importing_data'));
General::setEmptyProgressBar(__('importing_data'));
}
General::connectToOriginalDB(array('table_prefix' => General::formatPrefix()));
General::processAddons($this->store_data, __CLASS__);
$main_sql = Registry::get('config.dir.addons') . 'store_import/database/' . $this->main_sql_filename;
if (is_file($main_sql)) {
//Process main sql
if (!db_import_sql_file($main_sql)) {
return false;
}
}
// General::restoreSettings();
if (db_get_field("SELECT status FROM ?:addons WHERE addon = 'searchanise'") != 'D') {
db_query("UPDATE ?:addons SET status = 'D' WHERE addon = 'searchanise'");
fn_set_notification('W', __('warning'), General::getUnavailableLangVar('uc_searchanise_disabled'));
}
General::setActualLangValues();
General::updateAltLanguages('language_values', 'name');
General::updateAltLanguages('ult_language_values', array('name', 'company_id'));
General::updateAltLanguages('settings_descriptions', array('object_id', 'object_type'));
General::setEmptyProgressBar();
General::setEmptyProgressBar();
General::setEmptyProgressBar();
General::setEmptyProgressBar();
return true;
}
示例7: fn_rus_spsr_barcode_number
function fn_rus_spsr_barcode_number($number)
{
$sum_nech = $sum_ch = 0;
$prefix = 20;
$number = (string) $number;
$count = strlen($number);
if ($count < 9) {
$number = str_pad($number, 9, "0", STR_PAD_LEFT);
$number = $prefix . $number;
for ($i = 0; $i < strlen($number); $i++) {
$a = $number[$i];
$b = ($i + 1) % 2;
if ($b === 1) {
$sum_nech += $a;
} else {
$sum_ch += $a;
}
}
$check = $sum_ch * 3 + $sum_nech;
$check_big = ceil($check / 10);
$check_big = $check_big * 10;
$contr_sum = $check_big - $check;
$barcode = $number . $contr_sum;
return $barcode;
} else {
fn_set_notification('E', __('notice'), __('shippings.spsr.barcode_error_len') . ' : ' . $count);
return false;
}
}
示例8: fn_newsletters_import_after_process_data
function fn_newsletters_import_after_process_data(&$primary_object_id, &$object, &$pattern, &$options, &$processed_data, &$processing_groups, &$skip_db_processing_record)
{
if (empty($object['list_id'])) {
fn_set_notification('W', __('warning'), __('warning_subscribers_import'));
$skip_db_processing_record = true;
}
}
示例9: fn_rus_payments_change_order_status
function fn_rus_payments_change_order_status(&$status_to, &$status_from, &$order_info, &$force_notification, &$order_statuses, &$place_order)
{
$processor_data = fn_get_processor_data($order_info['payment_id']);
$payment_info = $order_info['payment_info'];
if (!empty($processor_data['processor']) && $processor_data['processor'] == 'Yandex.Money' && !empty($payment_info['yandex_postponed_payment'])) {
try {
$cert = $processor_data['processor_params']['certificate_filename'];
$mws_client = new MWSClient();
$mws_client->authenticate(array('pkcs12_file' => Registry::get('config.dir.certificates') . $cert, 'pass' => $processor_data['processor_params']['p12_password'], 'is_test_mode' => $processor_data['processor_params']['mode'] == 'test'));
if ($status_to == $processor_data['processor_params']['confirmed_order_status']) {
$mws_client->confirmPayment($payment_info['yandex_invoice_id'], $order_info['total']);
$payment_info['yandex_confirmed_time'] = date('c');
$payment_info['yandex_postponed_payment'] = false;
} elseif ($status_to == $processor_data['processor_params']['canceled_order_status']) {
$mws_client->cancelPayment($payment_info['yandex_invoice_id']);
$payment_info['yandex_canceled_time'] = date('c');
$payment_info['yandex_postponed_payment'] = false;
}
$payment_info['order_status'] = $status_to;
fn_update_order_payment_info($order_info['order_id'], $payment_info);
$order_info['payment_info'] = $payment_info;
} catch (\Exception $e) {
fn_set_notification('E', __('error'), __('addons.rus_payments.yandex_money_mws_operation_error'));
return $status_to = $status_from;
}
}
}
示例10: downloadDistr
public static function downloadDistr()
{
// Get needed version
$version_info = self::GetNextVersionInfo();
if (!$version_info['next_version'] || !$version_info['update_url']) {
return false;
}
$download_file_dir = TWIGMO_UPGRADE_DIR . $version_info['next_version'] . '/';
$download_file_path = $download_file_dir . 'twigmo.tgz';
$unpack_path = $download_file_path . '_unpacked';
fn_rm($download_file_dir);
fn_mkdir($download_file_dir);
fn_mkdir($unpack_path);
$data = fn_get_contents($version_info['update_url']);
if (!fn_is_empty($data)) {
fn_put_contents($download_file_path, $data);
$res = fn_decompress_files($download_file_path, $unpack_path);
if (!$res) {
fn_set_notification('E', __('error'), __('twgadmin_failed_to_decompress_files'));
return false;
}
return $unpack_path . '/';
} else {
fn_set_notification('E', __('error'), __('text_uc_cant_download_package'));
return false;
}
}
示例11: orderStatusUpdate
public function orderStatusUpdate($ym_order_id, $data)
{
$path = 'campaigns/' . $this->campaign_id . '/orders/' . $ym_order_id . '/status.json';
$data = array('order' => $data);
$counter = 1;
while (true) {
try {
$res = $this->client->put($path, $data);
return $res;
} catch (\Pest_BadRequest $e) {
$data = json_decode($e->getMessage(), true);
if (!empty($data['error']['message'])) {
$message = $data['error']['message'];
if (!empty($data['error']['code'])) {
$message = $data['error']['code'] . ': ' . $message;
}
fn_set_notification('E', __('yandex_market'), $message);
}
return false;
} catch (\Pest_Exception $e) {
if ($counter >= YM_REQUEST_ERROR_REPEATS) {
return false;
}
$counter++;
sleep(YM_REQUEST_ERROR_SLEEP_SECONDS);
}
}
}
示例12: fn_insurance_calculate_cart
function fn_insurance_calculate_cart(&$cart, $cart_products, $auth, $calculate_shipping, $calculate_taxes, $apply_cart_promotions)
{
// Set default value
// [eileen]
// if (!isset($cart['is_insurance'])) {
// $cart['is_insurance'] = Registry::get('addons.insurance.enabled_by_default') == 'Y' ? 'Y' : 'N';
$cart['is_insurance'] = Registry::get('addons.insurance.enabled_by_default') == 'Y' ? 'Y' : (!isset($cart['is_insurance']) ? 'N' : $cart['is_insurance']);
// }
// [/eileen]
// Set setting from checkbox
if (isset($_GET['is_insurance'])) {
if ($_GET['is_insurance'] == 'Y') {
$cart['is_insurance'] = 'Y';
fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('insurance_is_on'));
} elseif ($_GET['is_insurance'] == 'N') {
$cart['is_insurance'] = 'N';
fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('insurance_is_off'));
}
}
// Add insurance cost to total
if ($cart['is_insurance'] == 'Y') {
$cart['insurance_cost'] = fn_format_price(floatval(Registry::get('addons.insurance.price')));
$cart['total'] = fn_format_price($cart['total'] + $cart['insurance_cost']);
}
}
示例13: fn_settings_actions_addons_sms_notifications_clickatel_unicode
function fn_settings_actions_addons_sms_notifications_clickatel_unicode(&$new_value, $old_value)
{
if ($new_value == 'Y' && !function_exists('mb_convert_encoding')) {
fn_set_notification('E', __('warning'), __('unicode_not_enabled'));
$new_value = 'N';
}
return true;
}
示例14: fn_vendor_data_premoderation_set_admin_notification
function fn_vendor_data_premoderation_set_admin_notification(&$auth)
{
if ($auth['company_id'] == 0 && fn_check_permissions('premoderation', 'products_approval', 'admin')) {
$count = db_get_field('SELECT COUNT(*) FROM ?:products WHERE approved = ?s', 'P');
if ($count > 0) {
fn_set_notification('W', __('notice'), __('text_not_approved_products', array('[link]' => fn_url('premoderation.products_approval?approval_status=P'))), 'K');
}
}
}
示例15: fn_settings_actions_shippings_edost_enabled
/**
* Check if RUB currency is active and used as a primary.
*
* @param mixed $new_value New values of shipping_edost_enabled setting
* @param mixed $old_value Old values of shipping_edost_enabled setting
*/
function fn_settings_actions_shippings_edost_enabled(&$new_value, $old_value)
{
$currencies = Registry::get('currencies');
if ($new_value == 'Y' && (empty($currencies[CURRENCY_RUB]) || $currencies[CURRENCY_RUB]['is_primary'] == 'N')) {
fn_delete_notification('changes_saved');
fn_set_notification('E', __('warning'), __('edost_activation_error'));
$new_value = 'N';
}
}