usercp.php

来自「sabreipb 2.1.6 utf-8中文版本!」· PHP 代码 · 共 1,953 行 · 第 1/5 页

PHP
1,953
字号
<?php/*+--------------------------------------------------------------------------|   Invision Power Board v2.1.5|   =============================================|   by Matthew Mecham|   (c) 2001 - 2005 Invision Power Services, Inc.|   |   =============================================|   Web: |   Time: Wed, 01 Mar 2006 19:11:28 GMT|   Release: |   Licence Info: +---------------------------------------------------------------------------|   > $Date: 2006-02-17 19:18:08 +0000 (Fri, 17 Feb 2006) $|   > $Revision: 143 $|   > $Author: bfarber $+---------------------------------------------------------------------------||   > UserCP functions|   > Module written by Matt Mecham|   > Date started: 14th February 2002||	> Module Version Number: 1.0.0|   > DBA Checked: Thu 20 May 2004|   > Quality Checked: Wed 15 Sept. 2004+--------------------------------------------------------------------------*/if ( ! defined( 'IN_IPB' ) ){	print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";	exit();}class usercp{	var $ipsclass;	var $han_editor = "";	    var $output     = "";    var $page_title = "";    var $nav        = array();    var $html       = "";    var $member     = array();    var $m_group    = array();        var $jump_html  = "";    var $parser     = "";        var $links      = array();        var $bio        = "";    var $notes      = "";    var $size       = "m";        var $email      = "";    var $md5_check  = "";        var $modules    = "";        var $lib;        /*-------------------------------------------------------------------------*/    // Run!    /*-------------------------------------------------------------------------*/        function auto_run()    {    	//-----------------------------------------        // Load and config the std/rte editors        //-----------------------------------------                require_once( ROOT_PATH."sources/handlers/han_editor.php" );        $this->han_editor           = new han_editor();        $this->han_editor->ipsclass =& $this->ipsclass;        $this->han_editor->init(); 				//-----------------------------------------    	// Load parser    	//-----------------------------------------    	    	require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" );        $this->parser                      =  new parse_bbcode();        $this->parser->ipsclass            =& $this->ipsclass;        $this->parser->allow_update_caches = 1;                $this->parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']);                //-----------------------------------------        // Prep form check        //-----------------------------------------                $this->md5_check = $this->ipsclass->return_md5_check();                //-----------------------------------------    	// Get the emailer module		//-----------------------------------------				require ROOT_PATH."sources/classes/class_email.php";				$this->email = new emailer();		$this->email->ipsclass =& $this->ipsclass;		$this->email->email_init();				//-----------------------------------------    	// Get the sync module		//-----------------------------------------				if ( USE_MODULES == 1 )		{			require ROOT_PATH."modules/ipb_member_sync.php";						$this->modules = new ipb_member_sync();			$this->modules->ipsclass =& $this->ipsclass;		}            	//-----------------------------------------    	// Require the HTML and language modules    	//-----------------------------------------    	    	$this->ipsclass->load_language('lang_post');		$this->ipsclass->load_language('lang_ucp');    	$this->ipsclass->load_template('skin_ucp');    	    	$this->ipsclass->base_url_nosess = "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}";    	    	//-----------------------------------------    	// Check viewing permissions, etc		//-----------------------------------------				if ( ! $this->ipsclass->member['id'] )		{			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );		}				//-----------------------------------------		// INIT da func		//-----------------------------------------				require ROOT_PATH."sources/lib/func_usercp.php";    	$this->lib   = new func_usercp($this);    	$this->lib->ipsclass =& $this->ipsclass;    	    	//-----------------------------------------    	// Print menu    	//-----------------------------------------    	    	$this->ipsclass->print->add_output( $this->lib->ucp_generate_menu() );    	    	//-----------------------------------------		// Set sizes		//-----------------------------------------				$this->links = $this->ipsclass->member['links'];		$this->notes = $this->ipsclass->member['notes'];		$this->size  = $this->ipsclass->member['ta_size'] ? $this->ipsclass->member['ta_size'] : $this->size;    	    	//-----------------------------------------    	// What to do?    	//-----------------------------------------    	    	switch($this->ipsclass->input['CODE'])    	{    		case '00':    			$this->splash();    			break;    		case '01':    			$this->personal();    			break;    		//-----------------------------------------    		case '02':    			$this->email_settings();    			break;    		case '03':    			$this->lib->do_email_settings();    			break;    		//-----------------------------------------    		case '04':    			$this->board_prefs();    			break;    		case '05':    			$this->lib->do_board_prefs();    			break;    		//-----------------------------------------    		case '08':    			$this->email_change();    			break;    		case '09':    			$this->do_email_change();    			break;    		//-----------------------------------------    		case '21':    			$this->lib->do_profile();    			break;    		case '20':    			$this->update_notepad();    			break;    		//-----------------------------------------    		case '22':    			$this->signature();    			break;    		case '23':    			$this->lib->do_signature();    			break;    		//-----------------------------------------    		case '24':    			$this->avatar();    			break;    		case '25':    			$this->lib->do_avatar();    			break;    		//-----------------------------------------    		case '26':    			$this->tracker();    			break;    		case '27':    			$this->do_update_tracker();    			break;    		//-----------------------------------------    		case '28':    			$this->pass_change();    			break;    		case '29':    			$this->do_pass_change();    			break;    		//-----------------------------------------    		case '50':    			$this->forum_tracker();    			break;    		case '51':    			$this->remove_forum_tracker();    			break;    		//-----------------------------------------    		case 'ignore':    			$this->ignore_user_splash();    			break;    		case 'ignoreadd':    			$this->lib->ignore_user_add();    			break;    		case 'ignoreremove':    			$this->lib->ignore_user_remove();    			break;    		//-----------------------------------------    		case 'show_image':    			$this->show_image();    			break;    		case 'photo':    			$this->photo();    			break;    		case 'dophoto':    			$this->lib->do_photo();    			break;    		case 'getgallery':    			$this->avatar_gallery();    			break;    		case 'setinternalavatar':    			$this->lib->set_internal_avatar();    			break;    		case 'attach':    			$this->attachments();    			break;    		//-----------------------------------------    		// Mod tools    		//-----------------------------------------    		case 'iptool':    			$this->mod_ip_tool_start();    			break;    		case 'doiptool':    			$this->mod_ip_tool_complete();    			break;    		case 'memtool':    			$this->mod_find_user_start();    			break;    		case 'domemtool':    			$this->mod_find_user_complete();    			break;    		case 'announce_start':    			$this->mod_announce_start();    			break;    		case 'announce_add':    			$this->mod_announce_form('add');    			break;    		case 'announce_save':    			$this->mod_announce_save();    			break;    		case 'announce_edit':    			$this->mod_announce_form('edit');    			break;    		case 'announce_delete':    			$this->mod_announce_delete();    			break;    		//-----------------------------------------    		// Subs(ways)?    		//-----------------------------------------    		case 'start_subs':    			$this->lib->subs_choose();    			break;    		case 'end_subs':    			$this->lib->subs_choose('save');    			break;    		//-----------------------------------------    		// Display name change    		//-----------------------------------------    		case 'dname_start':    			$this->display_name_change();    			break;    		case 'dname_complete':    			$this->display_name_complete();    			break;    			    		default:    			$this->splash();    			break;    	}    	    	//-----------------------------------------    	// If we have any HTML to print, do so...    	//-----------------------------------------    	    	$fj = $this->ipsclass->build_forum_jump();		$fj = preg_replace( "!#Forum Jump#!", $this->ipsclass->lang['forum_jump'], $fj);				$this->output .= $this->ipsclass->compiled_templates['skin_ucp']->CP_end();				$this->output .= $this->ipsclass->compiled_templates['skin_ucp']->forum_jump($fj, $links);    	    	$this->ipsclass->print->add_output("$this->output");        $this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 1, NAV => $this->nav ) ); 	} 	 	/*-------------------------------------------------------------------------*/ 	// DISPLAY NAME: CHANGE COMPLETE 	/*-------------------------------------------------------------------------*/ 	 	function display_name_complete()	{		//-----------------------------------------		// INIT		//-----------------------------------------				$display_name = trim( $this->ipsclass->input['display_name'] );		$display_pass = $this->ipsclass->input['display_password'];		$error        = "";		$found_name   = 0;		$banfilters   = array();				//-----------------------------------------		// CHECK (please)		//-----------------------------------------				if ( ! $this->ipsclass->vars['auth_allow_dnames'] OR $this->ipsclass->member['g_dname_changes'] < 1 OR $this->ipsclass->member['g_dname_date'] < 1 )		{			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );		}				//-----------------------------------------		// Remove 'sneaky' spaces		//-----------------------------------------				if ( $this->ipsclass->vars['strip_space_chr'] )    	{    		// Use hexdec to convert between '0xAD' and chr			$display_name = str_replace( chr(160), ' ', $display_name );			$display_name = str_replace( chr(173), ' ', $display_name );						$display_name = trim($display_name);		}				//-----------------------------------------		// Test unicode name too		//-----------------------------------------				$unicode_name  = preg_replace('/&#([0-9]+);/esi', "chr('\\1')", $display_name);		$unicode_name  = str_replace( "'" , '&#39;', $unicode_name );		$unicode_name  = str_replace( "\\", '&#92;', $unicode_name );				//-----------------------------------------    	// Password Check: Load handler...    	//-----------------------------------------    	    	require_once( ROOT_PATH.'sources/handlers/han_login.php' );    	$this->han_login           =  new han_login();    	$this->han_login->ipsclass =& $this->ipsclass;    	$this->han_login->init();    	    	//-----------------------------------------		// Check for current password.		//-----------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?