[ Index ] |
|
Code source de PHP NUKE 7.9 |
1 <?php 2 /*************************************************************************** 3 * profile.php 4 * ------------------- 5 * begin : Saturday, Feb 13, 2001 6 * copyright : (C) 2001 The phpBB Group 7 * email : support@phpbb.com 8 * 9 * Id: profile.php,v 1.193.2.5 2004/11/18 17:49:37 acydburn Exp 10 * 11 * 12 ***************************************************************************/ 13 14 /*************************************************************************** 15 * 16 * This program is free software; you can redistribute it and/or modify 17 * it under the terms of the GNU General Public License as published by 18 * the Free Software Foundation; either version 2 of the License, or 19 * (at your option) any later version. 20 * 21 ***************************************************************************/ 22 if ( !defined('MODULE_FILE') ) 23 { 24 die("You can't access this file directly..."); 25 } 26 if ($popup != "1"){ 27 $module_name = basename(dirname(__FILE__)); 28 require("modules/".$module_name."/nukebb.php"); 29 } 30 else 31 { 32 $phpbb_root_path = 'modules/Forums/'; 33 } 34 35 define('IN_PHPBB', true); 36 include ($phpbb_root_path . 'extension.inc'); 37 include($phpbb_root_path . 'common.'.$phpEx); 38 39 // 40 // Start session management 41 // 42 $userdata = session_pagestart($user_ip, PAGE_PROFILE, $nukeuser); 43 init_userprefs($userdata); 44 // 45 // End session management 46 // 47 48 // session id check 49 if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid'])) 50 { 51 $sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid']; 52 } 53 else 54 { 55 $sid = ''; 56 } 57 58 // 59 // Set default email variables 60 // 61 //$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path'])); 62 //$script_name = ( $script_name != '' ) ? $script_name . '/profile.'.$phpEx : 'profile.'.$phpEx; 63 $script_name = 'modules.php?name=Forums&file=profile'; 64 $server_name = trim($board_config['server_name']); 65 $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; 66 $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; 67 68 $server_url = $server_protocol . $server_name . $server_port . $script_name; 69 70 // ----------------------- 71 // Page specific functions 72 // 73 function gen_rand_string($hash) 74 { 75 $chars = array( 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T', 'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); 76 77 $max_chars = count($chars) - 1; 78 srand( (double) microtime()*1000000); 79 80 $rand_str = ''; 81 for($i = 0; $i < 8; $i++) 82 { 83 $rand_str = ( $i == 0 ) ? $chars[rand(0, $max_chars)] : $rand_str . $chars[rand(0, $max_chars)]; 84 } 85 86 return ( $hash ) ? md5($rand_str) : $rand_str; 87 } 88 // 89 // End page specific functions 90 // --------------------------- 91 92 // 93 // Start of program proper 94 // 95 if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) 96 { 97 $mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; 98 $mode = htmlspecialchars($mode); 99 if ( $mode == 'viewprofile' ) 100 { 101 include ("includes/usercp_viewprofile.php"); 102 exit; 103 } 104 else if ( $mode == 'editprofile' || $mode == 'register' ) 105 { 106 if ( !$userdata['session_logged_in'] && $mode == 'editprofile' ) 107 { 108 $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", $_SERVER["SERVER_SOFTWARE"]) ) ? "Refresh: 0; URL=" : "Location: "; 109 header($header_location . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true)); 110 exit; 111 } 112 113 include ("includes/usercp_register.php"); 114 exit; 115 } 116 else if ( $mode == 'confirm' ) 117 { 118 // Visual Confirmation 119 if ( $userdata['session_logged_in'] ) 120 { 121 exit; 122 } 123 124 exit; 125 } 126 else if ( $mode == 'sendpassword' ) 127 { 128 include('includes/usercp_sendpasswd.'.$phpEx); 129 exit; 130 } 131 else if ( $mode == 'activate' ) 132 { 133 include('includes/usercp_activate.'.$phpEx); 134 exit; 135 } 136 else if ( $mode == 'email' ) 137 { 138 include('includes/usercp_email.'.$phpEx); 139 exit; 140 } 141 } 142 143 $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", $_SERVER["SERVER_SOFTWARE"]) ) ? "Refresh: 0; URL=" : "Location: "; 144 header($header_location . append_sid("index.$phpEx", true)); 145 exit; 146 147 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 11:11:59 2007 | par Balluche grâce à PHPXref 0.7 |