Account settings does not save

Results 1 to 11 of 11
  1. #1
    Apprentice FirePowerZZZ is offline
    MemberRank
    May 2014 Join Date
    6Posts

    sad Account settings does not save

    Hello everyone,

    I have a problem with all the revcmses. I can't change my account settings, it does not change in the database. I'm using Xampp 1.7.3.

    Sorry for my bad English.

    Thanks


  2. #2
    Mr VPS - Cheap VPS Server NOC is offline
    MemberRank
    Sep 2011 Join Date
    Liverpool, UKLocation
    844Posts

    Re: Account settings does not save

    have you put on php error reporting to see if you get any errors for a reason it will not save ?

  3. #3
    Apprentice FirePowerZZZ is offline
    MemberRank
    May 2014 Join Date
    6Posts

    Re: Account settings does not save

    Yes, error reporting is turned on, but I don't see any errors.

  4. #4
    www.Epic Hosts.co.uk Terrum is offline
    MemberRank
    Jun 2008 Join Date
    EpicHosts,co.ukLocation
    1,322Posts

    Re: Account settings does not save

    Which CMS release/edit are you using? Is it confirmed to actually work properly with XAMPP? You might want to turn a server-side PHP debugger on or something to try evaluate the error.

  5. #5
    Apprentice FirePowerZZZ is offline
    MemberRank
    May 2014 Join Date
    6Posts

    Re: Account settings does not save

    I'm using a lot of edits, but all of them does not works. I'ts all confirmed to work with Xampp. People are saying to use another Xampp version but it don't works.

    If you can help me, that will be nice.

    #Badenglish

  6. #6
    Apprentice Cekon is offline
    MemberRank
    Jan 2014 Join Date
    6Posts

    Re: Account settings does not save

    Try using a fresh RevCMS. The account settings is handled in class.users.php, not in the skin it self. (In some edits it might)

  7. #7
    Apprentice FirePowerZZZ is offline
    MemberRank
    May 2014 Join Date
    6Posts

    Re: Account settings does not save

    I'ts fresh. A dutch edit from the original CMS with 2 500 downloads.

  8. #8
    Apprentice Cekon is offline
    MemberRank
    Jan 2014 Join Date
    6Posts

    Re: Account settings does not save

    Im talking about the original revcms. Install it to be sure that It's not your edits It's wrong with

  9. #9
    Apprentice FirePowerZZZ is offline
    MemberRank
    May 2014 Join Date
    6Posts

    Re: Account settings does not save

    Here is the class.users.php

    Spoiler:
    <?php

    namespace Revolution;
    if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
    class users implements iUsers
    {

    /*-------------------------------Authenticate-------------------------------------*/

    final public function isLogged()
    {
    if(isset($_SESSION['user']['id']))
    {
    return true;
    }

    return false;
    }

    /*-------------------------------Checking of submitted data-------------------------------------*/

    final public function validName($username)
    {
    if(strlen($username) <= 25 && ctype_alnum($username))
    {
    return true;
    }

    return false;
    }

    final public function validEmail($email)
    {
    return preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $email);
    }

    final public function validSecKey($seckey)
    {
    if(is_numeric($seckey) && strlen($seckey) == 4)
    {
    return true;
    }

    return false;
    }

    final public function nameTaken($username)
    {
    global $engine;

    if($engine->num_rows("SELECT * FROM users WHERE username = '" . $username . "' LIMIT 1") > 0)
    {
    return true;
    }

    return false;
    }

    final public function emailTaken($email)
    {
    global $engine;

    if($engine->num_rows("SELECT * FROM users WHERE mail = '" . $email . "' LIMIT 1") > 0)
    {
    return true;
    }

    return false;
    }

    final public function userValidation($username, $password)
    {
    global $engine;
    if($engine->num_rows("SELECT * FROM users WHERE username = '" . $username . "' AND password = '" . $password . "' LIMIT 1") > 0)
    {
    return true;
    }

    return false;
    }

    /*-------------------------------Stuff related to bans-------------------------------------*/

    final public function isBanned($value)
    {
    global $engine;
    if($engine->num_rows("SELECT * FROM bans WHERE value = '" . $value . "' LIMIT 1") > 0)
    {
    return true;
    }

    return false;
    }

    final public function getReason($value)
    {
    global $engine;
    return $engine->result("SELECT reason FROM bans WHERE value = '" . $value . "' LIMIT 1");
    }

    final public function hasClones($ip)
    {
    global $engine;
    if($engine->num_rows("SELECT * FROM users WHERE ip_reg = '" . $_SERVER['REMOTE_ADDR'] . "'") == 1)
    {
    return true;
    }

    return false;
    }

    /*-------------------------------Login or Register user-------------------------------------*/

    final public function register()
    {
    global $core, $template, $_CONFIG;

    if(isset($_POST['register']))
    {
    unset($template->form->error);

    $template->form->setData();

    if($this->validName($template->form->reg_username))
    {
    if(!$this->nameTaken($template->form->reg_username))
    {
    if($this->validEmail($template->form->reg_email))
    {
    if(!$this->emailTaken($template->form->reg_email))
    {
    if(strlen($template->form->reg_password) > 6)
    {
    if($template->form->reg_password == $template->form->reg_rep_password)
    {
    if(isset($template->form->reg_seckey))
    {
    if($this->validSecKey($template->form->reg_seckey))
    {
    //Continue
    }
    else
    {
    $template->form->error = 'Secret key must only have 4 numbers';
    return;
    }
    }
    if($this->isBanned($_SERVER['REMOTE_ADDR']) == false)
    {
    if(!$this->hasClones($_SERVER['REMOTE_ADDR']))
    {
    if(!isset($template->form->reg_gender)) { $template->form->reg_gender = 'M'; }
    if(!isset($template->form->reg_figure)) { $template->form->reg_figure = $_CONFIG['hotel']['figure']; }

    $this->addUser($template->form->reg_username, $core->hashed($template->form->reg_password), $template->form->reg_email, $_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1, $template->form->reg_figure, $template->form->reg_gender, $core->hashed($template->form->reg_key));

    $this->turnOn($template->form->reg_username);

    header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
    exit;
    }
    else
    {
    $template->form->error = 'Sorry, but you cannot register twice';
    }
    }
    else
    {
    $template->form->error = 'Sorry, it appears you are IP banned.<br />';
    $template->form->error .= 'Reason: ' . $this->getReason($_SERVER['REMOTE_ADDR']);
    return;
    }
    }
    else
    {
    $template->form->error = 'Password does not match repeated password';
    return;
    }


    }
    else
    {
    $template->form->error = 'Password must have more than 6 characters';
    return;
    }
    }
    else
    {
    $template->form->error = 'Email: <b>' . $template->form->reg_email . '</b> is already registered';
    return;
    }
    }
    else
    {
    $template->form->error = 'Email is not valid';
    return;
    }
    }
    else
    {
    $template->form->error = 'Username is already registered';
    return;
    }
    }
    else
    {
    $template->form->error = 'Username is invalid';
    return;
    }
    }
    }

    final public function login()
    {
    global $template, $_CONFIG, $core;

    if(isset($_POST['login']))
    {
    $template->form->setData();
    unset($template->form->error);

    if($this->nameTaken($template->form->log_username))
    {
    if($this->isBanned($template->form->log_username) == false || $this->isBanned($_SERVER['REMOTE_ADDR']) == false)
    {
    if($this->userValidation($template->form->log_username, $core->hashed($template->form->log_password)))
    {
    $this->turnOn($template->form->log_username);
    $this->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']);
    $template->form->unsetData();
    header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
    exit;
    }
    else
    {
    $template->form->error = 'Wachtwoord klopt niet!';
    return;
    }
    }
    else
    {
    $template->form->error = 'Je bent verbannen!<br />';
    $template->form->error .= 'Reden: ' . $this->getReason($template->form->log_username);
    return;
    }
    }
    else
    {
    $template->form->error = 'Je naam bestaat niet!';
    return;
    }
    }
    }

    final public function loginHK()
    {
    global $template, $_CONFIG, $core;

    if(isset($_POST['login']))
    {
    $template->form->setData();
    unset($template->form->error);

    if(isset($template->form->username) && isset($template->form->password))
    {
    if($this->nameTaken($template->form->username))
    {
    if($this->userValidation($template->form->username, $core->hashed($template->form->password)))
    {
    if(($this->getInfo($_SESSION['user']['id'], 'rank')) >= 4)
    {
    $_SESSION["in_hk"] = true;
    header("Location:".$_CONFIG['hotel']['url']."/ase/dash");
    exit;
    }
    else
    {
    $template->form->error = 'Je rang is te laag!';
    return;
    }
    }
    else
    {
    $template->form->error = 'Fout wachtwoord.';
    return;
    }
    }
    else
    {
    $template->form->error = 'Naam bestaat niet.';
    return;
    }
    }

    $template->form->unsetData();
    }
    }

    final public function help()
    {
    global $template, $_CONFIG;
    $template->form->setData();

    if(isset($template->form->help))
    {
    $to = $_CONFIG['hotel']['email'];
    $subject = "Help from RevCMS user - " . $this->getInfo($_SESSION['user']['id'], 'username');
    $body = $template->form->question;

    if (mail($to, $subject, $body))
    {
    $template->form->error = 'Message successfully sent! We will answer you shortly!';
    }
    else
    {
    $template->form->error = 'Message delivery failed.';
    }
    }
    }


    /*-------------------------------Account settings-------------------------------------*/

    final public function updateAccount()
    {
    global $template, $_CONFIG, $core, $engine;

    if(isset($_POST['account']))
    {

    if(isset($_POST['acc_motto']) && strlen($_POST['acc_motto']) < 30 && $_POST['acc_motto'] != $this->getInfo($_SESSION['user']['id'], 'motto'))
    {
    $this->updateUser($_SESSION['user']['id'], 'motto', $engine->secure($_POST['acc_motto']));
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
    exit;
    }
    else
    {
    $template->form->error = 'Motto is fout.';
    }

    if(isset($_POST['acc_email']) && $_POST['acc_email'] != $this->getInfo($_SESSION['user']['id'], 'mail'))
    {
    if($this->validEmail($_POST['acc_email']))
    {
    $this->updateUser($_SESSION['user']['id'], 'mail', $engine->secure($_POST['acc_email']));
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
    exit;
    }
    else
    {
    $template->form->error = 'Email is fout';
    return;
    }
    }

    if(!empty($_POST['acc_old_password']) && !empty($_POST['acc_new_password']))
    {
    if($this->userValidation($this->getInfo($_SESSION['user']['id'], 'username'), $core->hashed($_POST['acc_old_password'])))
    {
    if(strlen($_POST['acc_new_password']) >= 8)
    {
    $this->updateUser($_SESSION['user']['id'], 'password', $core->hashed($_POST['acc_new_password']));
    header('Location: '.$_CONFIG['hotel']['url'].'/me');
    exit;
    }
    else
    {
    $template->form->error = 'Wachtwoord is te kort!';
    return;
    }
    }
    else
    {
    $template->form->error = 'Fout wachwoord ingevoerd!';
    return;
    }
    }
    }
    }


    final public function turnOn($k)
    {
    $j = $this->getID($k);
    $this->createSSO($j);
    $_SESSION['user']['id'] = $j;
    $this->cacheUser($j);
    unset($j);
    }

    /*-------------------------------Loggin forgotten-------------------------------------*/

    final public function forgotten()
    {
    global $template, $_CONFIG, $core;

    if(isset($_POST['forgot']))
    {

    $template->form->setData();
    unset($template->form->error);

    if($this->nameTaken($template->form->for_username))
    {
    if(strlen($template->form->for_password) > 6)
    {
    if($this->getInfo($this->getID($template->form->for_username), 'seckey') == $core->hashed($template->form->for_key))
    {
    $this->updateUser($this->getID($template->form->for_username), 'password', $core->hashed($template->form->for_password));
    $template->form->error = 'Account recovered! Go <b><a href="index">here</a></b> to login!';
    return;
    }
    else
    {
    $template->form->error = 'Secret key is incorrect';
    return;
    }
    }
    else
    {
    $template->form->error = 'Password must have more than 6 characters.';
    return;
    }
    }
    else
    {
    $template->form->error = 'Username does not exist';
    return;
    }
    }
    }

    /*-------------------------------Create SSO auth_ticket-------------------------------------*/

    final public function createSSO($k)
    {
    $sessionKey = 'FHD-ROCKT-'.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33);

    $this->updateUser($k, 'auth_ticket', $sessionKey);

    unset($sessionKey);
    }

    /*-------------------------------Adding/Updating/Deleting users-------------------------------------*/

    final public function addUser($username, $password, $email, $motto, $credits, $pixels, $rank, $figure, $gender, $seckey)
    {
    global $engine;
    $sessionKey = 'FHD-ROCKT-'.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33);
    $engine->query("INSERT INTO users (username, password, mail, motto, credits, activity_points, rank, look, gender, seckey, ip_last, ip_reg, account_created, last_online, auth_ticket) VALUES('" . $username . "', '" . $password . "', '" . $email . "', '" . $motto . "', '" . $credits . "', '" . $pixels . "', '" . $rank . "', '" . $figure . "', '" . $gender . "', '" . $seckey . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . time() . "', '" . time() . "', '" . $sessionKey . "')");
    unset($sessionKey);

    }

    final public function deleteUser($k)
    {
    global $engine;
    $engine->query("DELETE FROM users WHERE id = '" . $k . "' LIMIT 1");
    $engine->query("DELETE FROM items WHERE userid = '" . $k . "' LIMIT 1");
    $engine->query("DELETE FROM rooms WHERE ownerid = '" . $k . "' LIMIT 1");
    }

    final public function updateUser($k, $key, $value)
    {
    global $engine;
    $engine->query("UPDATE users SET " . $key . " = '" . $engine->secure($value) . "' WHERE id = '" . $k . "' LIMIT 1");
    $_SESSION['user'][$key] = $engine->secure($value);
    }

    /*-------------------------------Handling user information-------------------------------------*/

    final public function cacheUser($k)
    {
    global $engine;
    $userInfo = $engine->fetch_assoc("SELECT username, rank, motto, mail, credits, activity_points, look, auth_ticket, ip_last FROM users WHERE id = '" . $k . "' LIMIT 1");

    foreach($userInfo as $key => $value)
    {
    $this->setInfo($key, $value);
    }
    }

    final public function setInfo($key, $value)
    {
    global $engine;
    $_SESSION['user'][$key] = $engine->secure($value);
    }


    final public function getInfo($k, $key)
    {
    global $engine;
    if(!isset($_SESSION['user'][$key]))
    {
    $value = $engine->result("SELECT $key FROM users WHERE id = '" . $engine->secure($k) . "' LIMIT 1");
    if($value != null)
    {
    $this->setInfo($key, $value);
    }
    }

    return $_SESSION['user'][$key];
    }



    /*-------------------------------Get user ID or Username-------------------------------------*/

    final public function getID($k)
    {
    global $engine;
    return $engine->result("SELECT id FROM users WHERE username = '" . $engine->secure($k) . "' LIMIT 1");
    }

    final public function getUsername($k)
    {
    global $engine;
    return $this->getInfo($_SESSION['user']['id'], 'username');
    }

    }
    ?>

  10. #10
    Apprentice Cekon is offline
    MemberRank
    Jan 2014 Join Date
    6Posts

    Re: Account settings does not save

    Could you post the account settings page aswell?

  11. #11
    Apprentice FirePowerZZZ is offline
    MemberRank
    May 2014 Join Date
    6Posts

    Re: Account settings does not save

    Here it is:

    Spoiler:
    <?php /* _ _ _______ ______ ______ _____ ______ _______ _ _
    |_____| |_____| |_____] |_____] | | |_____/ |______ \ / HabboREV 'The new way of using RevCMS'
    | | | | |_____] |_____] |_____| | \_ |______ \/ Thanks for downloading, xoxo FHD
    */
    ?><!DOCTYPE html>
    <html lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>{hotelName} - Home</title>

    <link rel="stylesheet" href="web-gallery/static/styles/common.css" type="text/css">
    <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs2.js"></script>
    <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/visual.js"></script>
    <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs.js"></script>
    <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/common.js"></script>
    <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/fullcontent.js"></script>

    <script type="text/javascript">
    document.habboLoggedIn = true;
    var habboName = "{username}";
    var habboId = {userid};
    var habboReqPath = "";
    var habboStaticFilePath = "{url}/app/tpl/skins/Habbo";
    var habboImagerUrl = "http://www.habbo.com/habbo-imaging/";
    var habboPartner = "";
    var habboDefaultClientPopupUrl = "{url}/client";
    window.name = "habboMain";
    if (typeof HabboClient != "undefined") {
    HabboClient.windowName = "eac955c8dbc88172421193892a3e98fc7402021a";
    HabboClient.maximizeWindow = true;
    }
    </script>

    <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/settings.js"></script>
    <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/settings.css" type="text/css">

    <!--[if IE 8]>
    <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie8.css" type="text/css">
    <![endif]-->
    <!--[if lt IE 8]>
    <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie.css" type="text/css" />
    <![endif]-->
    <!--[if lt IE 7]>
    <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie6.css" type="text/css" />
    <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/pngfix.js"></script>
    <script type="text/javascript">
    try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
    </script>
    <style type="text/css">
    body { behavior: url({url}/app/tpl/skins/Habbo/js/csshover.htc); }
    </style>
    <![endif]-->
    </head>

    <body id="profile">

    <div id="overlay"></div>
    <div id="header-container">
    <div id="header" class="clearfix">
    <h1><a href="{url}/"></a></h1>




    <div id="subnavi" class=wide>
    <div id="subnavi-search">
    <div id="subnavi-search-upper">
    <ul id="subnavi-search-links">
    <li>{housekeeping}</li>
    <li><a href="https://help.habbo.nl/home" target="habbohelp" >Help</a></li>
    <li>
    <form action="/logout" method="post">
    <button type="submit" id="signout" class="link"><span>Log out</span></button>
    </form>
    </li>
    </ul>
    </div>
    </div>
    <div id="to-hotel">
    <a href="/client" class="new-button green-button" target="d954311fd8d9ce16fc0fd512dff02d550ddc667b" onclick="HabboClient.openOrFocus(this); return false;"><b>Enter {hotelname}</b><i></i></a>
    </div>
    </div>
    <script type="text/javascript">
    L10N.put("purchase.group.title", "Maak/koop een Groep");
    document.observe("dom:loaded", function() {
    $("signout").observe("click", function() {
    HabboClient.close();
    });
    });
    </script><ul id="navi">
    <li class="metab selected">
    <strong>
    {username} (&nbsp;<i style="background-image: url(/web-gallery/v2/images/rpx/icon_habbo_small.png)">&nbsp;</i>)
    </strong>
    <span></span>
    </li>
    <li>
    <a href="/community">Community</a>
    <span></span>
    </li>
    <li>
    <a href="/safety">Safety</a>
    <span></span>
    </li>
    <li>
    <a href="/credits">Buy credits</a>
    <span></span>
    </li>
    </ul>


    <div id="habbos-online"><div class="rounded"><span>{online} {hotelname}'s online</span></div></div>
    </div>
    </div>
    </div>
    <div id="content-container">
    <div id="navi2-container" class="pngbg">
    <div id="navi2" class="pngbg clearfix">
    <ul>
    <li class=" "><a href="{url}/me">Home</a></li>
    <li class=""><a href="/home">My page</a></li>
    <li class=" selected last">Account Settings</li>
    </ul>
    </div>
    </div>
    <div id="container">
    <div id="content" style="position: relative" class="clearfix">
    <div>
    <div class="content">
    <div class="habblet-container" style="float:left; width:210px;">
    <div class="cbb settings">
    <h2 class="title">Account settings</h2>
    <div class="box-content">
    <div id="settingsNavigation">
    <ul>
    <li class="selected">Mijn preferences</li>
    </ul>
    </div>
    </div>
    </div><!--
    <div class="cbb habboclub-tryout">
    <h2 class="title">Info over de CMS </h2>
    <div class="box-content">
    <div class="habboclub-banner-container habboclub-clothes-banner"></div>
    <p class="habboclub-header">Deze site draait op:<br> - RevCMS<br><br>- Habbo V2<br><br>- <b><font color="darkred">Coded by FHD</font></b></p>
    <p class="habboclub-link"><a target="_blank" href="http://finleyhd.nl/projecten.php">Download de CMS &raquo;</a></p>
    </div>
    </div> -->
    </div>
    <div class="habblet-container " style="float:left; width: 560px;">
    <div class="cbb clearfix settings">
    <h2 class="title">Change your settings</h2>
    <div class="box-content">
    <form method="post" id="profileForm">
    <h3>Your slogan</h3>
    <p><label>Motto:<input type="text" name="acc_motto" size="32" maxlength="32" value="{motto}" id="avatarmotto"></label></p>
    <h3>Your Email Adres:</h3>
    <p><label>Email:<input type="text" name="acc_email" size="32" value="{email}" id="avatarmotto"></p>
    <h3>Your password</h3>
    <p><label>Old password:<input type="password" name="acc_old_password" value="" id="avatarmotto"></p>
    <p><label>New password:<input type="password" name="acc_new_password" value="" id="avatarmotto"></p>
    <div class="settings-buttons">
    <input type="submit" value="Opslaan" name="account" class="submit" style="float:right">
    </div>
    </form>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <script type="text/javascript">
    document.observe('dom:loaded', function() {
    CurrentRoomEvents.init();
    });
    </script>
    </div>
    <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
    <script type="text/javascript">
    HabboView.run();
    </script>
    <!--[if lt IE 7]>
    <script type="text/javascript">
    Pngfix.doPngImageFix();
    </script>
    <![endif]-->
    </div>

    <?php include ('/inc/footer.php'); ?>

    </body>
    </html>



Advertisement