当前位置: 首页>>代码示例>>PHP>>正文


PHP UserList::load_from_Request方法代码示例

本文整理汇总了PHP中UserList::load_from_Request方法的典型用法代码示例。如果您正苦于以下问题:PHP UserList::load_from_Request方法的具体用法?PHP UserList::load_from_Request怎么用?PHP UserList::load_from_Request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserList的用法示例。


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

示例1: get_filterset_user_IDs

/**
 * Get user IDs from current filterset of users list
 *
 * @param string Filterset name
 * return array User IDs
 */
function get_filterset_user_IDs($filterset_name = 'admin')
{
    load_class('users/model/_userlist.class.php', 'UserList');
    // Initialize users list from session cache in order to get users IDs for newsletter
    $UserList = new UserList($filterset_name);
    $UserList->memorize = false;
    $UserList->load_from_Request();
    return $UserList->filters['users'];
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:15,代码来源:_emailcampaign.funcs.php

示例2: array

     $edit_Plugin =& $admin_Plugins->get_by_ID($plugin_ID);
     load_funcs('plugins/_plugin.funcs.php');
     _set_setting_by_path($edit_Plugin, 'UserSettings', $set_path, array());
     $edit_Plugin->Settings->dbupdate();
     $action = 'edit';
     break;
 case 'search':
     // Quick search
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('user');
     param('user_search', 'string', '');
     set_param('keywords', $user_search);
     set_param('filter', 'new');
     load_class('users/model/_userlist.class.php', 'UserList');
     $UserList = new UserList('admin', $UserSettings->get('results_per_page'), 'users_', array('join_city' => false));
     $UserList->load_from_Request();
     // Make query to get a count of users
     $UserList->query();
     if ($UserList->get_total_rows() == 1) {
         // If we find only one user by quick search we do a redirect to user's edit page
         $User = $UserList->rows[0];
         if (!empty($User)) {
             header_redirect('?ctrl=user&user_tab=profile&user_ID=' . $User->user_ID);
         }
     }
     // Unset the filter to avoid the step 1 in the function $UserList->query() on the users list
     set_param('filter', '');
     break;
 case 'remove_sender_customization':
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('users');
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:users.ctrl.php

示例3: skin_init


//.........这里部分代码省略.........
                $UserCache =& get_UserCache();
                $User =& $UserCache->get_by_ID($user_ID, false);
                if (empty($User)) {
                    $Messages->add(T_('The requested user does not exist!'));
                    header_redirect($error_redirect_to);
                    // will have exited
                }
                if ($User->check_status('is_closed')) {
                    $Messages->add(T_('The requested user account is closed!'));
                    header_redirect($error_redirect_to);
                    // will have exited
                }
                if (has_cross_country_restriction('any')) {
                    if (empty($current_User->ctry_ID)) {
                        // Current User country is not set
                        $Messages->add(T_('Please specify your country before attempting to contact other users.'));
                        header_redirect(get_user_profile_url());
                        // will have exited
                    }
                    if (has_cross_country_restriction('users', 'profile') && $current_User->ctry_ID !== $User->ctry_ID) {
                        // Current user country is different then edited user country and cross country user browsing is not enabled.
                        $Messages->add(T_('You don\'t have permission to view this user profile.'));
                        header_redirect(url_add_param($error_redirect_to, 'disp=403', '&'));
                        // will have exited
                    }
                }
            }
            // Initialize users list from session cache in order to display prev/next links:
            // It is used to navigate between users
            load_class('users/model/_userlist.class.php', 'UserList');
            global $UserList;
            $UserList = new UserList();
            $UserList->memorize = false;
            $UserList->load_from_Request();
            $seo_page_type = 'User display';
            break;
        case 'edit':
            global $current_User, $post_ID;
            // Post ID, go from $_GET when we edit a post from Front-office
            //          or from $_POST when we switch from Back-office
            $post_ID = param('p', 'integer', empty($post_ID) ? 0 : $post_ID, true);
            if (!is_logged_in()) {
                // Redirect to the login page if not logged in and allow anonymous user setting is OFF
                $redirect_to = url_add_param($Blog->gen_blogurl(), 'disp=edit');
                $Messages->add(T_('You must log in to create & edit posts.'));
                header_redirect(get_login_url('cannot edit posts', $redirect_to), 302);
                // will have exited
            }
            if (!$current_User->check_status('can_edit_post')) {
                if ($current_User->check_status('can_be_validated')) {
                    // user is logged in but his/her account was not activated yet
                    // Redirect to the account activation page
                    $Messages->add(T_('You must activate your account before you can create & edit posts. <b>See below:</b>'));
                    header_redirect(get_activate_info_url(), 302);
                    // will have exited
                }
                // Redirect to the blog url for users without messaging permission
                $Messages->add(T_('You are not allowed to create & edit posts!'));
                header_redirect($Blog->gen_blogurl(), 302);
            }
            // user logged in and the account was activated
            check_item_perm_edit($post_ID);
            if (!blog_has_cats($Blog->ID)) {
                // No categories are in this blog
                $error_message = T_('Since this blog has no categories, you cannot post into it.');
                if ($current_User->check_perm('blog_cats', 'edit', false, $Blog->ID)) {
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:67,代码来源:_skin.funcs.php

示例4: newsletter_send

/**
 * Send newsletter emails
 */
function newsletter_send()
{
    global $DB, $Session;
    load_class('users/model/_userlist.class.php', 'UserList');
    // Initialize users list from session cache in order to get users IDs for newsletter
    $UserList = new UserList('admin');
    $UserList->memorize = false;
    $UserList->load_from_Request();
    $users_IDs = $UserList->filters['users'];
    // Get all active users which accept newsletter email
    $SQL = get_newsletter_users_sql($users_IDs);
    $users = $DB->get_col($SQL->get());
    echo sprintf(T_('Newsletter is sending for %s users...'), count($users)) . '<br /><br />';
    evo_flush();
    $email_newsletter_params = array('message' => $Session->get('newsletter_message'));
    foreach ($users as $user_ID) {
        $UserCache =& get_UserCache();
        $User = $UserCache->get_by_ID($user_ID);
        echo sprintf(T_('Email is sending for %s (%s)...'), $User->get_identity_link(), $User->get('email')) . ' ';
        // Send a newsletter in user's locale
        locale_temp_switch($User->get('locale'));
        $email_result = send_mail_to_User($user_ID, $Session->get('newsletter_title'), 'newsletter', $email_newsletter_params);
        locale_restore_previous();
        if ($email_result) {
            // Success sending
            echo T_('OK');
        } else {
            // Failed sending
            echo '<span class="red">' . T_('Failed') . '</span>';
        }
        echo '<br />';
        evo_flush();
    }
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:37,代码来源:_newsletter.funcs.php

示例5: users_results_block

/**
 * Display the users results table
 *
 * @param array Params
 */
function users_results_block($params = array())
{
    // Make sure we are not missing any param:
    $params = array_merge(array('org_ID' => NULL, 'filterset_name' => 'admin', 'results_param_prefix' => 'users_', 'results_title' => T_('Users') . get_manual_link('users_and_groups'), 'results_no_text' => T_('No users'), 'results_order' => '/user_lastseen_ts/D', 'page_url' => get_dispctrl_url('users'), 'join_group' => true, 'join_city' => false, 'join_country' => true, 'keywords_fields' => NULL, 'where_status_closed' => NULL, 'display_params' => array(), 'display_orgstatus' => false, 'display_filters' => true, 'display_btn_refresh' => true, 'display_btn_adduser' => true, 'display_btn_addgroup' => true, 'display_ID' => true, 'display_avatar' => true, 'display_login' => true, 'display_nickname' => true, 'display_name' => true, 'display_gender' => true, 'display_country' => true, 'display_city' => false, 'display_blogs' => true, 'display_source' => true, 'display_regdate' => true, 'display_regcountry' => true, 'display_update' => true, 'display_lastvisit' => true, 'display_contact' => true, 'display_reported' => true, 'display_group' => true, 'display_level' => true, 'display_status' => true, 'display_actions' => true, 'display_newsletter' => true, 'force_check_user' => false), $params);
    global $current_User;
    if (!$params['force_check_user']) {
        if (!is_logged_in()) {
            // Only logged in users can access to this function
            return;
        }
        if (!$current_User->check_perm('users', 'view')) {
            // Check minimum permission:
            return;
        }
    }
    global $DB, $UserSettings, $Settings, $action, $admin_url;
    // query which groups have users (in order to prevent deletion of groups which have users)
    global $usedgroups;
    // We need this in a callback below
    $usedgroups = $DB->get_col('SELECT grp_ID
		FROM T_groups INNER JOIN T_users ON user_grp_ID = grp_ID
		GROUP BY grp_ID');
    // Create result set:
    load_class('users/model/_userlist.class.php', 'UserList');
    $UserList = new UserList($params['filterset_name'], $UserSettings->get('results_per_page'), $params['results_param_prefix'], array('join_group' => $params['join_group'], 'join_city' => $params['join_city'], 'join_country' => $params['join_country'], 'keywords_fields' => $params['keywords_fields'], 'where_status_closed' => $params['where_status_closed'], 'where_org_ID' => $params['org_ID']));
    $default_filters = array('order' => $params['results_order'], 'org' => $params['org_ID']);
    $UserList->title = $params['results_title'];
    $UserList->no_results_text = $params['results_no_text'];
    $UserList->set_default_filters($default_filters);
    $UserList->load_from_Request();
    // Initialize Results object
    users_results($UserList, $params);
    if ($action == 'show_recent') {
        // Sort an users list by "Registered" field
        $UserList->set_order('user_created_datetime');
    }
    // Execute query
    $UserList->query();
    if ($params['display_filters']) {
        // Display the filters
        $filter_presets = array('all' => array(T_('All users'), url_add_param($params['page_url'], 'filter=new')), 'men' => array(T_('Men'), url_add_param($params['page_url'], 'gender_men=1&amp;filter=new')), 'women' => array(T_('Women'), url_add_param($params['page_url'], 'gender_women=1&amp;filter=new')));
        if (is_admin_page()) {
            // Add show only activated users filter only on admin interface
            $filter_presets['activated'] = array(T_('Activated users'), url_add_param($params['page_url'], 'status_activated=1&amp;filter=new'));
            if (is_logged_in() && $current_User->check_perm('users', 'edit')) {
                // Show "Reported Users" filter only for users with edit user permission
                $filter_presets['reported'] = array(T_('Reported users'), url_add_param($params['page_url'], 'reported=1&amp;filter=new'));
            }
        }
        if ($UserList->is_filtered()) {
            // Display link to reset filters only if some filter is applied
            $UserList->global_icon(T_('Reset filters'), 'reset_filters', url_add_param($params['page_url'], 'filter=reset'), T_('Reset filters'), 3, 4, array('class' => 'action_icon btn-warning'));
        }
        $UserList->filter_area = array('callback' => 'callback_filter_userlist', 'url_ignore' => 'users_paged,u_paged,keywords', 'presets' => $filter_presets);
    }
    /*
     * Table icons:
     */
    if ($params['display_btn_refresh']) {
        // Display a button to refresh the users list
        $UserList->global_icon(T_('Refresh users list...'), 'refresh', url_add_param($params['page_url'], 'filter=refresh'), T_('Refresh'), 3, 4, array('class' => 'action_icon btn-warning'));
    }
    if (is_logged_in() && $current_User->check_perm('users', 'edit', false)) {
        if ($params['display_btn_adduser']) {
            // Display a button to add user
            $UserList->global_icon(T_('Create a new user...'), 'new', $admin_url . '?ctrl=user&amp;action=new&amp;user_tab=profile', T_('Add user') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
        }
        if ($params['display_btn_adduser']) {
            // Display a button to add group
            $UserList->global_icon(T_('Create a new group...'), 'new', $admin_url . '?ctrl=groups&amp;action=new', T_('Add group') . ' &raquo;', 3, 4);
        }
    }
    // Display result :
    $UserList->display($params['display_params']);
    if ($params['display_newsletter'] && is_logged_in() && $current_User->check_perm('emails', 'edit') && $UserList->result_num_rows > 0) {
        // Newsletter button
        global $admin_url;
        echo '<p class="center">';
        echo '<input type="button" value="' . T_('Send newsletter to the current selection') . '" onclick="location.href=\'' . $admin_url . '?ctrl=campaigns&amp;action=users&amp;' . url_crumb('campaign') . '\'" class="btn btn-default" />';
        echo '</p>';
    }
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:87,代码来源:_user.funcs.php


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