[UberCMS] Clienf Forward

Results 1 to 6 of 6
  1. #1
    Valued Member cuperus is offline
    MemberRank
    Aug 2009 Join Date
    108Posts

    [UberCMS] Clienf Forward

    Hello,

    For the peapol who wants to forward there rooms on the client, i did make some script.
    Idea comes from LucasReis

    Edit the first line on generic-top.tpl to:
    PHP Code:
    <body onunload="location.href='client_close.php'" id="%body_id%" class="<?php if (!LOGGED_IN) { echo 'anonymous'; } ?> ">
    Make a client_close.php file and add this on it:
    PHP Code:
    <?php
    /*=======================================================================
    | UberCMS - Advanced Website and Content Management System for uberEmu
    | #######################################################################
    | Copyright (c) 2010, Roy 'Meth0d' and updates by Matthew 'MDK'
    | http://www.meth0d.org & http://www.sulake.biz
    | #######################################################################
    | This program is free software: you can redistribute it and/or modify
    | it under the terms of the GNU General Public License as published by
    | the Free Software Foundation, either version 3 of the License, or
    | (at your option) any later version.
    | #######################################################################
    | This program is distributed in the hope that it will be useful,
    | but WITHOUT ANY WARRANTY; without even the implied warranty of
    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    | GNU General Public License for more details.
    \======================================================================*/

    define('HIDE_FEEDBACK'true);

    require_once 
    "global.php";
    require_once 
    "inc/class.rooms.php";

    if (!
    LOGGED_IN)
    {
        
    header("Location: " WWW"/login_popup");
        exit;
    }

    dbquery("UPDATE users SET home_room = '48' WHERE id = '" USER_ID "' LIMIT 1");

    ?>
    goto client.php and add under
    PHP Code:
    require_once "global.php";
    require_once 
    "inc/class.rooms.php";

    if (!
    LOGGED_IN)
    {
        
    header("Location: " WWW"/login_popup");
        exit;

    this
    PHP Code:
    error_reporting('0');
    dbquery("UPDATE users SET home_room = '' WHERE id = '" USER_ID "' LIMIT 1"); 


    and add under:
    PHP Code:
    if ($users->getUserVar(USER_ID'newbie_status') == "0")
    {
        if (isset(
    $_GET['createRoom']) && is_numeric($_GET['createRoom']))
        {
            
    $roomId RoomManager::CreateRoom(USER_NAME "'s room"USER_NAME'model_s');

            switch (
    intval($_GET['createRoom']))
            {
                default:
                case 
    0:
                
                    
    RoomManager::PaintRoom($roomId'1701''601');
                    break;
                    
                case 
    1:
                
                    
    RoomManager::PaintRoom($roomId'607''111');
                    break;
                    
                case 
    2:
                
                    
    RoomManager::PaintRoom($roomId'1901''301');
                    break;
                    
                case 
    3:
                
                    
    RoomManager::PaintRoom($roomId'1801''110');
                    break;
                    
                case 
    4:
                
                    
    RoomManager::PaintRoom($roomId'503''104');
                    break;
                    
                case 
    5:
                
                    
    RoomManager::PaintRoom($roomId'804''107');
                    break;
            }
        }
        else
        {
            
    header("Location: " WWW "/client?createRoom=" rand(05));
            exit;
        }

    this
    PHP Code:
    if ($_GET['roomId'] == "")
    {

    } else {
    dbquery("UPDATE users SET home_room = '$_GET[roomId]' WHERE id = '" USER_ID "' LIMIT 1");


    Like it? Press the like button!
    Credits To:
    Me 90% (for coding)
    LucasReis 10% (for idea)
    Last edited by cuperus; 26-06-11 at 01:46 PM.


  2. #2
    Apprentice CHGFbPage is offline
    MemberRank
    May 2011 Join Date
    14Posts

    Re: [UberCMS] Clienf Forward

    Oh Nice, ill try this out. Thanks :D
    Posted via Mobile Device

  3. #3
    Valued Member cuperus is offline
    MemberRank
    Aug 2009 Join Date
    108Posts

    Re: [UberCMS] Clienf Forward

    Quote Originally Posted by CHGFbPage View Post
    Oh Nice, ill try this out. Thanks :D
    Posted via Mobile Device
    Your welcome

  4. #4
    No, Just no. Matthew is offline
    MemberRank
    Jul 2008 Join Date
    United KingdomLocation
    1,408Posts

    Re: [UberCMS] Clienf Forward

    Possible SQL injection noticed. The get is not filtered in anyway therefore is a potential exploit. One could do:

    PHP Code:
    if ($_GET['roomId'] == "'0', SET rank = '7'"
    Client side:

    PHP Code:
    http://hotelurl.com/client?roomId=,SET rank = '7' 
    Fix:

    (NOT TESTED)

    PHP Code:
    if ($_GET['roomId'] == "")
    $roomId filter($_GET['roomId']); 


    } else { 
    dbquery("UPDATE users SET home_room = '".$roomId."' WHERE id = '" USER_ID "' LIMIT 1"); 


  5. #5
    Member RageStefan is offline
    MemberRank
    Jun 2011 Join Date
    The NetherlandsLocation
    63Posts

    Re: [UberCMS] Clienf Forward

    awesome !
    tnx alot man !

  6. #6
    Account Upgraded | Title Enabled! LucasReis is offline
    MemberRank
    Jun 2009 Join Date
    Sorocaba, BraziLocation
    206Posts

    Re: [UberCMS] Clienf Forward

    where is my credits?



Advertisement