fhumanes 7/7/2021 | |
Hello: To hide the new user records button you have to put this line in JavaScript: $('[data-itemid="loginform_register_link"]').hide(); Greetings, |
A
|
Andreas G. author 7/7/2021 |
HI fhumanes We got it wrong. I am capable of learning, but it also doesn't work with the option: Check if specific record exists. If a user ID in db_users is greater than 99 then hide "registration". I must have just one mistake in my thinking Translated with Google |
A
|
acpan 7/7/2021 |
As far as I know, the only way you can restrict the registration is by querying the database, one way is to include an external php script in your login form, that query the database, and if the count exceeds your predefined limit, redirects the user to another page. The external script should be independent of PHP dbcommon script, as PHPRunner dbommon only allows to be used when a user has already logged in. There are many mysql class scripts that you can use in the internet. prepare it and include that script in your login form and thwt should solve your issue. Hope it helps. |
A
|
Andreas G. author 7/7/2021 |
Thanks for the feedback ! |
admin 7/7/2021 | |
Such a confusing advise. Why would you need to use an external PHP script if you can add your code to event like BeforeProcess of Register or Login page? |
A
|
acpan 7/7/2021 |
Please disregard my advice earlier, you can simply use DB API in before login process event, as what admin mentioned and using Fernando's suggestion. I was quoting one of my projects where i needed access to the database before user logs in, in a more complex situation, it is not necessary in your case. Here's what you can do: Login Before Process event: $rs = DB::Query("select count(*) as count from user_table"); Login Javascript On Load event (as Fernando's advice): if ( proxy["user_count"] > 100) { |