Advertisement
Guest User

Untitled

a guest
May 28th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1. <?php
  2.  
  3. /*------------------------------------------------
  4. -- Made by BlueDevil23
  5. -- Free mod for the CE Community -- Do not sell!
  6. ------------------------------------------------*/
  7.  
  8. //This top part taken from globals.php
  9.  
  10. /*---------------------------------
  11. -- MCCodes 2.0
  12. -- By Dabomstew
  13. ---------------------------------*/
  14. session_start();
  15. ob_start();
  16. if(get_magic_quotes_gpc() == 0)
  17. {
  18. foreach($_POST as $k => $v)
  19. {
  20. $_POST[$k]=addslashes($v);
  21. }
  22. foreach($_GET as $k => $v)
  23. {
  24. $_GET[$k]=addslashes($v);
  25. }
  26. }
  27.  
  28. require "global_func.php";
  29. if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
  30. $userid=$_SESSION['userid'];
  31.  
  32. include "config.php";
  33. global $_CONFIG;
  34. define("MONO_ON", 1);
  35. require "class/class_db_{$_CONFIG['driver']}.php";
  36. $db=new database;
  37. $db->configure(
  38. $_CONFIG['hostname'],
  39. $_CONFIG['username'],
  40. $_CONFIG['password'],
  41. $_CONFIG['database'],
  42. $_CONFIG['persistent']);
  43. $db->connect();
  44. $c=$db->connection_id;
  45. $set=array();
  46. $settq=$db->query("SELECT * FROM settings");
  47. while($r=$db->fetch_row($settq))
  48. {
  49. $set[$r['conf_name']]=$r['conf_value'];
  50. }
  51. $domain=$_SERVER['HTTP_HOST'];
  52.  
  53. $is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid");
  54. $ir=$db->fetch_row($is);
  55. if($ir['force_logout'])
  56. {
  57. $db->query("UPDATE users SET force_logout=0 WHERE userid=$userid");
  58. session_unset();
  59. session_destroy();
  60. header("Location: login.php");
  61. exit;
  62. }
  63. //End Globals
  64.  
  65.  
  66. if($ir['gender'] == "Male")
  67. {
  68. $g="Female";
  69. $b="female";
  70. }
  71. else
  72. {
  73. $g="Male";
  74. $b="male";
  75. }
  76.  
  77.  
  78.  
  79. //Start name change
  80.  
  81. if ($_POST['key'] == "1111name1111")
  82. {
  83. if($_POST['newname'] == "")
  84. {
  85. print "<strong>You did not enter a new name.</strong>";
  86. }
  87. else
  88. {
  89. $_POST['newname']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newname']);
  90.  
  91. $db->query("UPDATE users SET username='{$_POST['newname']}' WHERE userid=$userid");
  92.  
  93. print "<big><strong>Username changed!</strong></big><br /><br />
  94. <strong>New Name: </strong><em>{$_POST['newname']}";
  95. }
  96. }
  97.  
  98. //End name change
  99.  
  100. //Start pass change
  101.  
  102. if ($_POST['key'] == "2222pass2222")
  103. {
  104. if(md5($_POST['oldpw']) != $ir['userpass'])
  105. {
  106. print "<strong>The current password you entered was wrong.<strong>";
  107.  
  108. }
  109. else if($_POST['newpw'] !== $_POST['newpw2'])
  110. {
  111. print "<strong>The new passwords you entered did not match!</strong>";
  112. }
  113. else
  114. {
  115. $db->query("UPDATE users SET userpass=md5('{$_POST['newpw']}') WHERE userid=$userid");
  116.  
  117. print "<big><strong>Password changed!</strong></big>";
  118. }
  119. }
  120.  
  121. //End pass change
  122.  
  123. //Start pass change
  124.  
  125. if ($_POST['key'] == "3333sex3333")
  126. {
  127. if($_POST['yesNo'] == "yes")
  128. {
  129. $db->query("UPDATE users SET gender='$g' WHERE userid=$userid");
  130.  
  131. print "<strong><big>You are now a $b.</big></strong>";
  132. }
  133. else if ($_POST['yesNo'] == "no")
  134. {
  135. print "<strong>Please come back if you ever change your mind.</strong>";
  136. }
  137. }
  138.  
  139. //End pass change
  140.  
  141. //Start display pic change
  142.  
  143. if ($_POST['key'] == "4444pic4444")
  144. {
  145. if($_POST['newpic'] == "")
  146. {
  147. print "<strong style='padding: 0 5px 0 5px;'>You did not enter a new pic URL.</strong>";
  148. }
  149. else
  150. {
  151. $_POST['newpic']=str_replace('\\\'',''', $_POST['newpic']);
  152.  
  153. $db->query("UPDATE users SET display_pic='{$_POST['newpic']}' WHERE userid=$userid");
  154.  
  155. print "<img src='{$_POST['newpic']}' height='150' width='150' alt='New Display Pic' title='New Display Pic'>";
  156.  
  157. }
  158. }
  159.  
  160. //End display pic change
  161.  
  162. //Start forum avatar change
  163.  
  164. if ($_POST['key'] == "5555av5555")
  165. {
  166. $_POST['forums_avatar']=str_replace(array("<", ">"), array("<", ">"), $_POST['forums_avatar']);
  167.  
  168. $db->query("UPDATE users SET forums_avatar='{$_POST['forums_avatar']}' WHERE userid=$userid");
  169.  
  170. print "<img src='{$_POST['forums_avatar']}' height='100' width='100' alt='New Forums Avatar' title='User Forums Avatar' />";
  171. }
  172.  
  173. //End forum avatar change
  174.  
  175. //Start forum signature change
  176.  
  177. if ($_POST['key'] == "6666sig6666")
  178. {
  179. if ($_POST['forums_signature'] == "")
  180. {
  181. $db->query("UPDATE users SET forums_signature='{$_POST['forums_signature']}' WHERE userid=$userid");
  182.  
  183. print "<strong><big>You cleared your forum signature</big></strong>";
  184. }
  185. else
  186. {
  187. $db->query("UPDATE users SET forums_signature='{$_POST['forums_signature']}' WHERE userid=$userid");
  188.  
  189. print "<strong><big>Here is your new forum signature:</big></strong>
  190. <br />
  191. <em>{$_POST['forums_signature']}</em>";
  192. }
  193. }
  194.  
  195. //End forum signature change
  196.  
  197. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement