Hi,
I am using Appgini Latest realease 5.50.
I want to create a table that is going to list events that happens certain dates and the records will have the address of the event. I want the users that lives in the vicinity of those events only will see those records and not the other that are far away from them. Is there a way that a hook can be created to match, for example cities of the user's table to compare with the event's table and those that match are displayed? Or maybe one of you guys could recommend a better approach to this?
Thanks for reading.
Can Appgini restrict viewing records by location?
-
- Veteran Member
- Posts: 90
- Joined: 2015-11-23 01:02
Re: Can Appgini restrict viewing records by location?
To apply a filter on the table based on the current user info, you can use the tablename_init hook to check the user info and apply the appropriate filter. For more details please refer to:
* tablename_init hook: http://bigprof.com/appgini/help/advance ... ename_init
* Applying filters programmatically: http://bigprof.com/appgini/tips-and-tut ... ers/part-1
* tablename_init hook: http://bigprof.com/appgini/help/advance ... ename_init
* Applying filters programmatically: http://bigprof.com/appgini/tips-and-tut ... ers/part-1
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
-
- Veteran Member
- Posts: 90
- Joined: 2015-11-23 01:02
Re: Can Appgini restrict viewing records by location?
Hey,
Thank for the heads up, this actually gave me the idea to save all the permalinks and I will assign the user only viewing privileges and I will provide the link inside a table for him to see the records. Thanks so much and again, keep up the good work I don't post a lot, but I'm a great fan of your application and saves me so much time and gives so much cleaner code and possibilities than any other PHP framework in the market.
Thank for the heads up, this actually gave me the idea to save all the permalinks and I will assign the user only viewing privileges and I will provide the link inside a table for him to see the records. Thanks so much and again, keep up the good work I don't post a lot, but I'm a great fan of your application and saves me so much time and gives so much cleaner code and possibilities than any other PHP framework in the market.
-
- Veteran Member
- Posts: 90
- Joined: 2015-11-23 01:02
Re: Can Appgini restrict viewing records by location?
By the way I was reading more in depth and the help and is explaining about this code:
if($memberInfo['group']=='Admins')
If I add the other groups that I want to include in that statement it will say:
if($memberInfo['group']=='Admins , AnotherGroupToo')
will that work?
if($memberInfo['group']=='Admins')
If I add the other groups that I want to include in that statement it will say:
if($memberInfo['group']=='Admins , AnotherGroupToo')
will that work?
Re: Can Appgini restrict viewing records by location?
you can do like this
http://forums.appgini.com/phpbb/viewtopic.php?t=1942
http://forums.appgini.com/phpbb/viewtopic.php?t=1942
Code: Select all
if($memberInfo['group']=='Admins' || $memberInfo['group']=='someothergroup'){
your code here
}else{