Jump to content

Pages: Show database listing based on search


bpn

Recommended Posts

Posted

I want to make a link that displays a database listing based on searching one field for a value and sort the list alphanumeric on another field.
Any help appreciated.

Posted

To get the query data, you just make this search and then copy the stuff you need from the URL. 

  • The filter looks something like …&content_field_286[1]= 
  • The ordering looks something like  …&sortby=record_comments&sortdirection=desc

The problem is though: filter fields are user-specific. There is no one link that works for everyone. You would have to dynamically create the link in the template adding a csrfKey. 

Posted

Many thanks. Not sure what you mean by user-specific, I haven't seen that in any query-links.

If I just use the sort order button in the default database listing display I get this URL, example: domain.com/pagename/?d=3&sortby=field_5&sortdirection=desc

"d=3": the database ID is 3.

How do I add the search-part, I have tried &field_5=searchstring, but that does not work. Same for &content_field_5[1]=searchstring. (not knowing the meaning of 'content_field' and [1])
 

Posted
On 6/19/2017 at 8:13 PM, bpn said:

Many thanks. Not sure what you mean by user-specific, I haven't seen that in any query-links.

Example: https://invisioncommunity.com/4bugtrack/alpha-and-beta-reports/

Select a status in the filter menu and click update. 

Check the resulting URL:

https://invisioncommunity.com/4bugtrack/alpha-and-beta-reports/?advanced_search_submitted=1&csrfKey=d75ae71a4aa6c02c7a63a6df46c272eb&content_field_106[1]=2&sortby=record_last_comment&sortdirection=desc&record_type=all&time_frame=show_all

See the csrfKey? That’s dynamically created. We can’t create a general, public link that would link to the search result pages. Yes, it sucks, but if that’s what you are trying to do, don’t bother. It won’t work. 

  • 4 months later...
Posted

@opentype is it a security issue showing the csrfKey?

I mean, when generating a dynamic link, if user can see the link like 

dumbaddress.com/pages?advanced_search_submitted=1&csrfKey=950ec5a522d64d3ab8dd0474a492854e&content_field_333[1]=109

Is this a security problem?

Posted

Not sure what you mean. Who sees which links in which situation?

The point of these keys is that they are unique to each user. They won’t work for different users. That’s the point. 
They also don’t protect any sensitive data in the cases shown above – just temporary, personal database filter settings.  

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...