本文整理汇总了PHP中fn_set_notification函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_set_notification函数的具体用法?PHP fn_set_notification怎么用?PHP fn_set_notification使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_set_notification函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:askzap,项目名称:ultimate,代码行数:37,代码来源:actions.functions.post.php
示例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);
}
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:35,代码来源:actions.post.php
示例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);
}
开发者ID:drahosistvan,项目名称:cscart-api-auth,代码行数:26,代码来源:func.php
示例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];
}
开发者ID:ambient-lounge,项目名称:site,代码行数:34,代码来源:SchemesManager.php
示例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;
}
开发者ID:askzap,项目名称:ultimate,代码行数:7,代码来源:actions.functions.post.php
示例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;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:35,代码来源:F421T422.php
示例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;
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:29,代码来源:func.php
示例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;
}
}
开发者ID:askzap,项目名称:ultimate,代码行数:7,代码来源:subscribers.functions.php
示例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;
}
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:27,代码来源:func.php
示例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;
}
}
开发者ID:askzap,项目名称:ultimate,代码行数:27,代码来源:TwigmoUpgrade.php
示例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);
}
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:28,代码来源:ApiClient.php
示例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']);
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:25,代码来源:func.php
示例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;
}
开发者ID:askzap,项目名称:ultimate,代码行数:8,代码来源:actions.functions.post.php
示例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');
}
}
}
开发者ID:askzap,项目名称:ask-zap,代码行数:9,代码来源:func.php
示例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';
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:15,代码来源:actions.functions.post.php
示例16: fn_settings_actions_addons_seo_html_catalog
function fn_settings_actions_addons_seo_html_catalog(&$new_value, $old_value)
{
if ($new_value == 'Y') {
if (!is_writable(DIR_ROOT . '/catalog')) {
$s = fn_get_lang_var('text_cannot_write_directory');
fn_set_notification('E', fn_get_lang_var('error'), str_replace('[directory]', DIR_ROOT . '/catalog', $s));
$new_value = 'N';
}
}
return true;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:11,代码来源:actions.post.php
示例17: sanitizeObjectData
/**
* Performs securing object data basing on rule list related to object type. Rule list is specified at schema file.
* Note that this function checks setting about whether HTML should be sanitized or not.
* If no, field rule "ACTION_SANITIZE_HTML" will be omitted and no modifications to field data will be made.
*
* @param string $object_type Object type specified at schema file
* @param array &$object_data Array with object data passed by reference
*
* @return void
*/
public static function sanitizeObjectData($object_type, array &$object_data)
{
$schema = fn_get_schema('security', 'object_sanitization');
$auth =& \Tygh::$app['session']['auth'];
if (isset($schema[$object_type][self::SCHEMA_SECTION_FIELD_RULES])) {
$object_data = self::sanitizeData($object_data, $schema[$object_type][self::SCHEMA_SECTION_FIELD_RULES], self::shouldSanitizeUserHtml() ? array() : array(self::ACTION_SANITIZE_HTML), $changed);
if ($changed && self::shouldSanitizeUserHtml() && $auth['area'] == 'A') {
fn_set_notification('N', __('notice'), __('text_entered_html_was_sanitized'), 'K');
}
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:21,代码来源:SecurityHelper.php
示例18: fn_spsr_delete_addr
function fn_spsr_delete_addr($addr_id, $addr_owner_id)
{
RusSpsr::WALogin();
$result = RusSpsr::WADelAddress($addr_id, $addr_owner_id, 8);
if ($result) {
fn_set_notification('N', __('notice'), __('shippings.spsr.address_delete'));
} else {
fn_set_notification('E', __('notice'), __('shippings.spsr.not_address_delete') . ' : ' . RusSpsr::$last_error);
}
RusSpsr::WALogout();
return $result;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:12,代码来源:spsr_addr.php
示例19: fn_epayph_update_payment_pre
function fn_epayph_update_payment_pre(&$payment_data, &$payment_id, &$lang_code, &$certificate_file, &$certificates_dir)
{
if (!empty($payment_data['processor_id']) && db_get_field("SELECT processor_id FROM ?:payment_processors WHERE processor_id = ?i AND processor_script IN ('epayph.php')", $payment_data['processor_id'])) {
$p_surcharge = floatval($payment_data['p_surcharge']);
$a_surcharge = floatval($payment_data['a_surcharge']);
if (!empty($p_surcharge) || !empty($a_surcharge)) {
$payment_data['p_surcharge'] = 0;
$payment_data['a_surcharge'] = 0;
fn_set_notification('E', __('error'), __('text_epayph_surcharge'));
}
}
}
开发者ID:Neuralink,项目名称:epayph_cscart,代码行数:12,代码来源:func.php
示例20: fn_settings_actions_addons_hidpi
function fn_settings_actions_addons_hidpi(&$new_value, $old_value)
{
Storage::instance('images')->deleteDir('thumbnails');
if ($new_value == 'A') {
$formats = fn_get_supported_image_format_variants();
// Set thumbnail generation format to png to improve quality
if (!empty($formats['png'])) {
Settings::instance()->updateValue('convert_to', 'png', 'Thumbnails');
fn_set_notification('W', __('warning'), __('addons.hidpi.thumbnail_format_changed', array('[settings_url]' => fn_url('settings.manage?section_id=Thumbnails'))));
}
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:12,代码来源:actions.functions.post.php
注:本文中的fn_set_notification函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论