Tiny Phoenix Addon - Help prevent scammers

Status
Not open for further replies.
xHosts.uk - Windows & Linux VPS - Cosmic Guard
Decennium
Joined
Sep 10, 2011
Messages
858
Reaction score
357
Hey

Its been mentioned to me many times, that people scam on hotels then use "flagme" to change name and hard for hotel owners to trace the scammers because they have changed the user names,

I came up with this idea only a small idea but may help some people in the community


Database

CREATE TABLE IF NOT EXISTS `flagme_logs` (
`old_username` varchar(100) DEFAULT NULL,
`new_username` varchar(100) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`time` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

In your class258 / ChangeUserNameMessageEvent.cs

Under this :


class3.ExecuteQuery(string.Concat(new object[]
{
"UPDATE users SET username = '",
text,
"' WHERE id = '",
Session.GetHabbo().Id,
"' LIMIT 1"
}));

Add this

using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
{
@class.AddParamWithValue("old_username", Session.GetHabbo().Username);
@class.AddParamWithValue("new_username", text);
@class.AddParamWithValue("user_id", Session.GetHabbo().Id);


@class.ExecuteQuery("INSERT INTO flagme_logs SET old_username = @old_username, new_username = @new_username, user_id = @user_id");

}

Now each time a user uses flagme, the old name, new name and most importantly the users ID is stored with the date and time on which they change username.
 
Erm as far as I know if you use :flagme command for phoenix it is stored in cmdlogs table?

Yes this is a little more informed for people having its own table they can add the feature into HK for staff to look this up.
 
Yes this is a little more informed for people having its own table they can add the feature into HK for staff to look this up.
cmdlogs and for HK you can code something like SELECT * FROM cmdlogs WHERE command = 'flagme'
 
Something useful from G0D. Thanks for this!

Greetz,
 
If you had a properly set up database with all the relations and constraints properly implemented, you wouldn't have any problem with people changing their username.

Also rooms should've been identified by the user id instead of the username as the user id should not change. Yes I know they did use the username for caching but this is certainly not how a proper database should've been implemented.
 
If you had a properly set up database with all the relations and constraints properly implemented, you wouldn't have any problem with people changing their username.

Also rooms should've been identified by the user id instead of the username as the user id should not change. Yes I know they did use the username for caching but this is certainly not how a proper database should've been implemented.

It was a simple addon as people I host have asked me for a way log the name changes, I thought of this method as people can easy add a page to housekeeping so that people who do not have direct server access can still view the information if at the time owners are offline.
 
Also make sure to filter the variable 'text'. Either use regex ([a-zA-Z0-9]) to filter it or use the prepared statements as they are more secure. ^.^

I am sure the values are ready filtered as they are all ready included within the orginal phoenix, i simply added the method to save them to a table.
 
Status
Not open for further replies.
Back