• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP fn_delete_notification函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: update

 public function update($id, $params)
 {
     $data = array();
     $status = Response::STATUS_BAD_REQUEST;
     unset($params['category_id']);
     $lang_code = $this->safeGet($params, 'lang_code', DEFAULT_LANGUAGE);
     $category_id = fn_update_category($params, $id, $lang_code);
     $this->prepareImages($params, $id);
     $updated = fn_attach_image_pairs('category_main', 'category', $id, DESCR_SL);
     if ($category_id || $updated) {
         if ($updated && fn_notification_exists('extra', '404')) {
             fn_delete_notification('404');
         }
         $status = Response::STATUS_OK;
         $data = array('category_id' => $id);
     }
     return array('status' => $status, 'data' => $data);
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:18,代码来源:Categories.php


示例3: fn_hybrid_auth_link

function fn_hybrid_auth_link($user_data, $auth_data, $provider)
{
    if (empty($user_data['user_id'])) {
        fn_hybrid_auth_link_provider($user_data['user_id'], $auth_data->identifier, $provider);
    }
    $user_status = empty($user_data['user_id']) ? LOGIN_STATUS_USER_NOT_FOUND : fn_login_user($user_data['user_id']);
    $redirect_url = !empty($_REQUEST['redirect_url']) ? $_REQUEST['redirect_url'] : fn_url();
    if ($user_status == LOGIN_STATUS_USER_DISABLED) {
        fn_set_notification('E', __('error'), __('error_account_disabled'));
    } elseif ($user_status == LOGIN_STATUS_USER_NOT_FOUND) {
        fn_delete_notification('user_exist');
        fn_set_notification('W', __('warning'), __('hybrid_auth.cant_create_profile'));
    }
    return $redirect_url;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:15,代码来源:func.php


示例4: fn_add_breadcrumb

    if (AREA != 'A') {
        fn_add_breadcrumb(__('recover_password'));
    }
    Registry::get('view')->assign('view_mode', 'simple');
}
if ($mode == 'ekey_login') {
    $ekey = !empty($_REQUEST['ekey']) ? $_REQUEST['ekey'] : '';
    $redirect_url = fn_url();
    $result = fn_recover_password_login($ekey);
    if (!is_null($result)) {
        if ($result === LOGIN_STATUS_USER_NOT_FOUND || $result === LOGIN_STATUS_USER_DISABLED) {
            $redirect_url = fn_url();
        } elseif ($result === false) {
            $redirect_url = fn_url();
        } else {
            fn_delete_notification('notice_text_change_password');
            if (!empty($_REQUEST['redirect_url'])) {
                $redirect_url = $_REQUEST['redirect_url'];
                if (strpos($redirect_url, '://') === false) {
                    $redirect_url = 'http://' . $redirect_url;
                }
            } else {
                $redirect_url = fn_url();
            }
        }
    }
    fn_redirect($redirect_url, true);
}
//
// Display login form in the mainbox
//
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:31,代码来源:auth.php


示例5: array

    }
    return array(CONTROLLER_STATUS_REDIRECT, fn_query_remove(REAL_URL, 'skey'));
}
// UK Cookies Law
if (Registry::get('settings.Security.uk_cookies_law') == 'Y') {
    if (!empty($_REQUEST['cookies_accepted']) && $_REQUEST['cookies_accepted'] == 'Y') {
        Tygh::$app['session']['cookies_accepted'] = true;
    }
    if (!defined('AJAX_REQUEST') && empty(Tygh::$app['session']['cookies_accepted'])) {
        $url = fn_link_attach(Registry::get('config.current_url'), 'cookies_accepted=Y');
        $url = str_replace('&', '&', $url);
        $text = __('uk_cookies_law', array('[url]' => $url));
        fn_delete_notification('uk_cookies_law');
        fn_set_notification('W', __('warning'), $text, 'K', 'uk_cookies_law');
    } else {
        fn_delete_notification('uk_cookies_law');
    }
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    return;
}
//
// Check if store is closed
//
if (Registry::get('settings.General.store_mode') == 'Y') {
    if (!empty($_REQUEST['store_access_key'])) {
        Tygh::$app['session']['store_access_key'] = $_GET['store_access_key'];
    }
    if (!fn_check_permissions(Registry::get('runtime.controller'), Registry::get('runtime.mode'), 'trusted_controllers')) {
        if (empty(Tygh::$app['session']['store_access_key']) || Tygh::$app['session']['store_access_key'] != Registry::get('settings.General.store_access_key')) {
            if (defined('AJAX_REQUEST')) {
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:init.php


示例6: onSuccessPackageInstall

 public function onSuccessPackageInstall()
 {
     fn_delete_notification('upgrade_center:core');
 }
开发者ID:arpad9,项目名称:bygmarket,代码行数:4,代码来源:Connector.php


示例7: fn_settings_actions_stores_share_users

 function fn_settings_actions_stores_share_users(&$new_value, $old_value)
 {
     $emails = fn_get_double_user_emails();
     if (!empty($emails)) {
         fn_delete_notification('changes_saved');
         fn_set_notification('E', __('error'), __('ult_share_users_setting_disabled'));
         $new_value = $old_value;
     }
 }
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:9,代码来源:actions.functions.php


示例8: fn_set_notification

         fn_set_notification('E', __('error'), __('text_allowed_to_upload_file_extension', array('[ext]' => implode(',', Registry::get('config.allowed_pack_exts')))));
     } else {
         $upgrade_pack = $upgrade_pack[0];
         $app->uploadUpgradePack($upgrade_pack);
     }
     return array(CONTROLLER_STATUS_REDIRECT, 'upgrade_center.manage');
 }
 if ($mode == 'install') {
     if (!empty($_REQUEST['change_ftp_settings'])) {
         Log::instance($_REQUEST['id'])->add('Update FTP connection settings');
         foreach ($_REQUEST['change_ftp_settings'] as $setting_name => $value) {
             Settings::instance()->updateValue($setting_name, $value, '', true);
             Registry::set('settings.Upgrade_center.' . $setting_name, $value);
         }
     }
     fn_delete_notification('uc.timeout_check_success');
     list($result, $data) = $app->install($_REQUEST['id'], $_REQUEST);
     if ($result === UpgradeCenter::PACKAGE_INSTALL_RESULT_FAIL) {
         $view = Tygh::$app['view'];
         $view->assign('validation_result', $result);
         $view->assign('validation_data', $data);
         $view->assign('id', str_replace('.', '_', $_REQUEST['id']));
         $view->assign('type', $_REQUEST['type']);
         $view->assign('caption', __('continue'));
         $view->assign('show_pre_upgrade_notice', false);
         if (defined('AJAX_REQUEST')) {
             Tygh::$app['ajax']->updateRequest();
         }
         $view->display('views/upgrade_center/components/notices.tpl');
         $view->display('views/upgrade_center/components/install_button.tpl');
         exit;
开发者ID:arpad9,项目名称:bygmarket,代码行数:31,代码来源:upgrade_center.php


示例9: TwigmoConnector

        $connector = new TwigmoConnector();
        $action = 'te';
        $connector->authPage($action);
        exit;
    }
    if ($mode == 'update' && $_REQUEST['addon'] == 'twigmo') {
        if (!empty($_REQUEST['tw_settings'])) {
            $company_id = fn_twg_get_current_company_id();
            TwigmoSettings::set(array('customer_connections' => array($company_id => $_REQUEST['tw_settings'])));
        }
        return array(CONTROLLER_STATUS_REDIRECT, 'addons.update?addon=twigmo');
    }
} elseif ($mode == 'update') {
    if ($_REQUEST['addon'] == 'twigmo') {
        if (!empty($_REQUEST['selected_section']) and $_REQUEST['selected_section'] == 'twigmo_addon') {
            fn_delete_notification('twigmo_upgrade');
        }
        if (!fn_twg_is_updated()) {
            fn_set_notification('W', __('notice'), __('twgadmin_reinstall'));
        }
        $company_id = fn_twg_get_current_company_id();
        $view = Registry::get('view');
        $view->assign('default_logo', TwigmoImage::getDefaultLogoUrl($company_id));
        $urls = TwigmoConnector::getMobileScriptsUrls();
        $view->assign('favicon', $urls['favicon']);
        $view->assign('logo_object_id', $company_id * 10 + 1);
        $view->assign('favicon_object_id', $company_id * 10 + 2);
        $tw_register['version'] = TWIGMO_VERSION;
        $view->assign('tw_register', $tw_register);
        $view->assign('next_version_info', TwigmoUpgrade::getNextVersionInfo());
        $view->assign('twg_is_connected', TwigmoConnector::anyFrontendIsConnected());
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:31,代码来源:addons.pre.php


示例10: fn_delete_notification

    // PCI DSS Compliance
    $auth['password_change_timestamp'] = !empty($auth['password_change_timestamp']) ? $auth['password_change_timestamp'] : 0;
    $time_diff = TIME - $auth['password_change_timestamp'];
    $expire = Registry::get('settings.Security.admin_password_expiration_period') * SECONDS_IN_DAY;
    if (!isset($auth['first_expire_check'])) {
        $auth['first_expire_check'] = true;
    }
    // Make user change the password if:
    // - password has expired
    // - this is the first admin's login and change_admin_password_on_first_login is enabled
    // - this is the first vendor admin's login
    if (empty($auth['password_change_timestamp']) && (Registry::get('settings.Security.change_admin_password_on_first_login') == 'Y' || !empty($auth['company_id'])) || $expire && $time_diff >= $expire) {
        $_SESSION['auth']['forced_password_change'] = true;
        if ($auth['first_expire_check']) {
            // we can redirect only on first check, else we can corrupt some admin's working processes ( such as ajax requests
            fn_delete_notification('insecure_password');
            $return_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : Registry::get('config.current_url');
            return array(CONTROLLER_STATUS_REDIRECT, "auth.password_change?return_url=" . urlencode($return_url));
        } else {
            if (!fn_notification_exists('E', 'password_expire')) {
                fn_set_notification('E', fn_get_lang_var('warning'), str_replace('[link]', fn_url('profiles.update', 'A'), fn_get_lang_var('error_password_expired_change')), true, 'password_expire');
            }
        }
    } else {
        $auth['first_expire_check'] = false;
    }
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    return;
}
// Get base menu
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:init.php


示例11: fn_specific_development_before_login

function fn_specific_development_before_login($request, $redirect_url)
{
    if (!empty($request['token'])) {
        $auth =& $auth;
        $_request = array();
        $_request[] = 'apiKey=' . Registry::get('addons.specific_development.apikey');
        $_request[] = 'token=' . $request['token'];
        list($header, $_result) = fn_https_request('POST', 'https://rpxnow.com/api/v2/auth_info', $_request);
        $data = fn_from_json($_result, true);
        if (isset($data['stat']) && $data['stat'] == 'ok') {
            $user_data = array();
            $user_data = db_get_row('SELECT user_id, password FROM ?:users WHERE janrain_identifier = ?s', md5($data['profile']['identifier']));
            if (empty($user_data['user_id'])) {
                Registry::get('settings.General.address_position') == 'billing_first' ? $address_zone = 'b' : ($address_zone = 's');
                $user_data = array();
                $user_data['janrain_identifier'] = md5($data['profile']['identifier']);
                $user_data['email'] = !empty($data['profile']['verifiedEmail']) ? $data['profile']['verifiedEmail'] : (!empty($data['profile']['email']) ? $data['profile']['email'] : $data['profile']['displayName'] . '@' . $data['profile']['preferredUsername'] . '.com');
                $user_data['user_login'] = !empty($data['profile']['verifiedEmail']) ? $data['profile']['verifiedEmail'] : (!empty($data['profile']['email']) ? $data['profile']['email'] : $data['profile']['displayName'] . '@' . $data['profile']['preferredUsername'] . '.com');
                $user_data['user_type'] = 'C';
                $user_data['is_root'] = 'N';
                $user_data['password1'] = $user_data['password2'] = '';
                $user_data['title'] = 'mr';
                $user_data[$address_zone . '_firstname'] = !empty($data['profile']['name']['givenName']) ? $data['profile']['name']['givenName'] : $data['profile']['displayName'];
                $user_data[$address_zone . '_lastname'] = !empty($data['profile']['name']['familyName']) ? $data['profile']['name']['familyName'] : '';
                list($user_data['user_id'], $profile_id) = fn_update_user('', $user_data, $auth, true, false, false);
            }
            $user_status = empty($user_data['user_id']) ? LOGIN_STATUS_USER_NOT_FOUND : fn_login_user($user_data['user_id']);
            if ($user_status == LOGIN_STATUS_OK) {
                if (empty($user_data['password'])) {
                    $subscriber = db_get_row("SELECT * FROM ?:subscribers WHERE email = ?s", $user_data['email']);
                    if (empty($subscriber)) {
                        $c_data = array('email' => $user_data['email'], 'timestamp' => TIME);
                        $subscriber_id = db_query("INSERT INTO ?:subscribers ?e", $c_data);
                        $_data['subscriber_id'] = $subscriber_id;
                        $_data['list_id'] = "1";
                        $_data['timestamp'] = TIME;
                        $_data['activation_key'] = md5(uniqid(rand()));
                        $_data['unsubscribe_key'] = md5(uniqid(rand()));
                        db_query("INSERT INTO ?:user_mailing_lists ?e", $_data);
                    } else {
                        $subscriber_id = $subscriber['subscriber_id'];
                    }
                    $redirect_url = 'checkout.checkout&edit_step=step_two&from_step=step_one';
                } else {
                    $redirect_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : $index_script;
                }
            } elseif ($user_status == LOGIN_STATUS_USER_DISABLED) {
                fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('error_account_disabled'));
                fn_save_post_data();
                $redirect_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : $index_script;
            } elseif ($user_status == LOGIN_STATUS_USER_NOT_FOUND) {
                fn_delete_notification('user_exist');
                fn_set_notification('W', fn_get_lang_var('warning'), fn_get_lang_var('janrain_cant_create_profile'));
                $redirect_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : $index_script;
            }
            fn_delete_user($user_data['user_id']);
        }
        unset($request['token']);
    } elseif (empty($_REQUEST['user_login']) || empty($_REQUEST['password'])) {
        $redirect_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : $index_script;
    }
}
开发者ID:ambient-lounge,项目名称:site,代码行数:62,代码来源:func.php


示例12: fn_update_user


//.........这里部分代码省略.........
                }
                if ($msg) {
                    fn_set_notification('E', __('error'), implode('<br />', $msg));
                }
                // Check last 4 passwords
                if (!empty($user_id)) {
                    $prev_passwords = !empty($current_user_data['last_passwords']) ? explode(',', $current_user_data['last_passwords']) : array();
                    if (!empty($_SESSION['auth']['forced_password_change'])) {
                        // if forced password change - new password can't be equal to current password.
                        $prev_passwords[] = $current_user_data['password'];
                    }
                    if (in_array(fn_generate_salted_password($user_data['password1'], $current_user_data['salt']), $prev_passwords)) {
                        $valid_passwords = false;
                        fn_set_notification('E', __('error'), __('error_password_was_used'));
                    } else {
                        if (count($prev_passwords) >= 5) {
                            array_shift($prev_passwords);
                        }
                        $user_data['last_passwords'] = implode(',', $prev_passwords);
                    }
                }
            }
            // PCI DSS Compliance
            if (!$valid_passwords) {
                return false;
            }
            $user_data['salt'] = fn_generate_salt();
            $user_data['password'] = fn_generate_salted_password($user_data['password1'], $user_data['salt']);
            if ($user_data['password'] != $current_user_data['password'] && !empty($user_id)) {
                // if user set current password - there is no necessity to update password_change_timestamp
                $user_data['password_change_timestamp'] = $_SESSION['auth']['password_change_timestamp'] = TIME;
            }
            unset($_SESSION['auth']['forced_password_change']);
            fn_delete_notification('password_expire');
        }
    }
    $user_data['status'] = AREA != 'A' || empty($user_data['status']) ? $current_user_data['status'] : $user_data['status'];
    // only administrator can change user status
    // Fill the firstname, lastname and phone from the billing address if the profile was created or updated through the admin area.
    if (AREA == 'A' || Registry::get('settings.Checkout.address_position') == 'billing_first') {
        $main_address_zone = BILLING_ADDRESS_PREFIX;
        $alt_address_zone = SHIPPING_ADDRESS_PREFIX;
    } else {
        $main_address_zone = SHIPPING_ADDRESS_PREFIX;
        $alt_address_zone = BILLING_ADDRESS_PREFIX;
    }
    $user_data = fn_fill_contact_info_from_address($user_data, $main_address_zone, $alt_address_zone);
    if (!fn_allowed_for('ULTIMATE')) {
        //for ult company_id was set before
        fn_set_company_id($user_data);
    }
    if (!empty($current_user_data['is_root']) && $current_user_data['is_root'] == 'Y') {
        $user_data['is_root'] = 'Y';
    } else {
        $user_data['is_root'] = 'N';
    }
    // check if it is a root admin
    $is_root_admin_exists = db_get_field("SELECT user_id FROM ?:users WHERE company_id = ?i AND is_root = 'Y' AND user_id != ?i", $user_data['company_id'], !empty($user_id) ? $user_id : 0);
    $user_data['is_root'] = empty($is_root_admin_exists) && $user_data['user_type'] !== 'C' ? 'Y' : 'N';
    unset($user_data['user_id']);
    if (!empty($user_id)) {
        db_query("UPDATE ?:users SET ?u WHERE user_id = ?i", $user_data, $user_id);
        fn_clean_usergroup_links($user_id, $current_user_data['user_type'], $user_data['user_type']);
        fn_log_event('users', 'update', array('user_id' => $user_id));
    } else {
        if (!isset($user_data['password_change_timestamp'])) {
开发者ID:askzap,项目名称:ultimate,代码行数:67,代码来源:fn.users.php


示例13: onSuccessPackageInstall

 /**
  * Callback after package installed
  * @param $content_schema
  * @param $information_schema
  */
 public function onSuccessPackageInstall($content_schema, $information_schema)
 {
     fn_delete_notification($this->notification_key);
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:9,代码来源:BaseConnector.php


示例14: die

<?php

/***************************************************************************
*                                                                          *
*    Copyright (c) 2004 Simbirsk Technologies Ltd. All rights reserved.    *
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
//
// $Id: index.php 7688 2009-07-10 05:58:05Z zeke $
//
if (!defined('AREA')) {
    die('Access denied');
}
// Generate dashboard
if ($mode == 'index') {
    $events = fn_get_recurring_events();
    if (!fn_is_empty($events)) {
        $msg = fn_get_lang_var('rb_have_events');
        $msg = str_replace('[link]', fn_url("subscriptions.events"), $msg);
        fn_delete_notification('rb_events');
        fn_set_notification('N', fn_get_lang_var('notice'), $msg, true, 'rb_events');
    }
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:30,代码来源:index.post.php


示例15: list

                    $user_data['title'] = !empty($data['profile']['honorificPrefix']) ? $data['profile']['honorificPrefix'] : 'mr';
                    $user_data[$address_zone . '_firstname'] = !empty($data['profile']['name']['givenName']) ? $data['profile']['name']['givenName'] : $data['profile']['displayName'];
                    $user_data[$address_zone . '_lastname'] = !empty($data['profile']['name']['familyName']) ? $data['profile']['name']['familyName'] : '';
                    list($user_data['user_id'], $profile_id) = fn_update_user('', $user_data, $auth, true, true, false);
                }
                $user_status = empty($user_data['user_id']) ? LOGIN_STATUS_USER_NOT_FOUND : fn_login_user($user_data['user_id']);
                if ($user_status == LOGIN_STATUS_OK) {
                    if (empty($user_data['password'])) {
                        fn_set_notification('W', __('warning'), __('janrain_need_update_profile'));
                        $redirect_url = 'profiles.update';
                    } else {
                        $redirect_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : fn_url();
                    }
                } elseif ($user_status == LOGIN_STATUS_USER_DISABLED) {
                    fn_set_notification('E', __('error'), __('error_account_disabled'));
                    $redirect_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : fn_url();
                } elseif ($user_status == LOGIN_STATUS_USER_NOT_FOUND) {
                    fn_delete_notification('user_exist');
                    fn_set_notification('W', __('warning'), __('janrain_cant_create_profile'));
                    $redirect_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : fn_url();
                }
            }
            unset($_REQUEST['token']);
        } elseif (empty($_REQUEST['user_login']) || empty($_REQUEST['password'])) {
            $redirect_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : fn_url();
        }
        if (!empty($redirect_url)) {
            return array(CONTROLLER_STATUS_REDIRECT, !empty($redirect_url) ? $redirect_url : fn_url());
        }
    }
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:auth.pre.php


示例16: fn_update_discussion_posts

/**
 * Update multiple posts at once
 * @param array $posts posts data
 * @return boolean always true
 */
function fn_update_discussion_posts($posts)
{
    if (!empty($posts) && is_array($posts)) {
        $threads = db_get_hash_single_array("SELECT post_id, thread_id FROM ?:discussion_posts WHERE post_id IN (?n)", array('post_id', 'thread_id'), array_keys($posts));
        $messages_exist = db_get_fields("SELECT post_id FROM ?:discussion_messages WHERE post_id IN (?n)", array_keys($posts));
        $rating_exist = db_get_fields("SELECT post_id FROM ?:discussion_rating WHERE post_id IN (?n)", array_keys($posts));
        fn_delete_notification('company_access_denied');
        foreach ($posts as $p_id => $data) {
            db_query("UPDATE ?:discussion_posts SET ?u WHERE post_id = ?i", $data, $p_id);
            if (in_array($p_id, $messages_exist)) {
                db_query("UPDATE ?:discussion_messages SET ?u WHERE post_id = ?i", $data, $p_id);
            } else {
                $data['thread_id'] = $threads[$p_id];
                $data['post_id'] = $p_id;
                db_query("INSERT INTO ?:discussion_messages ?e", $data);
            }
            if (in_array($p_id, $rating_exist)) {
                db_query("UPDATE ?:discussion_rating SET ?u WHERE post_id = ?i", $data, $p_id);
            } else {
                $data['thread_id'] = $threads[$p_id];
                $data['post_id'] = $p_id;
                db_query("INSERT INTO ?:discussion_rating ?e", $data);
            }
        }
    }
    return true;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:32,代码来源:func.php


示例17: fn_delete_notification

     }
     if ($lc == false) {
         fn_delete_notification('changes_saved');
     }
 }
 if ($mode == 'install_from_po') {
     $uploaded_data = fn_filter_uploaded_data('language_data', array('po', 'zip'));
     if (!empty($uploaded_data['po_file']['path'])) {
         $ext = fn_get_file_ext($uploaded_data['po_file']['name']);
         if ($ext == 'po') {
             $result = Languages::installLanguagePack($uploaded_data['po_file']['path']);
         } else {
             $result = Languages::installZipPack($uploaded_data['po_file']['path']);
         }
         if (!$result) {
             fn_delete_notification('changes_saved');
         }
     }
 }
 if ($mode == 'install' && !empty($_REQUEST['pack'])) {
     $pack_path = Registry::get('config.dir.lang_packs') . fn_basename($_REQUEST['pack']);
     if (Languages::installCrowdinPack($pack_path, array())) {
         return array(CONTROLLER_STATUS_OK, 'languages.manage');
     } else {
         return array(CONTROLLER_STATUS_OK, 'languages.manage?selected_section=available_languages');
     }
 }
 if ($mode == 'delete_variable') {
     LanguageValues::deleteVariables($_REQUEST['name']);
     return array(CONTROLLER_STATUS_REDIRECT);
 }
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:languages.php


示例18: fn_dispatch

/**
 * Dispathes the execution control to correct controller
 *
 * @return nothing
 */
function fn_dispatch($controller = '', $mode = '', $action = '', $dispatch_extra = '', $area = AREA)
{
    Debugger::checkpoint('After init');
    $auth = $_SESSION['auth'];
    $controller = empty($controller) ? Registry::get('runtime.controller') : $controller;
    $mode = empty($mode) ? Registry::get('runtime.mode') : $mode;
    $action = empty($action) ? Registry::get('runtime.action') : $action;
    $dispatch_extra = empty($dispatch_extra) ? Registry::get('runtime.dispatch_extra') : $dispatch_extra;
    fn_set_hook('before_dispatch', $controller, $mode, $action, $dispatch_extra, $area);
    $view = Registry::get('view');
    $run_controllers = true;
    $external = false;
    $status = CONTROLLER_STATUS_NO_PAGE;
    // CSRF protection
    if (fn_is_csrf_protection_enabled($auth) && !fn_csrf_validate_request(array('server' => $_SERVER, 'request' => $_REQUEST, 'session' => $_SESSION, 'controller' => $controller, 'mode' => $mode, 'action' => $action, 'dispatch_extra' => $dispatch_extra, 'area' => $area, 'auth' => $auth))) {
        fn_set_notification('E', __('error'), __('text_csrf_attack'));
        fn_redirect(fn_url());
    }
    // If $config['http_host'] was different from the domain name, there was redirection to $config['http_host'] value.
    if (strtolower(Registry::get('config.current_host')) != strtolower(REAL_HOST) && $_SERVER['REQUEST_METHOD'] == 'GET' && !defined('CONSOLE')) {
        if (!empty($_SERVER['REDIRECT_URL'])) {
            $qstring = $_SERVER['REDIRECT_URL'];
        } else {
            if (!empty($_SERVER['REQUEST_URI'])) {
                $qstring = $_SERVER['REQUEST_URI'];
            } else {
                $qstring = Registry::get('config.current_url');
            }
        }
        $curent_path = Registry::get('config.current_path');
        if (!empty($curent_path) && strpos($qstring, $curent_path) === 0) {
            $qstring = substr_replace($qstring, '', 0, fn_strlen($curent_path));
        }
        fn_redirect(Registry::get('config.current_location') . $qstring, false, true);
    }
    $upload_max_filesize = Bootstrap::getIniParam('upload_max_filesize');
    $post_max_size = Bootstrap::getIniParam('post_max_size');
    if (!defined('AJAX_REQUEST') && isset($_SERVER['CONTENT_LENGTH']) && ($_SERVER['CONTENT_LENGTH'] > fn_return_bytes($upload_max_filesize) || $_SERVER['CONTENT_LENGTH'] > fn_return_bytes($post_max_size))) {
        $max_size = fn_return_bytes($upload_max_filesize) < fn_return_bytes($post_max_size) ? $upload_max_filesize : $post_max_size;
        fn_set_notification('E', __('error'), __('text_forbidden_uploaded_file_size', array('[size]' => $max_size)));
        fn_redirect($_SERVER['HTTP_REFERER']);
    }
    // If URL contains session ID, remove it
    if (!defined('AJAX_REQUEST') && !empty($_REQUEST[Session::getName()]) && $_SERVER['REQUEST_METHOD'] == 'GET') {
        fn_redirect(fn_query_remove(Registry::get('config.current_url'), Session::getName()));
    }
    // If demo mode is enabled, check permissions FIX ME - why did we need one more user login check?
    if ($area == 'A') {
        if (Registry::get('config.demo_mode') == true) {
            $run_controllers = fn_check_permissions($controller, $mode, 'demo');
            if ($run_controllers == false) {
                fn_set_notification('W', __('demo_mode'), __('demo_mode_content_text'), 'K', 'demo_mode');
                if (defined('AJAX_REQUEST')) {
                    exit;
                }
                fn_delete_notification('changes_saved');
                $status = CONTROLLER_STATUS_REDIRECT;
                $_REQUEST['redirect_url'] = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : fn_url('');
            }
        } else {
            $run_controllers = fn_check_permissions($controller, $mode, 'admin', '', $_REQUEST);
            if ($run_controllers == false) {
                if (defined('AJAX_REQUEST')) {
                    $_info = Debugger::isActive() || fn_is_development() ? ' ' . $controller . '.' . $mode : '';
                    fn_set_notification('W', __('warning'), __('access_denied') . $_info);
                    exit;
                }
                $status = CONTROLLER_STATUS_DENIED;
            }
        }
    }
    if ($_SERVER['REQUEST_METHOD'] != 'POST' && !defined('AJAX_REQUEST')) {
        if ($area == 'A' && empty($_REQUEST['keep_location']) && !defined('CONSOLE')) {
            if (!defined('HTTPS') && Registry::get('settings.Security.secure_admin') == 'Y') {
                fn_redirect(Registry::get('config.https_location') . '/' . Registry::get('config.current_url'));
            } elseif (defined('HTTPS') && Registry::get('settings.Security.secure_admin') != 'Y') {
                fn_redirect(Registry::get('config.http_location') . '/' . Registry::get('config.current_url'));
            }
        } elseif ($area == 'C') {
            $secure_controllers = fn_get_secure_controllers();
            // if we are not on https but controller is secure, redirect to https
            if (!defined('HTTPS') && (Registry::get('settings.Security.secure_storefront') == 'full' || isset($secure_controllers[$controller]) && $secure_controllers[$controller] == 'active')) {
                fn_redirect(Registry::get('config.https_location') . '/' . Registry::get('config.current_url'), false, true);
            }
            // if we are on https and the controller is insecure, redirect to http
            if (defined('HTTPS') && Registry::get('settings.Security.secure_storefront') != 'full' && !isset($secure_controllers[$controller]) && Registry::get('settings.Security.keep_https') != 'Y') {
                fn_redirect(Registry::get('config.http_location') . '/' . Registry::get('config.current_url'), false, true);
            }
        }
    }
    LastView::instance()->prepare($_REQUEST);
    $controllers_cascade = array();
    $controllers_list = array('init');
    if ($run_controllers == true) {
        $controllers_list[] = $controller;
//.........这里部分代码省略.........
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:101,代码来源:fn.control.php


示例19: fn_update_user


//.........这里部分代码省略.........
                }
                if ($msg) {
                    fn_set_notification('E', fn_get_lang_var('error'), implode('<br />', $msg));
                }
                // Check last 4 passwords
                if (!empty($user_id)) {
                    $prev_passwords = !empty($current_user_data['last_passwords']) ? explode(',', $current_user_data['last_passwords']) : array();
                    if (!empty($_SESSION['auth']['forced_password_change'])) {
                        // if forced password change - new password can't be equal to current password.
                        $prev_passwords[] = $current_user_data['password'];
                    }
                    if (in_array(md5($user_data['password1']), $prev_passwords) || in_array(md5($user_data['password2']), $prev_passwords)) {
                        $valid_passwords = false;
                        fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('error_password_was_used'));
                    } else {
                        if (count($prev_passwords) >= 5) {
                            array_shift($prev_passwords);
                        }
                        $user_data['last_passwords'] = implode(',', $prev_passwords);
                    }
                }
            }
            // PCI DSS Compliance
            if (!$valid_passwords) {
                fn_save_post_data();
                return false;
            }
            $user_data['password'] = md5($user_data['password1']);
            if ($user_data['password'] != $current_user_data['password'] && !empty($user_id)) {
                // if user set current password - there is no necessity to update password_change_timestamp
                $user_data['password_change_timestamp'] = $_SESSION['auth']['password_change_timestamp'] = TIME;
            }
            unset($_SESSION['auth']['forced_password_change']);
            fn_delete_notification('password_expire');
        }
    }
    $user_data['status'] = AREA != 'A' || empty($user_data['status']) ? $current_user_data['status'] : $user_data['status'];
    // only administrator can change user status
    // Fill the firstname, lastname and phone from the billing address if the profile was created or updated through the admin area.
    if (AREA != 'A') {
        Registry::get('settings.General.address_position') == 'billing_first' ? $address_zone = 'b' : ($address_zone = 's');
    } else {
        $address_zone = 'b';
    }
    if (!empty($user_data['firstname']) || !empty($user_data[$address_zone . '_firstname'])) {
        $user_data['firstname'] = empty($user_data['firstname']) && !empty($user_data[$address_zone . '_firstname']) ? $user_data[$address_zone . '_firstname'] : $user_data['firstname'];
    }
    if (!empty($user_data['lastname']) || !empty($user_data[$address_zone . '_lastname'])) {
        $user_data['lastname'] = empty($user_data['lastname']) && !empty($user_data[$address_zone . '_lastname']) ? $user_data[$address_zone . '_lastname'] : $user_data['lastname'];
    }
    if (!empty($user_data['phone']) || !empty($user_data[$address_zone . '_phone'])) {
        $user_data['phone'] = empty($user_data['phone']) && !empty($user_data[$address_zone . '_phone']) ? $user_data[$address_zone . '_phone'] : $user_data['phone'];
    }
    // reset company_id for root admin
    if ($user_id == 1) {
        $user_data['company_id'] = 0;
    }
    if (!empty($user_id)) {
        db_query("UPDATE ?:users SET ?u WHERE user_id = ?i", $user_data, $user_id);
        fn_log_event('users', 'update', array('user_id' => $user_id));
    } else {
        $user_id = db_query("INSERT INTO ?:users ?e", $user_data);
        fn_log_event('users', 'create', array('user_id' => $user_id));
    }
    $user_data['user_id'] = $user_id;
    // Set/delete insecure password notification
开发者ID:diedsmiling,项目名称:busenika,代码行数:67,代码来源:fn.users.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fn_echo函数代码示例发布时间:2022-05-15
下一篇:
PHP fn_define函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap