Ulysses Stuff > Releases

ULib MySQLOO Authentication

(1/2) > >>

Unknown Gamer:

--- Quote from: MrPresident link=topic=8377.msg29250#msg29250 ---What This Is
This is a replacement for ULib's UCL storage system. The current system saves and reads all stored users and their accesses from a single text file. This works fine, unless you have multiple servers or a LOT of information in that file.

What This Does
This overrides the Save and Load functions in UCL. Instead of loading and saving your users to the users.txt file, it will instead load and save them from a database.


What This Doesn't Do
This only handles users. It doesn't store groups or group permissions. Those are still going to be stored in the groups.txt
This doesn't handle banning. There are plenty of MySQL banning modules out there.

What Is Modified
You will need to *replace* your ucl.lua file in addons\ULib\lua\ulib\server\ucl.lua
We typically NEVER recommend that you replace any of our stock files as this could cause issues or the changes will be reverted the next time you update ULib.. However, due to the nature of this kind of modification simply writing it into an addon wouldn't work because of the way modules are loaded. If you choose to install this, I HIGHLY recommend making a backup of your ULib addon first.
Inside the ucl.lua file I added some MySQL functions. I also modified the SaveFile function as well as completely commented out the LoadFromFile function. I also slightly modified addUser and removeUser functions.

How To Install
1. Install the MySQLoo module. If you don't know where/how to get this I suggest Google.
2. Download the copy of ucl.lua from this post (YOU NEED TO BE LOGGED IN TO SEE IT)
3. Replace Addons\ULib\lua\server\ucl.lua with the one I provided.
4. Create a database in your MySQL called 'ulibsql' and set up a user to have permissions for it. (Don't create any tables inside of it, my code will handle that)
5. Edit the information at the top of the file to suit your MySQL database.
6. To be sure the table generated: run 'lua_run ULib_SQL_CreateTable()' from your server console.
7. From your server console or in game (if you are a superadmin) run ulib_loadlegacy to load your users from your users.txt and load them into your database.

WARNING/CAUTION
This is ONLY for people who know how to use the MySQLOO module. I will not provide support for getting that installed or configured.
This is not for server owners who do not know enough about lua or modifying files to at least edit the SQL configuration at the top of the file.
If you update ULib this modification will be lost and you'll have to reinstall it.
This comes as-is and while I did to testing, there is no way for me to know if it'll work in every situation. Please make a backup of your ULib files before installing this.

Help/Support
I am not going to help you install MySQLOO.
If you have MySQLOO installed and configured properly and are having trouble with this modification, please feel free to post here and I will try and assist you the best I can.

--- End quote ---

syl0r and I fixed the module up a bit, along with Freddy adding backwards support for the MySQLOO v9 other modules that used the old system this used. MrPresident is fine with you guys modifying and updating the code on the github page listed below.

https://github.com/MrUnknownGamer/ULib-MySQLOO

MrPresident:
Thanks for posting updated code.

JustPlayer:
And it's clean (no known backdoor/server takeover)
:)

MrPresident:
Did my original code have something like that, or were you just stating that the code he posted didn't have anything added? :P

kulcris:
not sure if it is just me but it seems like the data is not properly being loaded from the database. i change a user to superadmin and they get demoted back to admin on join. but the information updates in the database as im doing it, i deleted the users.txt file thinking maybe it was still reading from tehre

Navigation

[0] Message Index

[#] Next page

Go to full version