Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('./data_classes/server-data.php_data_classes-core.php.php');
- $pagename = "Meus Detalhes";
- $body_id = "profile";
- $pageid = "2";
- if(isset($_GET['web-profile-tab'])){
- if($_GET['web-profile-tab'] < 2 || $_GET['web-profile-tab'] > 5 || !$_GET['web-profile-tab']){
- header("Location: ".$path."/profile/2");
- $tab = 0;
- exit;
- } else {
- $tab = FilterText($_GET['web-profile-tab']);
- }
- } else {
- $tab = "2";
- }
- if($tab == "2"){
- if(isset($_POST['save'])){
- $motto = $_POST['motto'];
- $chr = chr(1);
- $chr2 = chr(2);
- $motto2 = str_replace($chr, "", $motto);
- $motto3 = str_replace($chr2, "", $motto);
- if(strlen($motto3) > 24){
- $result = "Sua missão é muito larga!";
- $error = "1";
- } else {
- if($_POST['block_newfriends'] == "true"){ $block_newfriends = '0'; }else{ $block_newfriends = '1'; }
- mysql_query("UPDATE users SET motto = '".mysql_real_escape_string($motto3)."', visibility = '".mysql_real_escape_string($_POST['visibility'])."', 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());
- $result = "Seu perfil foi atualizado corretamente!";
- }
- }
- } else if($tab == "3"){
- if(isset($_POST['save'])){
- $pass1 = FilterText($_POST['password']);
- $pass1_hash = HoloHashMD5($pass1, $myrow['username']);
- $mail1 = FilterText($_POST['email']);
- $themail = $mail1;
- //checks password --encryption--
- if($pass1_hash == $myrow['password'] ){
- $email_check = preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $mail1);
- if($email_check == "1"){
- mysql_query("UPDATE users SET mail = '".$mail1."' WHERE username = '".$rawname."' and password = '".$rawpass."'") or die(mysql_error());
- $result = "A atualização do e-mail \"".$mail1."\" foi realizada corretamente!";
- } else {
- $result = "A atualização de e-mail está incorreta!";
- $error = "1";
- }
- } else {
- $result = "Seus dados estão incorretos!";
- $error = "1";
- }
- } else {
- $themail = $myrow['mail'];
- }
- } else if($tab == "4"){
- if(isset($_POST['save'])){
- $pass1 = FilterText($_POST['password']);
- //Hashes and salts the old password with the user id (in lowercase) --encryption--
- $pass1_hash = HoloHashMD5($pass1, $myrow['name']);
- $newpass = FilterText($_POST['pass']);
- //Hashes and salts the new password with the user id (in lowercase) --encryption--
- $newpass_hash = HoloHashMD5($newpass, $rawname);
- $newpass_conf = FilterText($_POST['confpass']);
- if($pass1_hash == $myrow['password'] ){
- if($newpass == $newpass_conf){
- if(strlen($newpass) < 6){
- $result = "A senha fornecida é muito curta, digite uma de pelo menos 6 carácteres!";
- $error = "1";
- } else {
- if(strlen($newpass) > 51){
- $result = "A senha é muito longa, forneça uma senha com menos de 50 carácteres!";
- $error = "1";
- } else {
- //Updates password --encryption--
- mysql_query("UPDATE users SET password = '".$newpass_hash."' WHERE username = '".$rawname."' and password = '".$rawpass."'") or die(mysql_error());
- $result = "A senha foi alterada. Por favor faça login novamente.";
- }
- }
- } else {
- $result = "As senhas não coincidem.";
- $error = "1";
- }
- } else {
- $result = "Preencha todos os campos requeridos!";
- $error = "1";
- }
- }
- }
- require_once('./templates/community_subheader.php');
- require_once('./templates/community_header.php');
- ?>
- <div id="container">
- <div id="content">
- <div>
- <div class="content">
- <div class="habblet-container" style="float:left; width:210px;">
- <div class="cbb settings">
- <h2 class="title">Preferências</h2>
- <div class="box-content">
- <div id="settingsNavigation">
- <ul>
- <?php
- if($tab == "2"){
- echo "<li class='selected'>Meus detalhes
- </li>";
- } else {
- echo "<li><a href='".$path."/profile/2'>Meus detalhes</a>
- </li>";
- }
- if($tab == "4"){
- echo "<li class='selected'>Minha senha
- </li>";
- } else {
- echo "<li><a href='".$path."/profile/4'>Minha senha</a>
- </li>";
- }
- ?>
- </ul>
- </div>
- </div></div>
- <?php if($hc > 1){ ?>
- <div class="cbb habboclub-tryout">
- <h2 class="title"><?php echo $shortname; ?> VIP</h2>
- <div class="box-content">
- <div class="habboclub-banner-container habboclub-clothes-banner"></div>
- <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>
- <p class="habboclub-link"><a href="credits/vip">Ver mais benefícios »</a></p>
- </div>
- </div>
- <?php } ?>
- </div>
- <?php if($tab == "2"){ ?>
- <div class="habblet-container " style="float:left; width: 560px;">
- <div class="cbb clearfix settings">
- <h2 class="title">Mudar Perfil</h2>
- <div class="box-content">
- <form action="profile/2" method="post">
- <input type="hidden" name="tab" value="2" />
- <input type="hidden" name="__app_key" value="HoloCMS" />
- <?php
- if(!empty($result)){
- if($error == "1"){
- echo "<div class='rounded rounded-red'>";
- } else {
- echo "<div class='rounded rounded-green'>";
- }
- echo $result . "<br />
- </div><br />";
- }
- $user_sql = mysql_query("SELECT * FROM users WHERE id = '".$my_id."'");
- $user_row = mysql_fetch_assoc($user_sql);
- ?>
- <h3><?php echo $shortname; ?> Home</h3>
- <p>
- Quem verá sua <?php echo $shortname; ?> home?<br>
- <label><input name="visibility" value="EVERYONE" <?php if($user_row['visibility'] == "EVERYONE"){ ?>checked="checked" <?php } ?>type="radio">Todos</label>
- <label><input name="visibility" value="FRIENDS" <?php if($user_row['visibility'] == "FRIENDS"){ ?>checked="checked" <?php } ?>type="radio">Meus amigos</label>
- <label><input name="visibility" value="NOBODY" <?php if($user_row['visibility'] == "NOBODY"){ ?>checked="checked" <?php } ?>type="radio">Ninguém</label>
- </p>
- <h3>Pedidos de amizade</h3>
- <p>
- <label>
- <input name="block_newfriends" <?php if($user_row['block_newfriends'] == 0){ ?>checked="checked"<?php } ?> value="true" type="checkbox">
- Pedidos de amizade ativado
- </label></p>
- <h3>Online Status</h3>
- <p>
- <label>
- <input name="hide_online" <?php if($user_row['hide_online'] == 0){ ?>checked="checked"<?php } ?> value="true" type="checkbox">
- Todos podem me ver online
- </label></p>
- <h3>Preferências "Siga-me"</h3>
- <p>
- <label>
- <input name="hide_inroom" <?php if($user_row['hide_inroom'] == 0){ ?>checked="checked"<?php } ?> value="true" type="checkbox">
- Todos podem me seguir
- </label></p>
- <div class="settings-buttons">
- <input type="submit" value="Salvar" name="save" class="submit" />
- </div>
- </form>
- </div></div>
- </div>
- <?php } else if($tab == "3"){ ?>
- </div>
- </div>
- </div>
- <?php } else if($tab == "4"){ ?>
- <div class="habblet-container " style="float:left; width: 560px;">
- <div class="cbb clearfix settings">
- <h2 class="title">Mudar senha</h2>
- <div class="box-content">
- <?php
- if(!empty($result)){
- if($error == "1"){
- echo "<div class='rounded rounded-red'>";
- } else {
- echo "<div class='rounded rounded-green'>";
- }
- echo "".$result."<br />
- </div><br />";
- }
- ?>
- <form action="profile/4" method="post" id="passwordform">
- <input type="hidden" name="tab" value="4" />
- <input type="hidden" name="__app_key" value="HoloCMS" />
- <div class="settings-step">
- <p>
- <label for="currentpassword">Senha atual</label><br />
- <input type="password" size="32" maxlength="32" name="password" id="currentpassword" class="currentpassword " />
- </p>
- <div>
- </div>
- </div>
- <div class="settings-step">
- <p>
- <label for="pass">Nova senha</label><br />
- <input type="password" name="pass" id="password" size="32" maxlength="48" value="" />
- </p>
- <p>
- <label for="confpass">Re-digite a nova senha</label><br/>
- <input type="password" name="confpass" id="password" size="32" maxlength="48" value="" />
- </p>
- </div>
- </div>
- <div class="settings-buttons">
- <input type="submit" value="Mudar senha" name="save" class="submit" />
- </div>
- </form>
- </div></div></div></div>
- </div>
- </div>
- <script type="text/javascript">
- 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");
- 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\>");
- 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\>");
- new FriendManagement({ currentCategoryId: 0, pageListLimit: 30, pageNumber: 1});
- </script>
- </div>
- </div>
- <?php } else { header("location: ".$path.""); exit; } require_once('./templates/community_footer.php'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement