jrie / sqstorage

A easy to use and quick way to organize your inventory, storages and storage areas
https://sqstorage.net
GNU General Public License v3.0
26 stars 17 forks source link

Login-rate limiter and some small fixes #70

Closed schnoog closed 2 years ago

schnoog commented 2 years ago

Login-Rate limiter included (if relevant fields in user table don't exists they will be created automatically Login-Function as well as fail-management moved into support/tools_users

API access can be allowed/denied for users Typo in api.php fixed support/meekrodb.2.3.class.php deleted, wasn't used at all since meekro is loader by the autoloader

Fast Edit button for storage renaming disabled for quests

jrie commented 2 years ago

The table names are in fact camelCased, "headCategories" and "subCategories" are right. Changed in b35b9ee23aa2827201ec2375c5a1cff4174762ce

8d00d0b2e1ceff1b389680e3bfeeeb429a41949e should not create or alter the database tables for the login on demand, it is better to roll out a db update using the already existing database update mechanism with database revisions.

Also, please note to remove all debugging stuff like <pre><php print_r($_SERVER) ?></pre> or similar code before any commit!

And last but not least, do not use "sleep" inside a script to delay the execution. Better direct to the login page and show a countdown or "wait X minutes before the next login" or similar.

schnoog commented 2 years ago

Will change the install behavior for the table altering.

Camelcase for table names can lead to problems on Windows systems (or in fact on any OS with a case insentitive file system) and xampp by default enforces lowercase table names, this can be changed by amending the server section of the mysql config my.ini with "lower_case_table_names = 2" (yes, really 2, 1 will not work) but isn't recommended https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names

The sleep is only used to slow down login validation by a max of 18 seconds.

schnoog commented 2 years ago

Changed it and fixed a bug which previously wasn't visible

The required fields js tried to validate the input in the hidden modal which failed and therefore didn't submit the form

schnoog commented 2 years ago

Sleep replaced with a message shown to the user.
Since the db update adds new fields to the users-table, some functionality is disabled until the new database fields are available Settings

jrie commented 2 years ago

There is one small fix left, the option that - if items are unsorted and no storage area is assigned "Unsorted" / "Unsortiert" is being shown - but the button to rename the storage is displayed but without proper function.

Other then that, I would like to merge the pull request :+1:

schnoog commented 2 years ago

Changed it, can now be merged in. Since a new db revision is applied (in addition to API, Login behavior change since the 0.10 release issuing a new sub-version would be good