Advertisement
Guest User

Untitled

a guest
Jan 12th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.54 KB | None | 0 0
  1. <?php
  2.  
  3. require_once('./data_classes/server-data.php_data_classes-core.php.php');
  4.  
  5. $pagename = "Meus Detalhes";
  6. $body_id = "profile";
  7. $pageid = "3";
  8.  
  9. if(isset($_GET['web-profile-tab'])){
  10. if($_GET['web-profile-tab'] < 2 || $_GET['web-profile-tab'] > 5 || !$_GET['web-profile-tab']){
  11. header("Location: ".$path."/profile/2");
  12. $tab = 0;
  13. exit;
  14. } else {
  15. $tab = FilterText($_GET['web-profile-tab']);
  16. }
  17. } else {
  18. $tab = "2";
  19. }
  20.  
  21. if($tab == "2"){
  22. if(isset($_POST['save'])){
  23. $motto = utf8_encode($_POST['motto']);
  24. $real_name = $_POST['real_name'];
  25. $chr = chr(1);
  26. $chr2 = chr(2);
  27. $motto2 = str_replace($chr, "", $motto);
  28. $motto3 = str_replace($chr2, "", $motto);
  29.  
  30. if(strlen($motto3) > 24){
  31. $result = "Sua missão é muito larga!";
  32. $error = "1";
  33. }elseif(strlen($real_name) > 16){
  34. $result = "Seu nome é muito largo!";
  35. $error = "1";
  36. } else {
  37. if($_POST['block_newfriends'] == "true"){ $block_newfriends = '0'; }else{ $block_newfriends = '1'; }
  38.  
  39. mysql_query("UPDATE users SET real_name = '".mysql_real_escape_string($real_name)."', motto = '".mysql_real_escape_string($motto3)."', identifier = '".mysql_real_escape_string($_POST['identifier'])."', block_newfriends = '".mysql_real_escape_string($block_newfriends)."', mymusik = '".mysql_real_escape_string($_POST['mymusik'])."' WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());
  40. $result = "Seu perfil foi atualizado corretamente!";
  41. }
  42. }
  43. } else if($tab == "3"){
  44. if(isset($_POST['save'])){
  45. $pass1 = FilterText($_POST['password']);
  46. $pass1_hash = HoloHashMD5($pass1, $myrow['username']);
  47. $mail1 = FilterText($_POST['email']);
  48. $themail = $mail1;
  49. //checks password --encryption--
  50. if($pass1_hash == $myrow['password'] ){
  51. $email_check = preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $mail1);
  52. if($email_check == "1"){
  53. mysql_query("UPDATE users SET mail = '".$mail1."' WHERE username = '".$rawname."' and password = '".$rawpass."'") or die(mysql_error());
  54.  
  55. $result = "A atualização do e-mail \"".$mail1."\" foi realizada corretamente!";
  56. } else {
  57. $result = "A atualização de e-mail está incorreta!";
  58. $error = "1";
  59. }
  60. } else {
  61. $result = "Seus dados estão incorretos!";
  62. $error = "1";
  63. }
  64. } else {
  65. $themail = $myrow['mail'];
  66. }
  67.  
  68. } else if($tab == "4"){
  69. if(isset($_POST['save'])){
  70. $pass1 = FilterText($_POST['password']);
  71. //Hashes and salts the old password with the user id (in lowercase) --encryption--
  72. $pass1_hash = HoloHashMD5($pass1, $myrow['name']);
  73. $newpass = FilterText($_POST['pass']);
  74. //Hashes and salts the new password with the user id (in lowercase) --encryption--
  75. $newpass_hash = HoloHashMD5($newpass, $rawname);
  76. $newpass_conf = FilterText($_POST['confpass']);
  77. if($pass1_hash == $myrow['password'] ){
  78. if($newpass == $newpass_conf){
  79. if(strlen($newpass) < 6){
  80. $result = "A senha fornecida é muito curta, digite uma de pelo menos 6 carácteres!";
  81. $error = "1";
  82. } else {
  83. if(strlen($newpass) > 51){
  84. $result = "A senha é muito longa, forneça uma senha com menos de 50 carácteres!";
  85. $error = "1";
  86. } else {
  87. //Updates password --encryption--
  88. mysql_query("UPDATE users SET password = '".$newpass_hash."' WHERE username = '".$rawname."' and password = '".$rawpass."'") or die(mysql_error());
  89. $result = "A senha foi alterada. Por favor faça login novamente.";
  90. }
  91. }
  92. } else {
  93. $result = "As senhas não coincidem.";
  94. $error = "1";
  95. }
  96. } else {
  97. $result = "Preencha todos os campos requeridos!";
  98. $error = "1";
  99. }
  100. }
  101.  
  102. }
  103.  
  104. require_once('./templates/community_subheader.php');
  105. require_once('./templates/community_header.php');
  106.  
  107. ?>
  108.  
  109. <div id="container">
  110. <div id="content">
  111. <div>
  112. <div class="content">
  113. <div class="habblet-container" style="float:left; width:210px;">
  114. <div class="cbb settings">
  115.  
  116. <h2 class="title">Preferências</h2>
  117. <div class="box-content">
  118. <div id="settingsNavigation">
  119. <ul>
  120. <?php
  121. if($tab == "2"){
  122. echo "<li class='selected'>Meus detalhes
  123. </li>";
  124. } else {
  125. echo "<li><a href='".$path."/profile/2'>Meus detalhes</a>
  126. </li>";
  127. }
  128.  
  129. if($tab == "4"){
  130. echo "<li class='selected'>Minha senha
  131. </li>";
  132. } else {
  133. echo "<li><a href='".$path."/profile/4'>Minha senha</a>
  134. </li>";
  135. }
  136. ?>
  137. </ul>
  138. </div>
  139. </div></div>
  140. <?php if($hc > 1){ ?>
  141. <div class="cbb habboclub-tryout">
  142. <h2 class="title"><?php echo $shortname; ?> VIP</h2>
  143. <div class="box-content">
  144. <div class="habboclub-banner-container habboclub-clothes-banner"></div>
  145. <p class="habboclub-header"><?php echo $shortname; ?> VIP são as pessoas destacadas do Hotel, elas têm uma larga lista de benefícios e comandos exclusivos! Faça parte dos membros VIP imediatamente!</p>
  146. <p class="habboclub-link"><a href="credits/vip">Ver mais benefícios »</a></p>
  147. </div>
  148. </div>
  149. <?php } ?>
  150. </div>
  151.  
  152. <?php if($tab == "2"){ ?>
  153. <div class="habblet-container " style="float:left; width: 560px;">
  154. <div class="cbb clearfix settings">
  155.  
  156. <h2 class="title">Mudar Perfil</h2>
  157. <div class="box-content">
  158.  
  159.  
  160.  
  161. <form action="profile/2" method="post">
  162. <input type="hidden" name="tab" value="2" />
  163. <input type="hidden" name="__app_key" value="HoloCMS" />
  164.  
  165. <?php
  166.  
  167. if(!empty($result)){
  168. if($error == "1"){
  169. echo "<div class='rounded rounded-red'>";
  170. } else {
  171. echo "<div class='rounded rounded-green'>";
  172. }
  173.  
  174. echo $result . "<br />
  175. </div><br />";
  176. }
  177.  
  178. $user_sql = mysql_query("SELECT * FROM users WHERE id = '".$my_id."'");
  179. $user_row = mysql_fetch_assoc($user_sql);
  180.  
  181. ?>
  182.  
  183. <h3><?php echo $shortname; ?> Home</h3>
  184.  
  185. <p>
  186. Quem verá sua <?php echo $shortname; ?> home?<br>
  187. <label><input name="identifier" value="1" <?php if($user_row['identifier'] == "1"){ ?>checked="checked" <?php } ?>type="radio">Todos</label>
  188. <label><input name="identifier" value="0" <?php if($user_row['identifier'] == "0"){ ?>checked="checked" <?php } ?>type="radio">Ninguém</label>
  189. </p>
  190.  
  191. <h3>Pedidos de amizade</h3>
  192. <p>
  193.  
  194. <label>
  195. <input name="block_newfriends" <?php if($user_row['block_newfriends'] == 0){ ?>checked="checked"<?php } ?> value="true" type="checkbox">
  196. Pedidos de amizade ativado
  197. </label></p>
  198.  
  199. <h3>Online Status</h3>
  200. <p>
  201.  
  202. <label>
  203. <input name="hide_online" <?php if($user_row['hide_online'] == 0){ ?>checked="checked"<?php } ?> value="true" type="checkbox">
  204. Todos podem me ver online
  205. </label></p>
  206.  
  207. <h3>Preferências "Siga-me"</h3>
  208. <p>
  209.  
  210. <label>
  211. <input name="hide_inroom" <?php if($user_row['hide_inroom'] == 0){ ?>checked="checked"<?php } ?> value="true" type="checkbox">
  212. Todos podem me seguir
  213. </label></p>
  214. <h3>Missão</h3>
  215. <p>
  216.  
  217. <label>
  218. <input type="text" size="32" maxlength="32" name="motto" id="currentpassword" class="currentpassword " value="<?php echo utf8_decode($user_row['motto']);?> " />
  219. </label></p>
  220. <h3>Nome verdadeiro</h3>
  221. <p>
  222.  
  223. <label>
  224. <input type="text" size="32" maxlength="32" name="real_name" id="currentpassword" class="currentpassword " value="<?php echo $user_row['real_name'];?> " />
  225. </label></p>
  226.  
  227. <h3>Música da Home</h3>
  228. <p>
  229.  
  230. <label>
  231. <input type="text" size="32" maxlength="32" name="mymusik" id="currentpassword" class="currentpassword " value="<?php echo $user_row['mymusik'];?> " />
  232. </label></p>
  233.  
  234. <div class="settings-buttons">
  235. <input type="submit" value="Salvar" name="save" class="submit" />
  236. </div>
  237.  
  238. </form>
  239.  
  240. </div></div>
  241. </div>
  242. <?php } else if($tab == "3"){ ?>
  243. </div>
  244.  
  245.  
  246. </div>
  247. </div>
  248.  
  249. <?php } else if($tab == "4"){ ?>
  250.  
  251. <div class="habblet-container " style="float:left; width: 560px;">
  252. <div class="cbb clearfix settings">
  253.  
  254. <h2 class="title">Mudar senha</h2>
  255. <div class="box-content">
  256.  
  257. <?php
  258. if(!empty($result)){
  259. if($error == "1"){
  260. echo "<div class='rounded rounded-red'>";
  261. } else {
  262. echo "<div class='rounded rounded-green'>";
  263. }
  264. echo "".$result."<br />
  265. </div><br />";
  266. }
  267. ?>
  268.  
  269.  
  270. <form action="profile/4" method="post" id="passwordform">
  271. <input type="hidden" name="tab" value="4" />
  272. <input type="hidden" name="__app_key" value="HoloCMS" />
  273.  
  274. <div class="settings-step">
  275.  
  276. <p>
  277. <label for="currentpassword">Senha atual</label><br />
  278. <input type="password" size="32" maxlength="32" name="password" id="currentpassword" class="currentpassword " />
  279. </p>
  280.  
  281. <div>
  282.  
  283.  
  284. </div>
  285. </div>
  286. <div class="settings-step">
  287.  
  288. <p>
  289. <label for="pass">Nova senha</label><br />
  290. <input type="password" name="pass" id="password" size="32" maxlength="48" value="" />
  291. </p>
  292.  
  293. <p>
  294. <label for="confpass">Re-digite a nova senha</label><br/>
  295. <input type="password" name="confpass" id="password" size="32" maxlength="48" value="" />
  296. </p>
  297.  
  298. </div>
  299. </div>
  300.  
  301. <div class="settings-buttons">
  302. <input type="submit" value="Mudar senha" name="save" class="submit" />
  303. </div>
  304.  
  305. </form>
  306.  
  307. </div></div></div></div>
  308.  
  309.  
  310. </div>
  311. </div>
  312.  
  313.  
  314.  
  315. <script type="text/javascript">
  316. L10N.put("friendmanagement.tooltip.deletefriends", "Ausgewählte Freunde wirklich löschen?\n<div class=\"friendmanagement-small-icons friendmanagement-save friendmanagement-tip-delete\"\>\n <a class=\"friends-delete-button\" id=\"delete-friends-button\"\>Löschen</a\>\n</div\>\n<div class=\"friendmanagement-small-icons friendmanagement-remove friendmanagement-tip-cancel\"\>\n <a id=\"cancel-delete-friends\"\>Beenden</a\>\n</div\>\n\n");
  317. L10N.put("friendmanagement.tooltip.deletefriend", "Ausgewählter Freund wirklich löschen?\n<div class=\"friendmanagement-small-icons friendmanagement-save friendmanagement-tip-delete\"\>\n <a id=\"delete-friend-%friend_id%\"\>Löschen</a\>\n</div\>\n<div class=\"friendmanagement-small-icons friendmanagement-remove friendmanagement-tip-cancel\"\>\n <a id=\"remove-friend-can-%friend_id%\"\>Beenden</a\>\n</div\>");
  318. L10N.put("friendmanagement.tooltip.deletecategory", "Diese Kategorie wirklich löschen?\n<div class=\"friendmanagement-small-icons friendmanagement-save friendmanagement-tip-delete\"\>\n <a class=\"delete-category-button\" id=\"delete-category-%category_id%\"\>Löschen</a\>\n</div\>\n<div class=\"friendmanagement-small-icons friendmanagement-remove friendmanagement-tip-cancel\"\>\n <a id=\"cancel-cat-delete-%category_id%\"\>Beenden</a\>\n</div\>");
  319. new FriendManagement({ currentCategoryId: 0, pageListLimit: 30, pageNumber: 1});
  320. </script>
  321.  
  322. </div>
  323. </div>
  324. <?php } else { header("location: ".$path.""); exit; } require_once('./templates/community_footer.php'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement