[pmwiki-users] prevent users from changing seachbox parameters

Patrick R. Michaud pmichaud at pobox.com
Thu Dec 14 09:09:12 CST 2006


On Wed, Dec 13, 2006 at 09:54:24PM -0600, JB wrote:
> I put (:searchbox group=Main size=25 label=Go:) into
> Site.PageActions.  I do a search.  The url for the browser
> has the search information in it.  If I remove "&group=Main"
> from the url in the browser it will search all the pages.
> 
> I know I cannot stop users from manipulating the url in
> their browser, but how could I prevent that url from
> changing the search to be different than specified in
> the searchbox?

Specify the group="Main" in the (:searchresults:)
directive instead of in the (:searchbox:).

Phrased slightly differently: (:searchbox:) is
never responsible for generating the actual search
results, it's simply a form that generates a query
for the desired results.  As such, the only way
that (:searchbox:) can affect the results is via
url query parameters.  To force the search results
to be limited to a particular group regardless of
query parameters, one has to adjust the
(:searchresults:) markup.

Pm




More information about the pmwiki-users mailing list