Advertisement
Guest User

Untitled

a guest
Jun 21st, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.29 KB | None | 0 0
  1. <?php
  2. /* #################################################################### \
  3. || ||
  4. || TwinkieCMS - Use of this software is strictly prohibited. *#
  5. || # Copyright (C) 2014 lD@vidl. *#
  6. ||---------------------------------------------------------------------*#
  7. ||---------------------------------------------------------------------*#
  8. || Script pensado para la gesti󮠤e retroservers Habbo. *#
  9. || Tanto el script como los autores del mismo no tienen ning򮠴ipo *#
  10. || de asociaci󮠣on Habbo y/o Sulake Oy Corp. Por lo tanto, estos no *#
  11. || se hacen responsables del uso que el usuario le d鮠 *#
  12. || ||
  13. \ ################################################################### */
  14. ob_start();
  15. require_once 'inc/core.php';
  16. $user->logged('yes');
  17. $tab = "4";
  18. if($_GET['tab'] == "2"){
  19. $pagenum = "2";
  20. $pn = "Mi email";
  21. $png = "Cambia tu email";
  22. }
  23. elseif($_GET['tab'] == "3"){
  24. $pagenum = "3";
  25. $pn = "Mi contrase&ntilde;a";
  26. $png = "Cambia tu contrase&ntilde;a";
  27. }elseif($_GET['tab'] == "4"){
  28. $pagenum = "4";
  29. $pg = "Vinculaci&oacute;n";
  30. $png = "Vincula tu cuenta!";
  31. }else{
  32. $pagenum = "1";
  33. $pn = "Mi Perfil";
  34. $png = "Cambiar tu perfil";
  35. }
  36. $page = $png;
  37. require_once 'templates/header.php';
  38.  
  39. $username = $_SESSION['username'];
  40. $password = $_SESSION['password'];
  41. if($pagenum == "2"){
  42. if(isset($_POST['save'])){
  43. $emaila = $user->filtertext($_POST['emaila']);
  44. $emailn = $user->filtertext($_POST['emailn']);
  45. $email_check = preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $emailn);
  46. if(empty($emaila) || empty($emailn)){
  47. $_SESSION['ERROR_RETURN'] = 'Rellena todos los campos';
  48. header("LOCATION: ". PATH ."/settings.php?tab=2&return");
  49. }elseif($emaila !== $user->Get('mail')){
  50. $_SESSION['ERROR_RETURN'] = 'El email que pusistes no es igual al actual';
  51. header("LOCATION: ". PATH ."/settings.php?tab=2&return");
  52. }elseif($user->ComprobateExist($emailn)){
  53. $_SESSION['ERROR_RETURN'] = 'Ese email ya esta en uso';
  54. header("LOCATION: ". PATH ."/settings.php?tab=2&return");
  55. }elseif($email_check !== 1){
  56. $_SESSION['ERROR_RETURN'] = 'Inserta un nuevo email v&aacute;lido';
  57. header("LOCATION: ". PATH ."/settings.php?tab=2&return");
  58. }else{
  59. $ex = $db->query("UPDATE users SET mail = '{$emailn}' WHERE id = '{$user->Get('id')}' LIMIT 1");
  60. $_SESSION['GOOD_RETURN'] = 'Atualizado!';
  61. header("LOCATION: ". PATH ."/settings.php?tab=2&return");
  62. }
  63. }
  64. }
  65.  
  66. if($pagenum == "3"){
  67. if(isset($_POST['save'])){
  68. $pp = $user->filtertext($_POST['ppassword']);
  69. $pnp = $user->filtertext($_POST['pnpass']);
  70. $prp = $user->filtertext($_POST['pnrp']);
  71. $orpassword = $user->HoloHash($pp, $user->Get('username'));
  72. $newpassword = $user->HoloHash($pnp, $user->Get('username'));
  73. if($orpassword !== $user->Get('password')){
  74. $_SESSION['ERROR_RETURN'] = 'Sua senha não se concide.';
  75. header("LOCATION: ". PATH ."/settings.php?tab=3&return");
  76. }else{
  77. if(strlen($pnp) < 6 || strlen($pnp) > 32){
  78.  
  79. $_SESSION['ERROR_RETURN'] = 'Insira uma senha válida';
  80. header("LOCATION: ". PATH ."/settings.php?tab=3&return");
  81. }else{
  82. if($pnp !== $prp){
  83.  
  84. $_SESSION['ERROR_RETURN'] = 'As senhas não são iguais.';
  85. header("LOCATION: ". PATH ."/settings.php?tab=3&return");
  86.  
  87. }else{
  88. $ex = $db->query("UPDATE users SET password = '{$newpassword}'
  89. WHERE id = '{$user->Get('id')}' LIMIT 1");
  90. $_SESSION['password'] = $newpassword;
  91. $_SESSION['GOOD_RETURN'] = 'Atualizado com sucesso!';
  92. header("LOCATION: ". PATH ."/settings.php?tab=3&return");
  93. }
  94. }
  95.  
  96. }
  97. }
  98. }
  99. if($pagenum == "1"){
  100. if(isset($_POST['save'])){
  101. $y = $user->filtertext($_POST['youtubeurl']);
  102. $m = $user->filtertext($_POST['motto']);
  103. $fr = $user->filtertext($_POST['friendRequestsAllowed']);
  104. if($fr){
  105. $fr = "0";
  106. }else{
  107. $fr = "1";
  108. }
  109. $so = $user->filtertext($_POST['showOnlineStatus']);
  110. if($so == "0"){
  111. $so = "0";
  112. }else{
  113. $so = "1";
  114. }
  115. $ff = $user->filtertext($_POST['followFriendMode']);
  116. if($ff == "1"){
  117. $ff = "0";
  118. }else{
  119. $ff = "1";
  120. }
  121. $ex = $db->query("UPDATE users
  122. SET block_newfriends = '{$fr}',
  123. youtubeurl = '{$y}',
  124. motto = '{$m}',
  125. hide_online = '{$so}',
  126. hide_inroom = '{$ff}'
  127. WHERE id = '{$user->Get('id')}' LIMIT 1");
  128. $_SESSION['GOOD_RETURN'] = 'Actualizado con exito!';
  129. header("LOCATION: ". PATH ."/settings.php?tab=1&return");
  130. }
  131.  
  132.  
  133. }
  134.  
  135. ?>
  136.  
  137.  
  138.  
  139. <!-- Se褯 Conte򤯠-->
  140. <div class="section container">
  141. <div class="row">
  142. <div class="col s12 m12 l3">
  143. <div class="row">
  144. <div class="box">
  145. <div class="title yellow darken-3 no-radius-bottom" style="margin-bottom:0">Menu <i class="fa fa-info-circle" style="float:right;margin-top:5px"></i></div>
  146. <a href="/settings.php" class="list-group-item">
  147. <span style="font-size:17px">Minhas Prefer&ecirc;ncias</span>
  148. </a>
  149. <a href="/settings.php?tab=3" class="list-group-item">
  150. <span style="font-size:17px">Mudar Senha</span>
  151. </a>
  152. </div>
  153. </div>
  154. </div>
  155.  
  156. <div class="col s12 m12 l7">
  157. <div class="row">
  158. <div class="box" id="prefs">
  159.  
  160. <div class="content">
  161. <?php if($pagenum == "3"){ ?><form action="<?php echo PATH; ?>/settings.php?save=true&tab=3" method="post" id="profileForm">
  162. <div class="box" id="password">
  163. <div class="title red no-radius-bottom" style="margin-bottom:0">Alterar minha senha <i class="fa fa-asterisk" style="float:right;margin-top:5px"></i></div>
  164. <div class="content">
  165. <span style="font-size: 13px;">Voc&ecirc; est&aacute; com medo que algu&eacute;m sabe sua senha? Mude-a aqui.</span><br>
  166. <div class="input-field col s12 m12 l12">
  167. <input type="password" name="old_password" id="old-password">
  168. <label for="old-password">Senha atual</label>
  169. </div>
  170. <hr style="border: 1px dashed #dddddd;border-top: 0px;">
  171.  
  172. <div class="input-field col s12 m12 l12">
  173. <input type="password" name="pnpass" id="new-password">
  174. <label for="new-password">Sua nova senha</label>
  175. </div>
  176. <hr style="border: 1px dashed #dddddd;border-top: 0px;">
  177.  
  178. <div class="input-field col s12 m12 l12">
  179. <input type="password" name="pnrp" id="new-password-repeat">
  180. <label for="new-password-repeat">Sua nova senha (repita)</label>
  181. </div>
  182.  
  183. <button class="btn waves-effect waves-light green" name="save" style="float:right" type="submit">
  184. Salvar
  185. </button>
  186. <div class="clr"></div>
  187. </div>
  188. </div></form>
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200. <?php }elseif($pagenum == "2"){ ?>
  201. <form action="<?php echo PATH; ?>/settings.php?save=true&tab=2" method="post" id="profileForm">
  202. <h3>Cambiar Email</h3>
  203. <p>
  204. <label>Email Actual:
  205. <input type="text" name="emaila" size="32" maxlength="32" value="" id="avatarmotto" />
  206. </label>
  207. </p>
  208. <p>
  209. <label>Nuevo Email:
  210. <input type="text" name="emailn" size="32" maxlength="32" value="" id="avatarmotto" />
  211. </label>
  212. </p>
  213. <input type="submit" value="Salvar cambios" name="save" class="submit" />
  214. </form>
  215. <?php }elseif($pagenum == "4"){ ?>
  216. <center><h3>Vincular o Desvincular Cuenta de Facebook</h3></center>
  217. <p>
  218. <center>
  219. <?php if($user->Get('facebook') == "1"){
  220. echo "Lo sentimos pero tu no puedes desvincular tu cuenta";
  221. }elseif($user->Get('facebook_id') == "0" && $user->Get('facebook') !== "1"){ ?>
  222.  
  223. <div id="fb-root"></div><script type="text/javascript">
  224. window.fbAsyncInit = function() {
  225. Cookie.erase("fbsr_<?php echo FBID; ?>");
  226. FB.init({
  227. appId: '<?php echo FBID; ?>',
  228. channelUrl : '/fbchannel',
  229. status: true,
  230. cookie: true,
  231. xfbml: true
  232. });
  233.  
  234. FB.getLoginStatus(function (oSession) {
  235. if (typeof comufy_storeUser != 'undefined') {
  236. if (oSession.status !== 'connected') {
  237. FB.Event.subscribe('auth.login', function (oSession) {
  238. if (oSession.status == "connected") {
  239. comufy_storeUser(oSession, {});
  240. }
  241. });
  242. } else {
  243. comufy_storeUser(oSession, {});
  244. }
  245. }
  246. });
  247.  
  248. if (window.habboPageInitQueue) {
  249. // jquery might not be loaded yet
  250. habboPageInitQueue.push(function() {
  251. $(document).trigger("fbevents:scriptLoaded");
  252. });
  253. } else {
  254. $(document).fire("fbevents:scriptLoaded");
  255. }
  256.  
  257. };
  258. window.assistedLogin = function(FBobject, optresponse) {
  259.  
  260. Cookie.erase("fbsr_<?php echo FBID; ?>");
  261. FBobject.init({
  262. appId: '<?php echo FBID; ?>',
  263. channelUrl : '/fbchannel',
  264. status: true,
  265. cookie: true,
  266. xfbml: true
  267. });
  268.  
  269. permissions = 'user_birthday,email,user_likes';
  270. defaultAction = function(response) {
  271. if (response.authResponse) {
  272. fbConnectUrl = "/facebook/vinc.php?connect=true";
  273. Cookie.erase("fbhb_val_<?php echo FBID; ?>");
  274. Cookie.set("fbhb_val_<?php echo FBID; ?>", response.authResponse.accessToken);
  275. Cookie.erase("fbhb_expr_<?php echo FBID; ?>");
  276. Cookie.set("fbhb_expr_<?php echo FBID; ?>", response.authResponse.expiresIn);
  277. window.location.replace(fbConnectUrl);
  278. }
  279. };
  280.  
  281. if (typeof optresponse == 'undefined')
  282. FBobject.login(defaultAction, {scope:permissions});
  283. else
  284. FBobject.login(optresponse, {scope:permissions});
  285.  
  286. };
  287.  
  288. (function() {
  289. var e = document.createElement('script');
  290. e.async = true;
  291. e.src = document.location.protocol + '//connect.facebook.net/es_ES/all.js';
  292. document.getElementById('fb-root').appendChild(e);
  293. }());
  294. </script>
  295. <a href="#" class="fb_button fb_button_large" onClick="assistedLogin(FB); return false;">
  296. <img src="http://i.imgur.com/nvcCLQ5.png">
  297. </a>
  298. <?php }elseif(strlen($user->Get('facebook_id')) > 4){ ?>
  299. <div id="fb-root"></div><script type="text/javascript">
  300. window.fbAsyncInit = function() {
  301. Cookie.erase("fbsr_<?php echo FBID; ?>");
  302. FB.init({
  303. appId: '<?php echo FBID; ?>',
  304. channelUrl : '/fbchannel',
  305. status: true,
  306. cookie: true,
  307. xfbml: true
  308. });
  309.  
  310. FB.getLoginStatus(function (oSession) {
  311. if (typeof comufy_storeUser != 'undefined') {
  312. if (oSession.status !== 'connected') {
  313. FB.Event.subscribe('auth.login', function (oSession) {
  314. if (oSession.status == "connected") {
  315. comufy_storeUser(oSession, {});
  316. }
  317. });
  318. } else {
  319. comufy_storeUser(oSession, {});
  320. }
  321. }
  322. });
  323.  
  324. if (window.habboPageInitQueue) {
  325. // jquery might not be loaded yet
  326. habboPageInitQueue.push(function() {
  327. $(document).trigger("fbevents:scriptLoaded");
  328. });
  329. } else {
  330. $(document).fire("fbevents:scriptLoaded");
  331. }
  332.  
  333. };
  334. window.assistedLogin = function(FBobject, optresponse) {
  335.  
  336. Cookie.erase("fbsr_<?php echo FBID; ?>");
  337. FBobject.init({
  338. appId: '<?php echo FBID; ?>',
  339. channelUrl : '/fbchannel',
  340. status: true,
  341. cookie: true,
  342. xfbml: true
  343. });
  344.  
  345. permissions = 'user_birthday,email,user_likes';
  346. defaultAction = function(response) {
  347. if (response.authResponse) {
  348. fbConnectUrl = "/facebook/des.php?connect=true";
  349. Cookie.erase("fbhb_val_<?php echo FBID; ?>");
  350. Cookie.set("fbhb_val_<?php echo FBID; ?>", response.authResponse.accessToken);
  351. Cookie.erase("fbhb_expr_<?php echo FBID; ?>");
  352. Cookie.set("fbhb_expr_<?php echo FBID; ?>", response.authResponse.expiresIn);
  353. window.location.replace(fbConnectUrl);
  354. }
  355. };
  356.  
  357. if (typeof optresponse == 'undefined')
  358. FBobject.login(defaultAction, {scope:permissions});
  359. else
  360. FBobject.login(optresponse, {scope:permissions});
  361.  
  362. };
  363.  
  364. (function() {
  365. var e = document.createElement('script');
  366. e.async = true;
  367. e.src = document.location.protocol + '//connect.facebook.net/es_ES/all.js';
  368. document.getElementById('fb-root').appendChild(e);
  369. }());
  370. </script>
  371. <a href="#" class="fb_button fb_button_large" onClick="assistedLogin(FB); return false;"><img src="http://i.imgur.com/6JE6BeL.png"></a>
  372. <?php }else{ ?>
  373.  
  374. <div id="fb-root"></div><script type="text/javascript">
  375. window.fbAsyncInit = function() {
  376. Cookie.erase("fbsr_<?php echo FBID; ?>");
  377. FB.init({
  378. appId: '<?php echo FBID; ?>',
  379. channelUrl : '/fbchannel',
  380. status: true,
  381. cookie: true,
  382. xfbml: true
  383. });
  384.  
  385. FB.getLoginStatus(function (oSession) {
  386. if (typeof comufy_storeUser != 'undefined') {
  387. if (oSession.status !== 'connected') {
  388. FB.Event.subscribe('auth.login', function (oSession) {
  389. if (oSession.status == "connected") {
  390. comufy_storeUser(oSession, {});
  391. }
  392. });
  393. } else {
  394. comufy_storeUser(oSession, {});
  395. }
  396. }
  397. });
  398.  
  399. if (window.habboPageInitQueue) {
  400. // jquery might not be loaded yet
  401. habboPageInitQueue.push(function() {
  402. $(document).trigger("fbevents:scriptLoaded");
  403. });
  404. } else {
  405. $(document).fire("fbevents:scriptLoaded");
  406. }
  407.  
  408. };
  409. window.assistedLogin = function(FBobject, optresponse) {
  410.  
  411. Cookie.erase("fbsr_<?php echo FBID; ?>");
  412. FBobject.init({
  413. appId: '<?php echo FBID; ?>',
  414. channelUrl : '/fbchannel',
  415. status: true,
  416. cookie: true,
  417. xfbml: true
  418. });
  419.  
  420. permissions = 'user_birthday,email,user_likes';
  421. defaultAction = function(response) {
  422. if (response.authResponse) {
  423. fbConnectUrl = "/facebook/vinc.php?connect=true";
  424. Cookie.erase("fbhb_val_<?php echo FBID; ?>");
  425. Cookie.set("fbhb_val_<?php echo FBID; ?>", response.authResponse.accessToken);
  426. Cookie.erase("fbhb_expr_<?php echo FBID; ?>");
  427. Cookie.set("fbhb_expr_<?php echo FBID; ?>", response.authResponse.expiresIn);
  428. window.location.replace(fbConnectUrl);
  429. }
  430. };
  431.  
  432. if (typeof optresponse == 'undefined')
  433. FBobject.login(defaultAction, {scope:permissions});
  434. else
  435. FBobject.login(optresponse, {scope:permissions});
  436.  
  437. };
  438.  
  439. (function() {
  440. var e = document.createElement('script');
  441. e.async = true;
  442. e.src = document.location.protocol + '//connect.facebook.net/es_ES/all.js';
  443. document.getElementById('fb-root').appendChild(e);
  444. }());
  445. </script>
  446. <a href="#" class="fb_button fb_button_large" onClick="assistedLogin(FB); return false;">
  447. <img src="http://i.imgur.com/nvcCLQ5.png">
  448. </a>
  449. <?php } ?>
  450. </center>
  451. <br><b>&iquest;Para qu&eacute; es esto?</b> Cuando tu vincules tu cuenta de Hartico con la de Facebook, en la home sin poner datos de Hartico, al dar al boton de Conectar de Facebook te entrar&aacute; dir&eacute;ctamente a tu cuenta de Hartico.
  452. </p>
  453. <center><h2>+300 cuentas vinculadas</h2></center>
  454. <?php }else{ ?><div class="box" id="prefs">
  455. <div class="title blue no-radius-bottom">Minhas Prefer&ecirc;ncias <i class="fa fa-cog" style="float:right;margin-top:5px"></i></div>
  456. <div class="content">
  457. <form action="<?php echo PATH; ?>/settings.php?save=true&tab=1" method="post" id="profileForm">
  458. <span style="font-size: 21px;">Minha Miss&atilde;o</span><br>
  459. <div class="input-field col s12">
  460. <input type="text" maxlength="60" name="motto" value="<?php echo $user->Get('motto'); ?>" id="motto">
  461. <label for="motto">Qual &eacute; a sua miss&atilde;o?</label>
  462. </div>
  463. <hr style="border: 1px dashed #dddddd;border-top: 0px;">
  464. <div class="input-field col s12">
  465. <input type="text" maxlength="60" name="youtubeurl" value="<?php echo $user->Get('youtubeurl'); ?>" id="motto">
  466. <label for="motto">Qual &eacute; a sua miss&atilde;o?</label>
  467. </div>
  468.  
  469.  
  470. <?php
  471. if($user->Get('hide_online') == "1"){ $c2 = ' checked="checked"'; $c2_ = ""; }else{ $c2_ = ' checked="checked"'; $c2 = ""; }
  472. ?>
  473. <span style="font-size: 21px;">Online</span><br>
  474. <span style="font-size: 12px;">Quem pode ver que voc&ecirc; est&aacute; online?</span><br>
  475. <input class="with-gap" name="showOnlineStatus" value="1" type="radio" id="online_status_yes" <?php echo $c2; ?>/>
  476. <label for="online_status_yes">Ningu&eacute;m</label>
  477. <input class="with-gap" name="showOnlineStatus" value="0" type="radio" id="online_status_no" <?php echo $c2_; ?>/>
  478. <label for="online_status_no">Todos</label>
  479. <hr style="border: 1px dashed #dddddd;border-top: 0px;">
  480.  
  481. <?php
  482. if($user->Get('hide_inroom') == "1"){ $c3 = ' checked="checked"'; $c3_ = ""; }else{ $c3_ = ' checked="checked"'; $c3 = ""; }
  483. ?>
  484. <span style="font-size: 21px;">Seguir</span><br>
  485. <span style="font-size: 12px;">Amigos podem segui-lo no hotel?</span><br>
  486. <input class="with-gap" name="friends_follow" value="yes" checked type="radio" id="follow" <?php echo $c3; ?>/>
  487. <label for="follow">Sim, tudo bem</label>
  488. <input class="with-gap" name="friends_follow" value="no" type="radio" id="dont-follow" <?php echo $c3_; ?>/>
  489. <label for="dont-follow">N&atilde;o, por favor, n&atilde;o</label>
  490. <hr style="border: 1px dashed #dddddd;border-top: 0px;">
  491.  
  492.  
  493. <?php
  494. if($user->Get('block_newfriends') == "1"){ $c4 = ' checked="checked"'; $c4_ = ""; }else{ $c4_ = ' checked="checked"'; $c4 = ""; }
  495. ?>
  496. <span style="font-size: 21px;">Solicitações de amizade</span><br>
  497. <span style="font-size: 12px;">Podem enviar solicitações de amizade para você?</span><br>
  498. <input class="with-gap" name="friendRequestsAllowed" value="1" type="radio" id="not" <?php echo $c4; ?>/>
  499. <label for="not">Não.</label>
  500. <input class="with-gap" name="friendRequestsAllowed" value="0" type="radio" id="allow" <?php echo $c4_; ?>/>
  501. <label for="allow">Sim.</label>
  502. <hr style="border: 1px dashed #dddddd;border-top: 0px;">
  503.  
  504. <input type="submit" style="float:right" value="Salvar" name="save" class="btn green medium condensed" />
  505.  
  506. </form>
  507. <?php } ?>
  508. <div class="clr"></div>
  509. </div>
  510. </div>
  511. </div>
  512.  
  513. </div>
  514. </div>
  515. </form>
  516. <?php require_once 'templates/footer.php'; ?>
  517. <?php ob_end_flush(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement