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


PHP account::game_account_password方法代码示例

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


在下文中一共展示了account::game_account_password方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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');
        }
        // Do not allow activating by non administrators when admin activation is on
        // Only activation type the user should be able to do is INACTIVE_REMIND
        // or activate a new password which is not an activation state :@
        if (!$user_row['user_newpasswd'] && $user_row['user_inactive_reason'] != INACTIVE_REMIND && $config['require_activation'] == USER_ACTIVATION_ADMIN && !$auth->acl_get('a_user')) {
            if (!$user->data['is_registered']) {
                login_box('', $user->lang['NO_AUTH_OPERATION']);
            }
            trigger_error('NO_AUTH_OPERATION');
        }
        $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);
            add_log('user', $user_row['user_id'], 'LOG_USER_NEW_PASSWORD', $user_row['username']);
            // ROA - wow account password change
            require_once $phpbb_root_path . "roa/classes/class.server.php";
            global $auth_server_adress;
            global $auth_server_port;
            if (server::serverstatus($auth_server_adress, $auth_server_port)) {
                require_once $phpbb_root_path . "roa/roa_account.php";
                account::game_account_password($user_row['username'], $user_row['user_newpasswd']);
            }
        }
        // Include ROA-Functions
        require_once $phpbb_root_path . "roa/classes/class.server.php";
        global $auth_server_adress;
        global $auth_server_port;
        if (server::serverstatus($auth_server_adress, $auth_server_port)) {
            require_once $phpbb_root_path . "roa/roa_account.php";
            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\t\tSET user_actkey = ''\n\t\t\t\t\tWHERE user_id = {$user_row['user_id']}";
                $db->sql_query($sql);
                // Activate WoW-Account
                account::game_account_activate(auth_account::get_id($user_row['username']));
                // Create the correct logs
                add_log('user', $user_row['user_id'], 'LOG_USER_ACTIVE_USER');
                if ($auth->acl_get('a_user')) {
                    add_log('admin', 'LOG_USER_ACTIVE', $user_row['username']);
                }
            }
        }
        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->anti_abuse_headers($config, $user);
            $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:gonzo1247,项目名称:hitman_roa,代码行数:86,代码来源:ucp_activate.php

示例2: main


//.........这里部分代码省略.........
                                $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)) {
                            // RoA Password Change for Game Account
                            require_once $phpbb_root_path . "roa/classes/class.server.php";
                            global $auth_server_adress;
                            global $auth_server_port;
                            if (server::serverstatus($auth_server_adress, $auth_server_port)) {
                                require_once $phpbb_root_path . "roa/roa_account.php";
                                $sql = 'UPDATE ' . USERS_TABLE . '
									SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
									WHERE user_id = ' . $user->data['user_id'];
                                $db->sql_query($sql);
                                $wow_pass = !empty($data['new_password']) ? $data['new_password'] : $data['cur_password'];
                                account::game_account_password($wow_pass, $data['username']);
                            } else {
                                trigger_error("Service Temporär wegen hoher Server Belastung nicht verfügbar, bitte versuche es in ein paar Minuten erneut!");
                                return;
                            }
                        }
                        // 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));
                            $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid($phpbb_root_path . 'index.' . $phpEx) . '">', '</a>');
                            // Because the user gets deactivated we log him out too, killing his session
                            $user->session_kill();
                        } else {
                            meta_refresh(3, $this->u_action);
                            $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
                        }
                        trigger_error($message);
                    }
                    // Replace "error" strings with their real, localised form
                    $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
                }
                $template->assign_vars(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'USERNAME' => $data['username'], 'EMAIL' => $data['email'], 'PASSWORD_CONFIRM' => $data['password_confirm'], 'NEW_PASSWORD' => $data['new_password'], 'CUR_PASSWORD' => '', 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'S_FORCE_PASSWORD' => $auth->acl_get('u_chgpasswd') && $config['chg_passforce'] && $user->data['user_passchg'] < time() - $config['chg_passforce'] * 86400 ? true : false, 'S_CHANGE_USERNAME' => $config['allow_namechange'] && $auth->acl_get('u_chgname') ? true : false, 'S_CHANGE_EMAIL' => $auth->acl_get('u_chgemail') ? true : false, 'S_CHANGE_PASSWORD' => $auth->acl_get('u_chgpasswd') ? true : false));
                break;
            case 'profile_info':
                include $phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx;
                $cp = new custom_profile();
                $cp_data = $cp_error = array();
                $data = array('icq' => request_var('icq', $user->data['user_icq']), 'aim' => request_var('aim', $user->data['user_aim']), 'msn' => request_var('msn', $user->data['user_msnm']), 'yim' => request_var('yim', $user->data['user_yim']), 'jabber' => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)), 'website' => request_var('website', $user->data['user_website']), 'location' => utf8_normalize_nfc(request_var('location', $user->data['user_from'], true)), 'occupation' => utf8_normalize_nfc(request_var('occupation', $user->data['user_occ'], true)), 'interests' => utf8_normalize_nfc(request_var('interests', $user->data['user_interests'], true)));
                if ($config['allow_birthdays']) {
开发者ID:gonzo1247,项目名称:hitman_roa,代码行数:67,代码来源:ucp_profile.php


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