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


PHP user_active_flip函数代码示例

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


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

示例1: main

    function main($id, $mode)
    {
        global $config, $phpbb_root_path, $phpEx;
        global $db, $user, $auth, $template;
        $user_id = request_var('u', 0);
        $key = request_var('k', '');
        $sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason
			FROM ' . USERS_TABLE . "\n\t\t\tWHERE user_id = {$user_id}";
        $result = $db->sql_query($sql);
        $user_row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        if (!$user_row) {
            trigger_error('NO_USER');
        }
        if ($user_row['user_type'] != USER_INACTIVE && !$user_row['user_newpasswd']) {
            meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
            trigger_error('ALREADY_ACTIVATED');
        }
        if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL || $user_row['user_actkey'] != $key) {
            trigger_error('WRONG_ACTIVATION');
        }
        $update_password = $user_row['user_newpasswd'] ? true : false;
        if ($update_password) {
            $sql_ary = array('user_actkey' => '', 'user_password' => $user_row['user_newpasswd'], 'user_newpasswd' => '', 'user_pass_convert' => 0, 'user_login_attempts' => 0);
            $sql = 'UPDATE ' . USERS_TABLE . '
				SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
				WHERE user_id = ' . $user_row['user_id'];
            $db->sql_query($sql);
        }
        if (!$update_password) {
            include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
            user_active_flip('activate', $user_row['user_id']);
            $sql = 'UPDATE ' . USERS_TABLE . "\n\t\t\t\tSET user_actkey = ''\n\t\t\t\tWHERE user_id = {$user_row['user_id']}";
            $db->sql_query($sql);
        }
        if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) {
            include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
            $messenger = new messenger(false);
            $messenger->template('admin_welcome_activated', $user_row['user_lang']);
            $messenger->to($user_row['user_email'], $user_row['username']);
            $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
            $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
            $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
            $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
            $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($user_row['username'])));
            $messenger->send($user_row['user_notify_type']);
            $message = 'ACCOUNT_ACTIVE_ADMIN';
        } else {
            if (!$update_password) {
                $message = $user_row['user_inactive_reason'] == INACTIVE_PROFILE ? 'ACCOUNT_ACTIVE_PROFILE' : 'ACCOUNT_ACTIVE';
            } else {
                $message = 'PASSWORD_ACTIVATED';
            }
        }
        meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
        trigger_error($user->lang[$message]);
    }
开发者ID:jvinhit,项目名称:php,代码行数:57,代码来源:ucp_activate.php

示例2: main

    function main($id, $mode)
    {
        global $config, $phpbb_root_path, $phpEx;
        global $db, $user, $auth, $template;
        $user_id = request_var('u', 0);
        $key = request_var('k', '');
        $sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey
			FROM ' . USERS_TABLE . "\n\t\t\tWHERE user_id = {$user_id}";
        $result = $db->sql_query($sql);
        $user_row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        if (!$user_row) {
            trigger_error('NO_USER');
        }
        if ($user_row['user_type'] != USER_INACTIVE && !$user_row['user_newpasswd']) {
            meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
            trigger_error('ALREADY_ACTIVATED');
        }
        if ($user_row['user_actkey'] != $key) {
            trigger_error('WRONG_ACTIVATION');
        }
        $update_password = $user_row['user_newpasswd'] ? true : false;
        if ($update_password) {
            $sql_ary = array('user_type' => USER_NORMAL, 'user_actkey' => '', 'user_password' => $user_row['user_newpasswd'], 'user_newpasswd' => '');
            $sql = 'UPDATE ' . USERS_TABLE . '
				SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
				WHERE user_id = ' . $user_row['user_id'];
            $db->sql_query($sql);
        }
        if (!$update_password) {
            include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
            // Now we need to demote the user from the inactive group and add him to the registered group
            user_active_flip($user_row['user_id'], $user_row['user_type'], '', $user_row['username'], true);
            // Update last username
            update_last_username();
            set_config('num_users', $config['num_users'] + 1, true);
        }
        if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) {
            include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
            $messenger = new messenger(false);
            $messenger->template('admin_welcome_activated', $user_row['user_lang']);
            $messenger->replyto($config['board_contact']);
            $messenger->to($user_row['user_email'], $user_row['username']);
            $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
            $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
            $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
            $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
            $messenger->assign_vars(array('SITENAME' => $config['sitename'], 'USERNAME' => html_entity_decode($user_row['username']), 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])));
            $messenger->send($user_row['user_notify_type']);
            $message = 'ACCOUNT_ACTIVE_ADMIN';
        } else {
            $message = !$update_password ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED';
        }
        meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
        trigger_error($user->lang[$message]);
    }
开发者ID:yunsite,项目名称:gloryroad,代码行数:56,代码来源:ucp_activate.php

示例3: main

    function main($id, $mode)
    {
        global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
        $user->add_lang('posting');
        $preview = !empty($_POST['preview']) ? true : false;
        $submit = !empty($_POST['submit']) ? true : false;
        $delete = !empty($_POST['delete']) ? true : false;
        $error = $data = array();
        $s_hidden_fields = '';
        switch ($mode) {
            case 'reg_details':
                $data = array('username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)), 'email' => strtolower(request_var('email', $user->data['user_email'])), 'email_confirm' => strtolower(request_var('email_confirm', '')), 'new_password' => request_var('new_password', '', true), 'cur_password' => request_var('cur_password', '', true), 'password_confirm' => request_var('password_confirm', '', true));
                add_form_key('ucp_reg_details');
                if ($submit) {
                    // Do not check cur_password, it is the old one.
                    $check_ary = array('new_password' => array(array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), array('password')), 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), 'email' => array(array('string', false, 6, 60), array('email')), 'email_confirm' => array('string', true, 6, 60));
                    if ($auth->acl_get('u_chgname') && $config['allow_namechange']) {
                        $check_ary['username'] = array(array('string', false, $config['min_name_chars'], $config['max_name_chars']), array('username'));
                    }
                    $error = validate_data($data, $check_ary);
                    if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email']) {
                        $error[] = $data['email_confirm'] ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY';
                    }
                    if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password']) {
                        $error[] = $data['password_confirm'] ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY';
                    }
                    // Only check the new password against the previous password if there have been no errors
                    if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && phpbb_check_hash($data['new_password'], $user->data['user_password'])) {
                        $error[] = 'SAME_PASSWORD_ERROR';
                    }
                    if (!phpbb_check_hash($data['cur_password'], $user->data['user_password'])) {
                        $error[] = $data['cur_password'] ? 'CUR_PASSWORD_ERROR' : 'CUR_PASSWORD_EMPTY';
                    }
                    if (!check_form_key('ucp_reg_details')) {
                        $error[] = 'FORM_INVALID';
                    }
                    if (!sizeof($error)) {
                        $sql_ary = array('username' => $auth->acl_get('u_chgname') && $config['allow_namechange'] ? $data['username'] : $user->data['username'], 'username_clean' => $auth->acl_get('u_chgname') && $config['allow_namechange'] ? utf8_clean_string($data['username']) : $user->data['username_clean'], 'user_email' => $auth->acl_get('u_chgemail') ? $data['email'] : $user->data['user_email'], 'user_email_hash' => $auth->acl_get('u_chgemail') ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'], 'user_password' => $auth->acl_get('u_chgpasswd') && $data['new_password'] ? phpbb_hash($data['new_password']) : $user->data['user_password'], 'user_passchg' => $auth->acl_get('u_chgpasswd') && $data['new_password'] ? time() : 0);
                        if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $data['username'] != $user->data['username']) {
                            add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_NAME', $user->data['username'], $data['username']);
                        }
                        if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && !phpbb_check_hash($data['new_password'], $user->data['user_password'])) {
                            $user->reset_login_keys();
                            add_log('user', $user->data['user_id'], 'LOG_USER_NEW_PASSWORD', $data['username']);
                        }
                        if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) {
                            add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']);
                        }
                        $message = 'PROFILE_UPDATED';
                        if ($auth->acl_get('u_chgemail') && $config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN)) {
                            $message = $config['require_activation'] == USER_ACTIVATION_SELF ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';
                            include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                            $server_url = generate_board_url();
                            $user_actkey = gen_rand_string(mt_rand(6, 10));
                            $messenger = new messenger(false);
                            $template_file = $config['require_activation'] == USER_ACTIVATION_ADMIN ? 'user_activate_inactive' : 'user_activate';
                            $messenger->template($template_file, $user->data['user_lang']);
                            $messenger->to($data['email'], $data['username']);
                            $messenger->anti_abuse_headers($config, $user);
                            $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($data['username']), 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user->data['user_id']}&k={$user_actkey}"));
                            $messenger->send(NOTIFY_EMAIL);
                            if ($config['require_activation'] == USER_ACTIVATION_ADMIN) {
                                // Grab an array of user_id's with a_user permissions ... these users can activate a user
                                $admin_ary = $auth->acl_get_list(false, 'a_user', false);
                                $admin_ary = !empty($admin_ary[0]['a_user']) ? $admin_ary[0]['a_user'] : array();
                                // Also include founders
                                $where_sql = ' WHERE user_type = ' . USER_FOUNDER;
                                if (sizeof($admin_ary)) {
                                    $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
                                }
                                $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
									FROM ' . USERS_TABLE . ' ' . $where_sql;
                                $result = $db->sql_query($sql);
                                while ($row = $db->sql_fetchrow($result)) {
                                    $messenger->template('admin_activate', $row['user_lang']);
                                    $messenger->to($row['user_email'], $row['username']);
                                    $messenger->im($row['user_jabber'], $row['username']);
                                    $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($data['username']), 'U_USER_DETAILS' => "{$server_url}/memberlist.{$phpEx}?mode=viewprofile&u={$user->data['user_id']}", 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user->data['user_id']}&k={$user_actkey}"));
                                    $messenger->send($row['user_notify_type']);
                                }
                                $db->sql_freeresult($result);
                            }
                            user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE);
                            // Because we want the profile to be reactivated we set user_newpasswd to empty (else the reactivation will fail)
                            $sql_ary['user_actkey'] = $user_actkey;
                            $sql_ary['user_newpasswd'] = '';
                        }
                        if (sizeof($sql_ary)) {
                            $sql = 'UPDATE ' . USERS_TABLE . '
								SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
								WHERE user_id = ' . $user->data['user_id'];
                            $db->sql_query($sql);
                        }
                        // Need to update config, forum, topic, posting, messages, etc.
                        if ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange']) {
                            user_update_name($user->data['username'], $data['username']);
                        }
                        // Now, we can remove the user completely (kill the session) - NOT BEFORE!!!
                        if (!empty($sql_ary['user_actkey'])) {
                            meta_refresh(5, append_sid($phpbb_root_path . 'index.' . $phpEx));
//.........这里部分代码省略.........
开发者ID:ahmatjan,项目名称:Crimson,代码行数:101,代码来源:ucp_profile.php

示例4: user_justification_activate

 /**
  * Activate user
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 private function user_justification_activate()
 {
     $user = $this->data;
     if (!function_exists('user_active_flip')) {
         include $this->root_path . 'includes/functions_user.' . $this->php_ext;
     }
     if (!class_exists('messenger')) {
         include $this->root_path . 'includes/functions_messenger.' . $this->php_ext;
     }
     user_active_flip('activate', $user['user_id']);
     $messenger = new \messenger(false);
     $messenger->template('admin_welcome_activated', $user['user_lang']);
     $messenger->to($user['user_email'], $user['username']);
     $messenger->anti_abuse_headers($this->config, $this->user);
     $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($user['username'])));
     $messenger->send(NOTIFY_EMAIL);
     $messenger->save_queue();
     $this->log->add('user', $this->user->data['user_id'], $this->user->ip, 'LOG_USER_ACTIVE', time(), array($user['username']));
 }
开发者ID:alhitary,项目名称:phpBB-3.1-activation-justification,代码行数:26,代码来源:listener.php

示例5: user_ban

 if (confirm_box(true) && !$error) {
     if (!function_exists('user_ban')) {
         include $phpbb_root_path . 'includes/functions_user.' . $phpEx;
     }
     if (!function_exists('delete_posts')) {
         include $phpbb_root_path . 'includes/functions_admin.' . $phpEx;
     }
     // Ban the user
     if ($config['asacp_ocban_username']) {
         user_ban('user', $user_row['username'], 0, '', false, utf8_normalize_nfc(request_var('ban_reason', '', true)), utf8_normalize_nfc(request_var('ban_reason_shown', '', true)));
         // Remove the flag on the user's account if they are banned
         $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_flagged = 0 WHERE user_id = ' . $user_id);
     }
     // Deactivate the user
     if ($config['asacp_ocban_deactivate']) {
         user_active_flip('deactivate', $user_id, INACTIVE_MANUAL);
     }
     // Move the user to a certain group
     if ($config['asacp_ocban_move_to_group']) {
         $sql = 'SELECT group_id FROM ' . USER_GROUP_TABLE . ' WHERE user_id = ' . $user_id;
         $result = $db->sql_query($sql);
         while ($row = $db->sql_fetchrow($result)) {
             group_user_del($row['group_id'], array($user_id), array($username));
         }
         $db->sql_freeresult($result);
         group_user_add($config['asacp_ocban_move_to_group'], array($user_id), array($username), false, true);
     }
     // Delete the user's posts
     if ($config['asacp_ocban_delete_posts']) {
         delete_posts('poster_id', $user_id);
     }
开发者ID:esacinc,项目名称:forum-sitplatform-org-website,代码行数:31,代码来源:index.php

示例6: prune_users

    /**
     * Prune users
     */
    function prune_users($id, $mode)
    {
        global $db, $user, $auth, $template, $cache;
        global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
        $user->add_lang('memberlist');
        $prune = isset($_POST['prune']) ? true : false;
        if ($prune) {
            if (confirm_box(true)) {
                $users = request_var('users', '');
                $action = request_var('action', 'deactivate');
                $deleteposts = request_var('deleteposts', 0);
                if ($users) {
                    $users = explode("\n", $users);
                    $where_sql = '';
                    foreach ($users as $username) {
                        $where_sql .= ($where_sql != '' ? ', ' : '') . "'" . $db->sql_escape($username) . "'";
                    }
                    $where_sql = " AND username IN ({$where_sql})";
                } else {
                    $username = request_var('username', '', true);
                    $email = request_var('email', '');
                    $joined_select = request_var('joined_select', 'lt');
                    $active_select = request_var('active_select', 'lt');
                    $count_select = request_var('count_select', 'eq');
                    $joined = request_var('joined', '');
                    $active = request_var('active', '');
                    $active = $active ? explode('-', $active) : array();
                    $joined = $joined ? explode('-', $joined) : array();
                    $count = request_var('count', 0);
                    $key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
                    $sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
                    $where_sql = '';
                    $where_sql .= $username ? " AND username LIKE '" . $db->sql_escape(str_replace('*', '%', $username)) . "'" : '';
                    $where_sql .= $email ? " AND user_email LIKE '" . $db->sql_escape(str_replace('*', '%', $email)) . "' " : '';
                    $where_sql .= sizeof($joined) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : '';
                    $where_sql .= $count ? " AND user_posts " . $key_match[$count_select] . " {$count} " : '';
                    $where_sql .= sizeof($active) ? " AND user_lastvisit " . $key_match[$active_select] . " " . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]) : '';
                }
                // Get bot ids
                $sql = 'SELECT user_id 
					FROM ' . BOTS_TABLE;
                $result = $db->sql_query($sql);
                $bot_ids = array();
                while ($row = $db->sql_fetchrow($result)) {
                    $bot_ids[] = $row['user_id'];
                }
                $db->sql_freeresult($result);
                // Do not prune founder members
                $sql = 'SELECT username, user_id FROM ' . USERS_TABLE . '
					WHERE user_id <> ' . ANONYMOUS . '
						AND user_type <> ' . USER_FOUNDER . "\n\t\t\t\t\t{$where_sql}";
                $result = $db->sql_query($sql);
                $where_sql = '';
                $user_ids = $usernames = array();
                while ($row = $db->sql_fetchrow($result)) {
                    if (!in_array($row['user_id'], $bot_ids)) {
                        $user_ids[] = $row['user_id'];
                        $usernames[$row['user_id']] = $row['username'];
                    }
                }
                $db->sql_freeresult($result);
                if (sizeof($user_ids)) {
                    if ($action == 'deactivate') {
                        foreach ($user_ids as $user_id) {
                            user_active_flip($user_id, USER_NORMAL, false, false, true);
                        }
                        $l_log = 'LOG_PRUNE_USER_DEAC';
                    } else {
                        if ($action == 'delete') {
                            if ($deleteposts) {
                                foreach ($user_ids as $user_id) {
                                    user_delete('remove', $user_id);
                                }
                                $l_log = 'LOG_PRUNE_USER_DEL_DEL';
                            } else {
                                foreach ($user_ids as $user_id) {
                                    user_delete('retain', $user_id, $usernames[$user_id]);
                                }
                                $l_log = 'LOG_PRUNE_USER_DEL_ANON';
                            }
                        }
                    }
                    add_log('admin', $l_log, implode(', ', $usernames));
                }
                trigger_error($user->lang['USER_' . strtoupper($action) . '_SUCCESS'] . adm_back_link($this->u_action));
            } else {
                confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array('i' => $id, 'mode' => $mode, 'prune' => 1, 'users' => request_var('users', ''), 'username' => request_var('username', '', true), 'email' => request_var('email', ''), 'joined_select' => request_var('joined_select', ''), 'joined' => request_var('joined', ''), 'active_select' => request_var('active_select', ''), 'active' => request_var('active', ''), 'count_select' => request_var('count_select', ''), 'count' => request_var('count', 0), 'deleteposts' => request_var('deleteposts', 0), 'action' => request_var('action', ''))));
            }
        }
        $find_count = array('lt' => $user->lang['LESS_THAN'], 'eq' => $user->lang['EQUAL_TO'], 'gt' => $user->lang['MORE_THAN']);
        $s_find_count = '';
        foreach ($find_count as $key => $value) {
            $selected = $key == 'eq' ? ' selected="selected"' : '';
            $s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
        }
        $find_time = array('lt' => $user->lang['BEFORE'], 'gt' => $user->lang['AFTER']);
        $s_find_join_time = '';
//.........这里部分代码省略.........
开发者ID:yunsite,项目名称:gloryroad,代码行数:101,代码来源:acp_prune.php

示例7: eveapi_disableForumAccount

/**
 * Disables the forum account for this user.
 */
function eveapi_disableForumAccount($userId, $username, $eveapi_ts, $reason = INACTIVE_EVEAPI_INVALID, $ts3_VirtualServer = false)
{
    global $config;
    if ($config['eveapi_ts_masterswitch'] && !empty($eveapi_ts)) {
        // Removing TeamSpeak permissions
        eveapi_setTeamSpeakGroups($eveapi_ts, array(), $username, $ts3_VirtualServer, array());
    }
    if ($config['eveapi_openfire_switch']) {
        // Removing OpenFire permissions
        eveapi_setOpenFireAccess($userId, array(), array(), $username);
    }
    // Removing Forum permissions
    eveapi_setForumGroups($userId, array(), $username);
    //remove sessions (effectively logging out the user)
    cronlog("Removing user sessions and disabling account", $username);
    user_active_flip('deactivate', $userId, $reason);
}
开发者ID:Covert-Inferno,项目名称:eve_api_phpbb,代码行数:20,代码来源:functions_eveapi.php

示例8: main


//.........这里部分代码省略.........
                                    break;
                                case 'banemail':
                                    $ban[] = $user_row['user_email'];
                                    $reason = 'USER_ADMIN_BAN_EMAIL_REASON';
                                    $log = 'LOG_USER_BAN_EMAIL';
                                    break;
                                case 'banip':
                                    $ban[] = $user_row['user_ip'];
                                    $sql = 'SELECT DISTINCT poster_ip
										FROM ' . POSTS_TABLE . "\n\t\t\t\t\t\t\t\t\t\tWHERE poster_id = {$user_id}";
                                    $result = $db->sql_query($sql);
                                    while ($row = $db->sql_fetchrow($result)) {
                                        $ban[] = $row['poster_ip'];
                                    }
                                    $db->sql_freeresult($result);
                                    $reason = 'USER_ADMIN_BAN_IP_REASON';
                                    $log = 'LOG_USER_BAN_IP';
                                    break;
                            }
                            user_ban(substr($action, 3), $ban, 0, 0, 0, $user->lang[$reason]);
                            add_log('admin', $log, $user->lang[$reason]);
                            add_log('user', $user_id, $log, $user->lang[$reason]);
                            trigger_error($user->lang['BAN_SUCCESSFUL'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
                            break;
                        case 'reactivate':
                            if ($config['email_enable']) {
                                include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                                $server_url = generate_board_url();
                                $user_actkey = gen_rand_string(10);
                                $key_len = 54 - strlen($server_url);
                                $key_len = $key_len > 6 ? $key_len : 6;
                                $user_actkey = substr($user_actkey, 0, $key_len);
                                if ($user_row['user_type'] != USER_INACTIVE) {
                                    user_active_flip($user_id, $user_row['user_type'], $user_actkey, $user_row['username']);
                                }
                                $messenger = new messenger(false);
                                $messenger->template('user_resend_inactive', $user_row['user_lang']);
                                $messenger->replyto($config['board_contact']);
                                $messenger->to($user_row['user_email'], $user_row['username']);
                                $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
                                $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
                                $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
                                $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
                                $messenger->assign_vars(array('SITENAME' => $config['sitename'], 'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), 'USERNAME' => html_entity_decode($user_row['username']), 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user_row['user_id']}&k={$user_actkey}"));
                                $messenger->send(NOTIFY_EMAIL);
                                add_log('admin', 'LOG_USER_REACTIVATE', $user_row['username']);
                                add_log('user', $user_id, 'LOG_USER_REACTIVATE_USER');
                                trigger_error($user->lang['FORCE_REACTIVATION_SUCCESS'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
                            }
                            break;
                        case 'active':
                            user_active_flip($user_id, $user_row['user_type'], false, $user_row['username']);
                            $message = $user_row['user_type'] == USER_INACTIVE ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
                            $log = $user_row['user_type'] == USER_INACTIVE ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';
                            add_log('user', $user_id, $log . '_USER');
                            if ($user_row['user_type'] == USER_INACTIVE) {
                                set_config('num_users', $config['num_users'] + 1, true);
                            } else {
                                set_config('num_users', $config['num_users'] - 1, true);
                            }
                            // Update latest username
                            update_last_username();
                            trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
                            break;
                        case 'delsig':
                            $sql_ary = array('user_sig' => '', 'user_sig_bbcode_uid' => '', 'user_sig_bbcode_bitfield' => 0);
开发者ID:yunsite,项目名称:gloryroad,代码行数:67,代码来源:acp_users.php

示例9: main

    function main($id, $mode)
    {
        global $config, $db, $user, $auth, $template;
        global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
        include $phpbb_root_path . 'includes/functions_user.' . $phpEx;
        $user->add_lang('memberlist');
        $action = request_var('action', '');
        $mark = isset($_REQUEST['mark']) ? request_var('mark', array(0)) : array();
        $start = request_var('start', 0);
        $submit = isset($_POST['submit']);
        // Sort keys
        $sort_days = request_var('st', 0);
        $sort_key = request_var('sk', 'i');
        $sort_dir = request_var('sd', 'd');
        $form_key = 'acp_inactive';
        add_form_key($form_key);
        if ($submit && sizeof($mark)) {
            if ($action !== 'delete' && !check_form_key($form_key)) {
                trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
            }
            switch ($action) {
                case 'activate':
                case 'delete':
                    $sql = 'SELECT user_id, username
						FROM ' . USERS_TABLE . '
						WHERE ' . $db->sql_in_set('user_id', $mark);
                    $result = $db->sql_query($sql);
                    $user_affected = array();
                    while ($row = $db->sql_fetchrow($result)) {
                        $user_affected[$row['user_id']] = $row['username'];
                    }
                    $db->sql_freeresult($result);
                    if ($action == 'activate') {
                        if ($config['require_activation'] == USER_ACTIVATION_ADMIN) {
                            // Get those 'being activated'...
                            $sql = 'SELECT user_id, username, user_email, user_lang
								FROM ' . USERS_TABLE . '
								WHERE ' . $db->sql_in_set('user_id', $mark) . '
									AND user_type = ' . USER_INACTIVE;
                            $result = $db->sql_query($sql);
                            $inactive_users = array();
                            while ($row = $db->sql_fetchrow($result)) {
                                $inactive_users[] = $row;
                            }
                            $db->sql_freeresult($result);
                        }
                        user_active_flip('activate', $mark);
                        if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !empty($inactive_users)) {
                            include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                            $messenger = new messenger();
                            foreach ($inactive_users as $row) {
                                $messenger->template('admin_welcome_activated', $row['user_lang']);
                                $messenger->to($row['user_email'], $row['username']);
                                $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
                                $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
                                $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
                                $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
                                $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($row['username'])));
                                $messenger->send(NOTIFY_EMAIL);
                            }
                            $messenger->save_queue();
                        }
                    } else {
                        if ($action == 'delete') {
                            if (confirm_box(true)) {
                                if (!$auth->acl_get('a_userdel')) {
                                    trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
                                }
                                foreach ($mark as $user_id) {
                                    user_delete('retain', $user_id, $user_affected[$user_id]);
                                }
                                add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected));
                            } else {
                                $s_hidden_fields = array('mode' => $mode, 'action' => $action, 'mark' => $mark, 'submit' => 1, 'start' => $start);
                                confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
                            }
                        }
                    }
                    break;
                case 'remind':
                    if (empty($config['email_enable'])) {
                        trigger_error($user->lang['EMAIL_DISABLED'] . adm_back_link($this->u_action), E_USER_WARNING);
                    }
                    $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey
						FROM ' . USERS_TABLE . '
						WHERE ' . $db->sql_in_set('user_id', $mark) . '
							AND user_inactive_reason';
                    $sql .= $config['require_activation'] == USER_ACTIVATION_ADMIN ? ' = ' . INACTIVE_REMIND : ' <> ' . INACTIVE_MANUAL;
                    $result = $db->sql_query($sql);
                    if ($row = $db->sql_fetchrow($result)) {
                        // Send the messages
                        include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                        $messenger = new messenger();
                        $usernames = array();
                        do {
                            $messenger->template('user_remind_inactive', $row['user_lang']);
                            $messenger->to($row['user_email'], $row['username']);
                            $messenger->im($row['user_jabber'], $row['username']);
                            $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
                            $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
//.........这里部分代码省略.........
开发者ID:html,项目名称:PI,代码行数:101,代码来源:acp_inactive.php

示例10: main


//.........这里部分代码省略.........
        if ($auth->acl_get('u_chgname') && $config['allow_namechange']) {
            $check_ary['username'] = array(array('string', false, $config['min_name_chars'], $config['max_name_chars']), array('username'));
        }
        $error = validate_data($data, $check_ary);
        if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email']) {
            $error[] = $data['email_confirm'] ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY';
        }
        if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password']) {
            $error[] = $data['password_confirm'] ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY';
        }
        // Only check the new password against the previous password if there have been no errors
        if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && phpbb_check_hash($data['new_password'], $user->data['user_password'])) {
            $error[] = 'SAME_PASSWORD_ERROR';
        }
        if (!$verify_result && !phpbb_check_hash($data['cur_password'], $user->data['user_password'])) {
            $error[] = $data['cur_password'] ? 'CUR_PASSWORD_ERROR' : 'CUR_PASSWORD_EMPTY';
        }
        if (!sizeof($error)) {
            $sql_ary = array('username' => $auth->acl_get('u_chgname') && $config['allow_namechange'] ? $data['username'] : $user->data['username'], 'username_clean' => $auth->acl_get('u_chgname') && $config['allow_namechange'] ? utf8_clean_string($data['username']) : $user->data['username_clean'], 'user_email' => $auth->acl_get('u_chgemail') ? $data['email'] : $user->data['user_email'], 'user_email_hash' => $auth->acl_get('u_chgemail') ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'], 'user_password' => $auth->acl_get('u_chgpasswd') && $data['new_password'] ? phpbb_hash($data['new_password']) : $user->data['user_password'], 'user_passchg' => $auth->acl_get('u_chgpasswd') && $data['new_password'] ? time() : 0);
            if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $data['username'] != $user->data['username']) {
                add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_NAME', $user->data['username'], $data['username']);
            }
            if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && !phpbb_check_hash($data['new_password'], $user->data['user_password'])) {
                $user->reset_login_keys();
                add_log('user', $user->data['user_id'], 'LOG_USER_NEW_PASSWORD', $data['username']);
            }
            if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) {
                add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']);
            }
            $message = 'PROFILE_UPDATED';
            if ($auth->acl_get('u_chgemail') && $config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN)) {
                $message = $config['require_activation'] == USER_ACTIVATION_SELF ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';
                include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                $server_url = generate_board_url();
                $user_actkey = gen_rand_string(mt_rand(6, 10));
                $messenger = new messenger(false);
                $template_file = $config['require_activation'] == USER_ACTIVATION_ADMIN ? 'user_activate_inactive' : 'user_activate';
                $messenger->template($template_file, $user->data['user_lang']);
                $messenger->to($data['email'], $data['username']);
                if (!method_exists($messenger, 'anti_abuse_headers')) {
                    $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
                    $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
                    $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
                    $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
                } else {
                    $messenger->anti_abuse_headers($config, $user);
                }
                $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($data['username']), 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user->data['user_id']}&k={$user_actkey}"));
                $messenger->send(NOTIFY_EMAIL);
                if ($config['require_activation'] == USER_ACTIVATION_ADMIN) {
                    // Grab an array of user_id's with a_user permissions ... these users can activate a user
                    $admin_ary = $auth->acl_get_list(false, 'a_user', false);
                    $admin_ary = !empty($admin_ary[0]['a_user']) ? $admin_ary[0]['a_user'] : array();
                    // Also include founders
                    $where_sql = ' WHERE user_type = ' . USER_FOUNDER;
                    if (sizeof($admin_ary)) {
                        $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
                    }
                    $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
						FROM ' . USERS_TABLE . ' ' . $where_sql;
                    $result = $db->sql_query($sql);
                    while ($row = $db->sql_fetchrow($result)) {
                        $messenger->template('admin_activate', $row['user_lang']);
                        $messenger->to($row['user_email'], $row['username']);
                        $messenger->im($row['user_jabber'], $row['username']);
                        $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($data['username']), 'U_USER_DETAILS' => "{$server_url}/memberlist.{$phpEx}?mode=viewprofile&u={$user->data['user_id']}", 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user->data['user_id']}&k={$user_actkey}"));
                        $messenger->send($row['user_notify_type']);
                    }
                    $db->sql_freeresult($result);
                }
                user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE);
                // Because we want the profile to be reactivated we set user_newpasswd to empty (else the reactivation will fail)
                $sql_ary['user_actkey'] = $user_actkey;
                $sql_ary['user_newpasswd'] = '';
            }
            if (sizeof($sql_ary)) {
                $sql = 'UPDATE ' . USERS_TABLE . '
					SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
					WHERE user_id = ' . $user->data['user_id'];
                $db->sql_query($sql);
            }
            // Need to update config, forum, topic, posting, messages, etc.
            if ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange']) {
                user_update_name($user->data['username'], $data['username']);
            }
            // Now, we can remove the user completely (kill the session) - NOT BEFORE!!!
            if (!empty($sql_ary['user_actkey'])) {
                // Because the user gets deactivated we log him out too, killing his session
                $user->session_kill();
            }
        }
        // Replace "error" strings with their real, localised form
        $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
        if (!empty($error)) {
            $this->result_text = $error[0];
            $this->result = false;
            return;
        }
        $this->result = true;
    }
开发者ID:danielgospodinow,项目名称:GamingZone,代码行数:101,代码来源:mobi_ucp_profile.php

示例11: execute

 /**
  * Executes the command user:activate
  *
  * Activate (or deactivate) a user account
  *
  * @param InputInterface  $input  The input stream used to get the options
  * @param OutputInterface $output The output stream, used to print messages
  *
  * @return int 0 if all is well, 1 if any errors occurred
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $io = new SymfonyStyle($input, $output);
     $name = $input->getArgument('username');
     $mode = $input->getOption('deactivate') ? 'deactivate' : 'activate';
     $user_id = $this->user_loader->load_user_by_username($name);
     $user_row = $this->user_loader->get_user($user_id);
     if ($user_row['user_id'] == ANONYMOUS) {
         $io->error($this->language->lang('NO_USER'));
         return 1;
     }
     // Check if the user is already active (or inactive)
     if ($mode == 'activate' && $user_row['user_type'] != USER_INACTIVE) {
         $io->error($this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE_ACTIVE'));
         return 1;
     } else {
         if ($mode == 'deactivate' && $user_row['user_type'] == USER_INACTIVE) {
             $io->error($this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE_INACTIVE'));
             return 1;
         }
     }
     // Activate the user account
     if (!function_exists('user_active_flip')) {
         require $this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext;
     }
     user_active_flip($mode, $user_row['user_id']);
     // Notify the user upon activation
     if ($mode == 'activate' && $this->config['require_activation'] == USER_ACTIVATION_ADMIN) {
         $this->send_notification($user_row, $input);
     }
     // Log and display the result
     $msg = $mode == 'activate' ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
     $log = $mode == 'activate' ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';
     $this->log->add('admin', ANONYMOUS, '', $log, false, array($user_row['username']));
     $this->log->add('user', ANONYMOUS, '', $log . '_USER', false, array('reportee_id' => $user_row['user_id']));
     $io->success($this->language->lang($msg));
     return 0;
 }
开发者ID:phpbb,项目名称:phpbb-core,代码行数:48,代码来源:activate.php

示例12: prune_users

 /**
  * Prune users
  */
 function prune_users($id, $mode)
 {
     global $db, $user, $auth, $template, $cache;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $user->add_lang('memberlist');
     $prune = isset($_POST['prune']) ? true : false;
     if ($prune) {
         $action = request_var('action', 'deactivate');
         $deleteposts = request_var('deleteposts', 0);
         if (confirm_box(true)) {
             $user_ids = $usernames = array();
             $this->get_prune_users($user_ids, $usernames);
             if (sizeof($user_ids)) {
                 if ($action == 'deactivate') {
                     user_active_flip('deactivate', $user_ids);
                     $l_log = 'LOG_PRUNE_USER_DEAC';
                 } else {
                     if ($action == 'delete') {
                         if ($deleteposts) {
                             foreach ($user_ids as $user_id) {
                                 user_delete('remove', $user_id);
                             }
                             $l_log = 'LOG_PRUNE_USER_DEL_DEL';
                         } else {
                             foreach ($user_ids as $user_id) {
                                 user_delete('retain', $user_id, $usernames[$user_id]);
                             }
                             $l_log = 'LOG_PRUNE_USER_DEL_ANON';
                         }
                     }
                 }
                 add_log('admin', $l_log, implode(', ', $usernames));
                 $msg = $user->lang['USER_' . strtoupper($action) . '_SUCCESS'];
             } else {
                 $msg = $user->lang['USER_PRUNE_FAILURE'];
             }
             trigger_error($msg . adm_back_link($this->u_action));
         } else {
             // We list the users which will be pruned...
             $user_ids = $usernames = array();
             $this->get_prune_users($user_ids, $usernames);
             if (!sizeof($user_ids)) {
                 trigger_error($user->lang['USER_PRUNE_FAILURE'] . adm_back_link($this->u_action), E_USER_WARNING);
             }
             // Assign to template
             foreach ($user_ids as $user_id) {
                 $template->assign_block_vars('users', array('USERNAME' => $usernames[$user_id], 'U_PROFILE' => append_sid($phpbb_root_path . 'memberlist.' . $phpEx, 'mode=viewprofile&amp;u=' . $user_id), 'U_USER_ADMIN' => $auth->acl_get('a_user') ? append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=users&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : ''));
             }
             $template->assign_vars(array('S_DEACTIVATE' => $action == 'deactivate' ? true : false, 'S_DELETE' => $action == 'delete' ? true : false));
             confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array('i' => $id, 'mode' => $mode, 'prune' => 1, 'users' => request_var('users', '', true), 'username' => request_var('username', '', true), 'email' => request_var('email', ''), 'joined_select' => request_var('joined_select', ''), 'joined' => request_var('joined', ''), 'active_select' => request_var('active_select', ''), 'active' => request_var('active', ''), 'count_select' => request_var('count_select', ''), 'count' => request_var('count', ''), 'deleteposts' => request_var('deleteposts', 0), 'action' => request_var('action', ''))), 'confirm_body_prune.html');
         }
     }
     $find_count = array('lt' => $user->lang['LESS_THAN'], 'eq' => $user->lang['EQUAL_TO'], 'gt' => $user->lang['MORE_THAN']);
     $s_find_count = '';
     foreach ($find_count as $key => $value) {
         $selected = $key == 'eq' ? ' selected="selected"' : '';
         $s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
     }
     $find_time = array('lt' => $user->lang['BEFORE'], 'gt' => $user->lang['AFTER']);
     $s_find_join_time = '';
     foreach ($find_time as $key => $value) {
         $s_find_join_time .= '<option value="' . $key . '">' . $value . '</option>';
     }
     $s_find_active_time = '';
     foreach ($find_time as $key => $value) {
         $s_find_active_time .= '<option value="' . $key . '">' . $value . '</option>';
     }
     $template->assign_vars(array('U_ACTION' => $this->u_action, 'S_JOINED_OPTIONS' => $s_find_join_time, 'S_ACTIVE_OPTIONS' => $s_find_active_time, 'S_COUNT_OPTIONS' => $s_find_count, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&amp;form=acp_prune&amp;field=users')));
 }
开发者ID:puring0815,项目名称:OpenKore,代码行数:72,代码来源:acp_prune.php

示例13: activateUser

 public function activateUser($UsuarioNick)
 {
     $Usuario = $this->getUserByName($UsuarioNick);
     if ($Usuario) {
         user_active_flip("activate", $Usuario['user_id']);
     }
 }
开发者ID:alfa5,项目名称:SKServer,代码行数:7,代码来源:Phpbb.php

示例14: user_justification_activate

 /**
  * Activate user
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 private function user_justification_activate()
 {
     $user = $this->data;
     if (!function_exists('user_active_flip')) {
         include $this->root_path . 'includes/functions_user.' . $this->php_ext;
     }
     if (!class_exists('messenger')) {
         include $this->root_path . 'includes/functions_messenger.' . $this->php_ext;
     }
     user_active_flip('activate', $user['user_id']);
     $messenger = new \messenger(false);
     $messenger->template('admin_welcome_activated', $user['user_lang']);
     $messenger->to($user['user_email'], $user['username']);
     $messenger->anti_abuse_headers($this->config, $this->user);
     $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($user['username'])));
     $messenger->send(NOTIFY_EMAIL);
     $messenger->save_queue();
     // Remove the notification
     $this->notification_manager->delete_notifications('notification.type.admin_activate_user', $user['user_id']);
     $sql = 'UPDATE ' . USERS_TABLE . "\n\t\t\tSET user_actkey = ''\n\t\t\tWHERE user_id = {$user['user_id']}";
     $this->db->sql_query($sql);
     // Create the correct logs
     $this->log->add('user', $this->user->data['user_id'], $this->user->ip, 'LOG_USER_ACTIVE_USER', false, array('reportee_id' => $user['user_id']));
     $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_USER_ACTIVE', false, array($user['username']));
 }
开发者ID:rmcgirr83,项目名称:phpBB-3.1-activation-justification,代码行数:32,代码来源:listener.php

示例15: main


//.........这里部分代码省略.........
							{
								trigger_error($user->lang['CANNOT_FORCE_REACT_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
							}

							if (!check_form_key($form_name))
							{
								trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
							}

							if ($user_row['user_type'] == USER_FOUNDER)
							{
								trigger_error($user->lang['CANNOT_FORCE_REACT_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
							}

							if ($user_row['user_type'] == USER_IGNORE)
							{
								trigger_error($user->lang['CANNOT_FORCE_REACT_BOT'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
							}

							if ($config['email_enable'])
							{
								include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);

								$server_url = generate_board_url();

								$user_actkey = gen_rand_string(10);
								$key_len = 54 - (strlen($server_url));
								$key_len = ($key_len > 6) ? $key_len : 6;
								$user_actkey = substr($user_actkey, 0, $key_len);
								$email_template = ($user_row['user_type'] == USER_NORMAL) ? 'user_reactivate_account' : 'user_resend_inactive';

								if ($user_row['user_type'] == USER_NORMAL)
								{
									user_active_flip('deactivate', $user_id, INACTIVE_REMIND);

									$sql = 'UPDATE ' . USERS_TABLE . "
										SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
										WHERE user_id = $user_id";
									$db->sql_query($sql);
								}
								else
								{
									// Grabbing the last confirm key - we only send a reminder
									$sql = 'SELECT user_actkey
										FROM ' . USERS_TABLE . '
										WHERE user_id = ' . $user_id;
									$result = $db->sql_query($sql);
									$user_actkey = (string) $db->sql_fetchfield('user_actkey');
									$db->sql_freeresult($result);
								}

								$messenger = new messenger(false);

								$messenger->template($email_template, $user_row['user_lang']);

								$messenger->to($user_row['user_email'], $user_row['username']);

								$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
								$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
								$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
								$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);

								$messenger->assign_vars(array(
									'WELCOME_MSG'	=> htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
									'USERNAME'		=> htmlspecialchars_decode($user_row['username']),
									'U_ACTIVATE'	=> "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:67,代码来源:acp_users.php


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