Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* #################################################################### \
- || ||
- || TwinkieCMS - Use of this software is strictly prohibited. *#
- || # Copyright (C) 2014 lD@vidl. *#
- ||---------------------------------------------------------------------*#
- ||---------------------------------------------------------------------*#
- || Script pensado para la gestie retroservers Habbo. *#
- || Tanto el script como los autores del mismo no tienen ningipo *#
- || de asociacion Habbo y/o Sulake Oy Corp. Por lo tanto, estos no *#
- || se hacen responsables del uso que el usuario le d鮠 *#
- || ||
- \ ################################################################### */
- ob_start();
- require_once 'inc/core.php';
- $user->logged('yes');
- $tab = "4";
- if($_GET['tab'] == "2"){
- $pagenum = "2";
- $pn = "Mi email";
- $png = "Cambia tu email";
- }
- elseif($_GET['tab'] == "3"){
- $pagenum = "3";
- $pn = "Mi contraseña";
- $png = "Cambia tu contraseña";
- }elseif($_GET['tab'] == "4"){
- $pagenum = "4";
- $pg = "Vinculación";
- $png = "Vincula tu cuenta!";
- }else{
- $pagenum = "1";
- $pn = "Mi Perfil";
- $png = "Cambiar tu perfil";
- }
- $page = $png;
- require_once 'templates/header.php';
- $username = $_SESSION['username'];
- $password = $_SESSION['password'];
- if($pagenum == "2"){
- if(isset($_POST['save'])){
- $emaila = $user->filtertext($_POST['emaila']);
- $emailn = $user->filtertext($_POST['emailn']);
- $email_check = preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $emailn);
- if(empty($emaila) || empty($emailn)){
- $_SESSION['ERROR_RETURN'] = 'Rellena todos los campos';
- header("LOCATION: ". PATH ."/settings.php?tab=2&return");
- }elseif($emaila !== $user->Get('mail')){
- $_SESSION['ERROR_RETURN'] = 'El email que pusistes no es igual al actual';
- header("LOCATION: ". PATH ."/settings.php?tab=2&return");
- }elseif($user->ComprobateExist($emailn)){
- $_SESSION['ERROR_RETURN'] = 'Ese email ya esta en uso';
- header("LOCATION: ". PATH ."/settings.php?tab=2&return");
- }elseif($email_check !== 1){
- $_SESSION['ERROR_RETURN'] = 'Inserta un nuevo email válido';
- header("LOCATION: ". PATH ."/settings.php?tab=2&return");
- }else{
- $ex = $db->query("UPDATE users SET mail = '{$emailn}' WHERE id = '{$user->Get('id')}' LIMIT 1");
- $_SESSION['GOOD_RETURN'] = 'Atualizado!';
- header("LOCATION: ". PATH ."/settings.php?tab=2&return");
- }
- }
- }
- if($pagenum == "3"){
- if(isset($_POST['save'])){
- $pp = $user->filtertext($_POST['ppassword']);
- $pnp = $user->filtertext($_POST['pnpass']);
- $prp = $user->filtertext($_POST['pnrp']);
- $orpassword = $user->HoloHash($pp, $user->Get('username'));
- $newpassword = $user->HoloHash($pnp, $user->Get('username'));
- if($orpassword !== $user->Get('password')){
- $_SESSION['ERROR_RETURN'] = 'Sua senha não se concide.';
- header("LOCATION: ". PATH ."/settings.php?tab=3&return");
- }else{
- if(strlen($pnp) < 6 || strlen($pnp) > 32){
- $_SESSION['ERROR_RETURN'] = 'Insira uma senha válida';
- header("LOCATION: ". PATH ."/settings.php?tab=3&return");
- }else{
- if($pnp !== $prp){
- $_SESSION['ERROR_RETURN'] = 'As senhas não são iguais.';
- header("LOCATION: ". PATH ."/settings.php?tab=3&return");
- }else{
- $ex = $db->query("UPDATE users SET password = '{$newpassword}'
- WHERE id = '{$user->Get('id')}' LIMIT 1");
- $_SESSION['password'] = $newpassword;
- $_SESSION['GOOD_RETURN'] = 'Atualizado com sucesso!';
- header("LOCATION: ". PATH ."/settings.php?tab=3&return");
- }
- }
- }
- }
- }
- if($pagenum == "1"){
- if(isset($_POST['save'])){
- $y = $user->filtertext($_POST['youtubeurl']);
- $m = $user->filtertext($_POST['motto']);
- $fr = $user->filtertext($_POST['friendRequestsAllowed']);
- if($fr){
- $fr = "0";
- }else{
- $fr = "1";
- }
- $so = $user->filtertext($_POST['showOnlineStatus']);
- if($so == "0"){
- $so = "0";
- }else{
- $so = "1";
- }
- $ff = $user->filtertext($_POST['followFriendMode']);
- if($ff == "1"){
- $ff = "0";
- }else{
- $ff = "1";
- }
- $ex = $db->query("UPDATE users
- SET block_newfriends = '{$fr}',
- youtubeurl = '{$y}',
- motto = '{$m}',
- hide_online = '{$so}',
- hide_inroom = '{$ff}'
- WHERE id = '{$user->Get('id')}' LIMIT 1");
- $_SESSION['GOOD_RETURN'] = 'Actualizado con exito!';
- header("LOCATION: ". PATH ."/settings.php?tab=1&return");
- }
- }
- ?>
- <!-- Se褯 Conte-->
- <div class="section container">
- <div class="row">
- <div class="col s12 m12 l3">
- <div class="row">
- <div class="box">
- <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>
- <a href="/settings.php" class="list-group-item">
- <span style="font-size:17px">Minhas Preferências</span>
- </a>
- <a href="/settings.php?tab=3" class="list-group-item">
- <span style="font-size:17px">Mudar Senha</span>
- </a>
- </div>
- </div>
- </div>
- <div class="col s12 m12 l7">
- <div class="row">
- <div class="box" id="prefs">
- <div class="content">
- <?php if($pagenum == "3"){ ?><form action="<?php echo PATH; ?>/settings.php?save=true&tab=3" method="post" id="profileForm">
- <div class="box" id="password">
- <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>
- <div class="content">
- <span style="font-size: 13px;">Você está com medo que alguém sabe sua senha? Mude-a aqui.</span><br>
- <div class="input-field col s12 m12 l12">
- <input type="password" name="old_password" id="old-password">
- <label for="old-password">Senha atual</label>
- </div>
- <hr style="border: 1px dashed #dddddd;border-top: 0px;">
- <div class="input-field col s12 m12 l12">
- <input type="password" name="pnpass" id="new-password">
- <label for="new-password">Sua nova senha</label>
- </div>
- <hr style="border: 1px dashed #dddddd;border-top: 0px;">
- <div class="input-field col s12 m12 l12">
- <input type="password" name="pnrp" id="new-password-repeat">
- <label for="new-password-repeat">Sua nova senha (repita)</label>
- </div>
- <button class="btn waves-effect waves-light green" name="save" style="float:right" type="submit">
- Salvar
- </button>
- <div class="clr"></div>
- </div>
- </div></form>
- <?php }elseif($pagenum == "2"){ ?>
- <form action="<?php echo PATH; ?>/settings.php?save=true&tab=2" method="post" id="profileForm">
- <h3>Cambiar Email</h3>
- <p>
- <label>Email Actual:
- <input type="text" name="emaila" size="32" maxlength="32" value="" id="avatarmotto" />
- </label>
- </p>
- <p>
- <label>Nuevo Email:
- <input type="text" name="emailn" size="32" maxlength="32" value="" id="avatarmotto" />
- </label>
- </p>
- <input type="submit" value="Salvar cambios" name="save" class="submit" />
- </form>
- <?php }elseif($pagenum == "4"){ ?>
- <center><h3>Vincular o Desvincular Cuenta de Facebook</h3></center>
- <p>
- <center>
- <?php if($user->Get('facebook') == "1"){
- echo "Lo sentimos pero tu no puedes desvincular tu cuenta";
- }elseif($user->Get('facebook_id') == "0" && $user->Get('facebook') !== "1"){ ?>
- <div id="fb-root"></div><script type="text/javascript">
- window.fbAsyncInit = function() {
- Cookie.erase("fbsr_<?php echo FBID; ?>");
- FB.init({
- appId: '<?php echo FBID; ?>',
- channelUrl : '/fbchannel',
- status: true,
- cookie: true,
- xfbml: true
- });
- FB.getLoginStatus(function (oSession) {
- if (typeof comufy_storeUser != 'undefined') {
- if (oSession.status !== 'connected') {
- FB.Event.subscribe('auth.login', function (oSession) {
- if (oSession.status == "connected") {
- comufy_storeUser(oSession, {});
- }
- });
- } else {
- comufy_storeUser(oSession, {});
- }
- }
- });
- if (window.habboPageInitQueue) {
- // jquery might not be loaded yet
- habboPageInitQueue.push(function() {
- $(document).trigger("fbevents:scriptLoaded");
- });
- } else {
- $(document).fire("fbevents:scriptLoaded");
- }
- };
- window.assistedLogin = function(FBobject, optresponse) {
- Cookie.erase("fbsr_<?php echo FBID; ?>");
- FBobject.init({
- appId: '<?php echo FBID; ?>',
- channelUrl : '/fbchannel',
- status: true,
- cookie: true,
- xfbml: true
- });
- permissions = 'user_birthday,email,user_likes';
- defaultAction = function(response) {
- if (response.authResponse) {
- fbConnectUrl = "/facebook/vinc.php?connect=true";
- Cookie.erase("fbhb_val_<?php echo FBID; ?>");
- Cookie.set("fbhb_val_<?php echo FBID; ?>", response.authResponse.accessToken);
- Cookie.erase("fbhb_expr_<?php echo FBID; ?>");
- Cookie.set("fbhb_expr_<?php echo FBID; ?>", response.authResponse.expiresIn);
- window.location.replace(fbConnectUrl);
- }
- };
- if (typeof optresponse == 'undefined')
- FBobject.login(defaultAction, {scope:permissions});
- else
- FBobject.login(optresponse, {scope:permissions});
- };
- (function() {
- var e = document.createElement('script');
- e.async = true;
- e.src = document.location.protocol + '//connect.facebook.net/es_ES/all.js';
- document.getElementById('fb-root').appendChild(e);
- }());
- </script>
- <a href="#" class="fb_button fb_button_large" onClick="assistedLogin(FB); return false;">
- <img src="http://i.imgur.com/nvcCLQ5.png">
- </a>
- <?php }elseif(strlen($user->Get('facebook_id')) > 4){ ?>
- <div id="fb-root"></div><script type="text/javascript">
- window.fbAsyncInit = function() {
- Cookie.erase("fbsr_<?php echo FBID; ?>");
- FB.init({
- appId: '<?php echo FBID; ?>',
- channelUrl : '/fbchannel',
- status: true,
- cookie: true,
- xfbml: true
- });
- FB.getLoginStatus(function (oSession) {
- if (typeof comufy_storeUser != 'undefined') {
- if (oSession.status !== 'connected') {
- FB.Event.subscribe('auth.login', function (oSession) {
- if (oSession.status == "connected") {
- comufy_storeUser(oSession, {});
- }
- });
- } else {
- comufy_storeUser(oSession, {});
- }
- }
- });
- if (window.habboPageInitQueue) {
- // jquery might not be loaded yet
- habboPageInitQueue.push(function() {
- $(document).trigger("fbevents:scriptLoaded");
- });
- } else {
- $(document).fire("fbevents:scriptLoaded");
- }
- };
- window.assistedLogin = function(FBobject, optresponse) {
- Cookie.erase("fbsr_<?php echo FBID; ?>");
- FBobject.init({
- appId: '<?php echo FBID; ?>',
- channelUrl : '/fbchannel',
- status: true,
- cookie: true,
- xfbml: true
- });
- permissions = 'user_birthday,email,user_likes';
- defaultAction = function(response) {
- if (response.authResponse) {
- fbConnectUrl = "/facebook/des.php?connect=true";
- Cookie.erase("fbhb_val_<?php echo FBID; ?>");
- Cookie.set("fbhb_val_<?php echo FBID; ?>", response.authResponse.accessToken);
- Cookie.erase("fbhb_expr_<?php echo FBID; ?>");
- Cookie.set("fbhb_expr_<?php echo FBID; ?>", response.authResponse.expiresIn);
- window.location.replace(fbConnectUrl);
- }
- };
- if (typeof optresponse == 'undefined')
- FBobject.login(defaultAction, {scope:permissions});
- else
- FBobject.login(optresponse, {scope:permissions});
- };
- (function() {
- var e = document.createElement('script');
- e.async = true;
- e.src = document.location.protocol + '//connect.facebook.net/es_ES/all.js';
- document.getElementById('fb-root').appendChild(e);
- }());
- </script>
- <a href="#" class="fb_button fb_button_large" onClick="assistedLogin(FB); return false;"><img src="http://i.imgur.com/6JE6BeL.png"></a>
- <?php }else{ ?>
- <div id="fb-root"></div><script type="text/javascript">
- window.fbAsyncInit = function() {
- Cookie.erase("fbsr_<?php echo FBID; ?>");
- FB.init({
- appId: '<?php echo FBID; ?>',
- channelUrl : '/fbchannel',
- status: true,
- cookie: true,
- xfbml: true
- });
- FB.getLoginStatus(function (oSession) {
- if (typeof comufy_storeUser != 'undefined') {
- if (oSession.status !== 'connected') {
- FB.Event.subscribe('auth.login', function (oSession) {
- if (oSession.status == "connected") {
- comufy_storeUser(oSession, {});
- }
- });
- } else {
- comufy_storeUser(oSession, {});
- }
- }
- });
- if (window.habboPageInitQueue) {
- // jquery might not be loaded yet
- habboPageInitQueue.push(function() {
- $(document).trigger("fbevents:scriptLoaded");
- });
- } else {
- $(document).fire("fbevents:scriptLoaded");
- }
- };
- window.assistedLogin = function(FBobject, optresponse) {
- Cookie.erase("fbsr_<?php echo FBID; ?>");
- FBobject.init({
- appId: '<?php echo FBID; ?>',
- channelUrl : '/fbchannel',
- status: true,
- cookie: true,
- xfbml: true
- });
- permissions = 'user_birthday,email,user_likes';
- defaultAction = function(response) {
- if (response.authResponse) {
- fbConnectUrl = "/facebook/vinc.php?connect=true";
- Cookie.erase("fbhb_val_<?php echo FBID; ?>");
- Cookie.set("fbhb_val_<?php echo FBID; ?>", response.authResponse.accessToken);
- Cookie.erase("fbhb_expr_<?php echo FBID; ?>");
- Cookie.set("fbhb_expr_<?php echo FBID; ?>", response.authResponse.expiresIn);
- window.location.replace(fbConnectUrl);
- }
- };
- if (typeof optresponse == 'undefined')
- FBobject.login(defaultAction, {scope:permissions});
- else
- FBobject.login(optresponse, {scope:permissions});
- };
- (function() {
- var e = document.createElement('script');
- e.async = true;
- e.src = document.location.protocol + '//connect.facebook.net/es_ES/all.js';
- document.getElementById('fb-root').appendChild(e);
- }());
- </script>
- <a href="#" class="fb_button fb_button_large" onClick="assistedLogin(FB); return false;">
- <img src="http://i.imgur.com/nvcCLQ5.png">
- </a>
- <?php } ?>
- </center>
- <br><b>¿Para qué 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á diréctamente a tu cuenta de Hartico.
- </p>
- <center><h2>+300 cuentas vinculadas</h2></center>
- <?php }else{ ?><div class="box" id="prefs">
- <div class="title blue no-radius-bottom">Minhas Preferências <i class="fa fa-cog" style="float:right;margin-top:5px"></i></div>
- <div class="content">
- <form action="<?php echo PATH; ?>/settings.php?save=true&tab=1" method="post" id="profileForm">
- <span style="font-size: 21px;">Minha Missão</span><br>
- <div class="input-field col s12">
- <input type="text" maxlength="60" name="motto" value="<?php echo $user->Get('motto'); ?>" id="motto">
- <label for="motto">Qual é a sua missão?</label>
- </div>
- <hr style="border: 1px dashed #dddddd;border-top: 0px;">
- <div class="input-field col s12">
- <input type="text" maxlength="60" name="youtubeurl" value="<?php echo $user->Get('youtubeurl'); ?>" id="motto">
- <label for="motto">Qual é a sua missão?</label>
- </div>
- <?php
- if($user->Get('hide_online') == "1"){ $c2 = ' checked="checked"'; $c2_ = ""; }else{ $c2_ = ' checked="checked"'; $c2 = ""; }
- ?>
- <span style="font-size: 21px;">Online</span><br>
- <span style="font-size: 12px;">Quem pode ver que você está online?</span><br>
- <input class="with-gap" name="showOnlineStatus" value="1" type="radio" id="online_status_yes" <?php echo $c2; ?>/>
- <label for="online_status_yes">Ninguém</label>
- <input class="with-gap" name="showOnlineStatus" value="0" type="radio" id="online_status_no" <?php echo $c2_; ?>/>
- <label for="online_status_no">Todos</label>
- <hr style="border: 1px dashed #dddddd;border-top: 0px;">
- <?php
- if($user->Get('hide_inroom') == "1"){ $c3 = ' checked="checked"'; $c3_ = ""; }else{ $c3_ = ' checked="checked"'; $c3 = ""; }
- ?>
- <span style="font-size: 21px;">Seguir</span><br>
- <span style="font-size: 12px;">Amigos podem segui-lo no hotel?</span><br>
- <input class="with-gap" name="friends_follow" value="yes" checked type="radio" id="follow" <?php echo $c3; ?>/>
- <label for="follow">Sim, tudo bem</label>
- <input class="with-gap" name="friends_follow" value="no" type="radio" id="dont-follow" <?php echo $c3_; ?>/>
- <label for="dont-follow">Não, por favor, não</label>
- <hr style="border: 1px dashed #dddddd;border-top: 0px;">
- <?php
- if($user->Get('block_newfriends') == "1"){ $c4 = ' checked="checked"'; $c4_ = ""; }else{ $c4_ = ' checked="checked"'; $c4 = ""; }
- ?>
- <span style="font-size: 21px;">Solicitações de amizade</span><br>
- <span style="font-size: 12px;">Podem enviar solicitações de amizade para você?</span><br>
- <input class="with-gap" name="friendRequestsAllowed" value="1" type="radio" id="not" <?php echo $c4; ?>/>
- <label for="not">Não.</label>
- <input class="with-gap" name="friendRequestsAllowed" value="0" type="radio" id="allow" <?php echo $c4_; ?>/>
- <label for="allow">Sim.</label>
- <hr style="border: 1px dashed #dddddd;border-top: 0px;">
- <input type="submit" style="float:right" value="Salvar" name="save" class="btn green medium condensed" />
- </form>
- <?php } ?>
- <div class="clr"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </form>
- <?php require_once 'templates/footer.php'; ?>
- <?php ob_end_flush(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement