I'm looking to somehow add a "token" on login and temperately store it in the database (same as table *_users) until next login (important).

I have a game of sorts that uses a selected user and password from a table in the database. The game only reads usernames and passwords containing 0-9 and a-z (both cases), since bcrypt is used to generate a password it contains "invalid characters" for the game. It also displays the user and password in the url. So I'm hoping to add an extra layer of security (two birds, one stone maybe?) to read the "token" as the "password".
Since the site revolves around this game, its holding me back from creating a site using Joomla or anything CMS that uses bcrypt. Since bcrypt is secure I would still like to use that encryption for the passwords, rather than md5 or sha. I would like to use Joomla as its the CMS I'm most familiar with.

I'm not sure if there is a plugin that could achieve what I'm trying to do, however I'm willing to edit the core files if someone could instruct me.

1 Answer 1


You can achieve this with a User plugin that triggers that triggers onUserLogin or onUserAfterLogin.

See: https://docs.joomla.org/Plugin/Events/User

I would suggest creating a new table (such as #__users_game) as opposed to modifying #__users. You can have the table be created when the plugin is installed. It would only need two columns, id_users (foreign key to the #__users id row) and token (your token).

To achieve the "until next login" feature you can do it a number of ways. One would be to only have a row in that table for active players so if a user logs in and a row for them already exists then you delete the row and the game is over for them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.