Can Appgini restrict viewing records by location?

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
nycwebmaster
Veteran Member
Posts: 90
Joined: 2015-11-23 01:02

Can Appgini restrict viewing records by location?

Post by nycwebmaster » 2016-01-05 02:44

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.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Can Appgini restrict viewing records by location?

Post by a.gneady » 2016-01-06 19:52

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
:idea: 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.

nycwebmaster
Veteran Member
Posts: 90
Joined: 2015-11-23 01:02

Re: Can Appgini restrict viewing records by location?

Post by nycwebmaster » 2016-01-06 23:44

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.


:ugeek:

nycwebmaster
Veteran Member
Posts: 90
Joined: 2015-11-23 01:02

Re: Can Appgini restrict viewing records by location?

Post by nycwebmaster » 2016-01-07 00:04

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?

shkdxb
Veteran Member
Posts: 40
Joined: 2013-06-28 18:18

Re: Can Appgini restrict viewing records by location?

Post by shkdxb » 2016-02-29 17:24

you can do like this
http://forums.appgini.com/phpbb/viewtopic.php?t=1942

Code: Select all

if($memberInfo['group']=='Admins' || $memberInfo['group']=='someothergroup'){
       your code here
      
   }else{

Post Reply