Hello team how are you doing here, I hope you all are doing great.
Please I need a help.
I have a project with table *registration*, how can I set my app that when users login the table *registration* open in *table view*
Thank you
Login directly to Table View
Re: Login directly to Table View
Hi,
you can use the hooks/__global.php -> login_ok function. just return the correct url.
See https://bigprof.com/appgini/help/advanc ... obal-hooks
you can use the hooks/__global.php -> login_ok function. just return the correct url.
See https://bigprof.com/appgini/help/advanc ... obal-hooks
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Login directly to Table View
Hi sir
Thank you for your help. Working fine.
Best regards
Thank you for your help. Working fine.
Best regards
Re: Login directly to Table View
I have used this method
It works fine, however can it be made more 'clever' so that if, as in my scenario a new user gets redirected to a registration form to complete. Then once a 'record' exists for that user, then the next time user logs in the default redirect (to index.php) is applied and not the redirect?
If no record exists (i.e. user did not save one on last login/visit) then the redirect still applies.
It's not a must have but would be nice if possible!
Cheers, Ron
With following code:pböttcher wrote: ↑2020-07-03 18:56Hi,
you can use the hooks/__global.php -> login_ok function. just return the correct url.
See https://bigprof.com/appgini/help/advanc ... obal-hooks
Code: Select all
function login_ok($memberInfo, &$args){
if($memberInfo['group']=="clients")
return 'clients_view.php?SelectedID=#ID#';
else
return "";
If no record exists (i.e. user did not save one on last login/visit) then the redirect still applies.
It's not a must have but would be nice if possible!
Cheers, Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: Login directly to Table View
Hi,
I assume you save the registration form in the database. So just add a check to see if there is an existing entry in the membership_userrecords for that user and that table you store the registration form in.
If a record exists, no need to do something, otherwise forward to the registration form.
I assume you save the registration form in the database. So just add a check to see if there is an existing entry in the membership_userrecords for that user and that table you store the registration form in.
If a record exists, no need to do something, otherwise forward to the registration form.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Login directly to Table View
Yes the record is saved in the database but I'm ot sure how to write the conditional check for this.
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: Login directly to Table View
I've been trying with this, but not getting it to work yet:
Code: Select all
function login_ok($memberInfo, &$args){
if($memberInfo['group']=="clients")
$getrecordcount = sqlValue("select COUNT(customers) FROM membership_userrecords WHERE tableName = 'customers' AND memberID = '$memberid1' ");
if ($getrecordcount > 0) return 'index.php';
else
return "customers_view.php?SelectedID=#ID#";
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: Login directly to Table View
Code: Select all
// ...
$tableName = 'customers';
$sql = "SELECT COUNT(*)
FROM `membership_userrecords` WHERE `tableName` = '{$tableName}'
AND `memberID` = '{$memberInfo["username"]}'";
$getrecordcount = sqlValue($sql);
// ...
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Login directly to Table View
Thanks Jan,
As always your help and assistance is greatly appreciated, I've used your solution and my code looks like this now and all working perfectly.
It's a very good addition to my project as clients would become frustrated always ending up on the registration form (customers) when they have already completed one.
Many thanks once again,
Ron
As always your help and assistance is greatly appreciated, I've used your solution and my code looks like this now and all working perfectly.
Code: Select all
function login_ok($memberInfo, &$args){
if($memberInfo['group']=="clients")
$tableName = 'customers';
$sql = "SELECT COUNT(*)
FROM `membership_userrecords` WHERE `tableName` = '{$tableName}'
AND `memberID` = '{$memberInfo["username"]}'";
$getrecordcount = sqlValue($sql);
if ($getrecordcount == 0) return 'customers_view.php?SelectedID=#ID#';
else
if ($getrecordcount > 0) return "index.php";
Many thanks once again,
Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: Login directly to Table View
Sorry I pasted wrong code solution in above (It works but not in all user cases as members of other groups also get sent to the redirect page even when they have already registered, code now covers all logins/groups with a redirect only when no registration has been completed - admin also have to register to avoid redirect).
This is now correct/working (for me) code:
This is now correct/working (for me) code:
Code: Select all
function login_ok($memberInfo, &$args){
$tableName = 'customers';
$sql = "SELECT COUNT(*)
FROM `membership_userrecords` WHERE `tableName` = '{$tableName}'
AND `memberID` = '{$memberInfo["username"]}'";
$getrecordcount = sqlValue($sql);
if ($getrecordcount < 1) return 'customers_view.php?SelectedID=#ID#';
else
return "";
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course