Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*------------------------------------------------
- -- Made by BlueDevil23
- -- Free mod for the CE Community -- Do not sell!
- ------------------------------------------------*/
- //This top part taken from globals.php
- /*---------------------------------
- -- MCCodes 2.0
- -- By Dabomstew
- ---------------------------------*/
- session_start();
- ob_start();
- if(get_magic_quotes_gpc() == 0)
- {
- foreach($_POST as $k => $v)
- {
- $_POST[$k]=addslashes($v);
- }
- foreach($_GET as $k => $v)
- {
- $_GET[$k]=addslashes($v);
- }
- }
- require "global_func.php";
- if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
- $userid=$_SESSION['userid'];
- include "config.php";
- global $_CONFIG;
- define("MONO_ON", 1);
- require "class/class_db_{$_CONFIG['driver']}.php";
- $db=new database;
- $db->configure(
- $_CONFIG['hostname'],
- $_CONFIG['username'],
- $_CONFIG['password'],
- $_CONFIG['database'],
- $_CONFIG['persistent']);
- $db->connect();
- $c=$db->connection_id;
- $set=array();
- $settq=$db->query("SELECT * FROM settings");
- while($r=$db->fetch_row($settq))
- {
- $set[$r['conf_name']]=$r['conf_value'];
- }
- $domain=$_SERVER['HTTP_HOST'];
- $is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid");
- $ir=$db->fetch_row($is);
- if($ir['force_logout'])
- {
- $db->query("UPDATE users SET force_logout=0 WHERE userid=$userid");
- session_unset();
- session_destroy();
- header("Location: login.php");
- exit;
- }
- //End Globals
- if($ir['gender'] == "Male")
- {
- $g="Female";
- $b="female";
- }
- else
- {
- $g="Male";
- $b="male";
- }
- //Start name change
- if ($_POST['key'] == "1111name1111")
- {
- if($_POST['newname'] == "")
- {
- print "<strong>You did not enter a new name.</strong>";
- }
- else
- {
- $_POST['newname']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newname']);
- $db->query("UPDATE users SET username='{$_POST['newname']}' WHERE userid=$userid");
- print "<big><strong>Username changed!</strong></big><br /><br />
- <strong>New Name: </strong><em>{$_POST['newname']}";
- }
- }
- //End name change
- //Start pass change
- if ($_POST['key'] == "2222pass2222")
- {
- if(md5($_POST['oldpw']) != $ir['userpass'])
- {
- print "<strong>The current password you entered was wrong.<strong>";
- }
- else if($_POST['newpw'] !== $_POST['newpw2'])
- {
- print "<strong>The new passwords you entered did not match!</strong>";
- }
- else
- {
- $db->query("UPDATE users SET userpass=md5('{$_POST['newpw']}') WHERE userid=$userid");
- print "<big><strong>Password changed!</strong></big>";
- }
- }
- //End pass change
- //Start pass change
- if ($_POST['key'] == "3333sex3333")
- {
- if($_POST['yesNo'] == "yes")
- {
- $db->query("UPDATE users SET gender='$g' WHERE userid=$userid");
- print "<strong><big>You are now a $b.</big></strong>";
- }
- else if ($_POST['yesNo'] == "no")
- {
- print "<strong>Please come back if you ever change your mind.</strong>";
- }
- }
- //End pass change
- //Start display pic change
- if ($_POST['key'] == "4444pic4444")
- {
- if($_POST['newpic'] == "")
- {
- print "<strong style='padding: 0 5px 0 5px;'>You did not enter a new pic URL.</strong>";
- }
- else
- {
- $_POST['newpic']=str_replace('\\\'',''', $_POST['newpic']);
- $db->query("UPDATE users SET display_pic='{$_POST['newpic']}' WHERE userid=$userid");
- print "<img src='{$_POST['newpic']}' height='150' width='150' alt='New Display Pic' title='New Display Pic'>";
- }
- }
- //End display pic change
- //Start forum avatar change
- if ($_POST['key'] == "5555av5555")
- {
- $_POST['forums_avatar']=str_replace(array("<", ">"), array("<", ">"), $_POST['forums_avatar']);
- $db->query("UPDATE users SET forums_avatar='{$_POST['forums_avatar']}' WHERE userid=$userid");
- print "<img src='{$_POST['forums_avatar']}' height='100' width='100' alt='New Forums Avatar' title='User Forums Avatar' />";
- }
- //End forum avatar change
- //Start forum signature change
- if ($_POST['key'] == "6666sig6666")
- {
- if ($_POST['forums_signature'] == "")
- {
- $db->query("UPDATE users SET forums_signature='{$_POST['forums_signature']}' WHERE userid=$userid");
- print "<strong><big>You cleared your forum signature</big></strong>";
- }
- else
- {
- $db->query("UPDATE users SET forums_signature='{$_POST['forums_signature']}' WHERE userid=$userid");
- print "<strong><big>Here is your new forum signature:</big></strong>
- <br />
- <em>{$_POST['forums_signature']}</em>";
- }
- }
- //End forum signature change
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement