I can access a disa...
 
Notifications
Clear all

I can access a disabled account via Steam

8 Posts
3 Users
0 Reactions
901 Views
(@tommih)
Posts: 44
Trusted Member
Topic starter
 

Hello.

It seems to be possible to sidestep a disabled account by logging in via Steam.

We link our Steam users to their pre-existing Combu accounts by calling CombuManager.localUser.LinkPlatform. Then later we authenticate them by calling CombuManager.localUser.AuthenticatePlatform with their Steam user ID. That login appears to succeed even if the linked account has been disabled on the Combu server. The disabling works as expected if you log in normally via CombuManager.platform.Authenticate.

Any idea why this might be happening?

Best regards,

Tommi Horttana

 
Posted : 13/06/2016 2:19 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Yes, edit /users.php at line 157 add the following code:

if (!$user->Enabled) {
   $message = "Your account is disabled";
} else {
   $success = TRUE;
   // ... rest of "if ($user != NULL)" content
}

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 13/06/2016 3:55 pm
(@gecko64)
Posts: 82
Estimable Member
 

Thanks for the quick help with that. I think we may have edited the users.php file, so the line numbers may not match. Here's what we have, starting on line 153. Where should we insert this new code?

 

} else {
$message = "No Platform Key and/or Id provided";
}
if ($user != NULL) {
$success = TRUE;
if (SECURITY_ENABLED && $timestamp) {
$user->UpdateSignature($timestamp);
}
if ($user->ActivationCode) {
$message = "You must activate your account by following the link in the email";
$success = FALSE;
} else {

 
Posted : 13/06/2016 6:47 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

My code should be right after "if ($user != NULL) {", the current code "$success = TRUE;" and after should be inside my new "else".

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 13/06/2016 6:55 pm
(@gecko64)
Posts: 82
Estimable Member
 

Thanks...but I'm not sure if I quite understood exactly would to do. Would you mind showing me the entire updated code block (adding yours to what I posted)? 

 
Posted : 13/06/2016 7:26 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 
    if ($user != NULL) {
        if (!$user->Enabled) {
            $message = "Your account is disabled";
        } else {
            $success = TRUE;
            if (SECURITY_ENABLED && $timestamp) {
                $user->UpdateSignature($timestamp);
            }
            if ($user->ActivationCode) {
                $message = "You must activate your account by following the link in the email";
                $success = FALSE;
            } else {

                /*
                 * Sample code to add starting equipment on player registration
                 */
                /*
                if ($justCreated) {
                    $startItems = array(
                        array( "name" => "item1", "quantity" => 1 ),
                        array( "name" => "item2", "quantity" => 1 )
                    );
                    foreach ($startItems as $itemData) {
                        $newItem = new CB_Inventory();
                        $newItem->IdAccount = $user->Id;
                        $newItem->Name = $itemData["name"];
                        $newItem->Quantity = $itemData["quantity"];
                        $newItem->Save();
                    }
                }
                */

                CB_Account::SetSession($user);
                // Add the registered platforms for the logged user as result
                $userArray = $user->ToArrayFiltered();
                $message = json_encode($userArray);
            }
        }
    } else {
        $message = "Cannot get the account";
    }
    Utils::EchoJson( Utils::JsonEncodeSuccessMessage($success, $message) );

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 13/06/2016 10:04 pm
(@gecko64)
Posts: 82
Estimable Member
 

 Finally testing this, but it doesn't work -- so far testing with an enabled account, but auto-login fails, with error:

Sending:  http://wolfquest.org/combu/users.php?action=login_platform&PlatformKey=Steam&PlatformId=76561198261120908&sig_time=636020173931987280&sig_crc=9d5420caaa503cc5f8c40d05250b187fd4c09b65

(Filename: /Users/builduser/buildslave/unity/build/artifacts/MacStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)

Lexicon last updated: 12/07/2015 17:14:34

(Filename: /Users/builduser/buildslave/unity/build/artifacts/MacStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)

<br />
<b>Parse error</b>: syntax error, unexpected '{' in <b>/home/wolfques/public_html/combu/users.php</b> on line <b>156</b><br />

 

____

Line 156 is 

    if ($user != NULL) {

 

So then I reverted and kept the originan line 156, and pasted your code in started on the next line, but then I get another error in the console:

 

<br />
<b>Parse error</b>: syntax error, unexpected '{' in <b>/home/wolfques/public_html/combu/users.php</b> on line <b>157</b><br />

 

 

I'll email the full script to you, hopefully you can spot the problem?

 

thanks

Dave

 
Posted : 20/06/2016 8:10 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

There is some UTF-8 chars in your file, may be you used an editor that didn't clear the code when you pasted it. I'm sending my local file that is correct (if you did some changes for your own app/game you will have to re-apply there).

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 20/06/2016 8:26 pm
Share: