logo       

using CAP::ValidateRM to check url params too.: msg#00030

Subject: using CAP::ValidateRM to check url params too.
I have a small problem, and a possible hack to fix it, and want to
solicit comments.

In particular, I'm concerned that I'm doing something boneheaded
thats' leading to my problem and my machinations are wasted effort.

I have a run mode named 'browse' that takes a page parameter (it's
displaying a large dataset a page at a time).  People generally page
around w/ first/previous/next/last links that encode page numbers in
the URL.

For paranoia's sake, I'd like to check that the page parameter is
valid, e.g. an integer > 0.

Since I'm using ValidateRM to check all sorts of other things, I
thought I could use it here, with the call to check_rm just returning
me to the browse runmode.  The problem is that the page parameter is
still invalid on the next call to the runmode and it recurses
tragically.

I suppose that I could have the URL point to one run mode and the call
to check_rm point to another that cleans up the parameter list and
does a forward.

It also occurred to me that it might be interesting to add a small
feature to ValidateRM in which it cleans up any/specific invalid
parameters from $self->query before it invokes the runmode.  I've
hardcoded a couple of test cases and it seems to work.

So, the proposal would be to add a couple of lines of code to
CAP::ValidateRM that would clean up invalid parameters.

I'm not sure how to best specify the list of candidate cleanees.  One
could remove any invalid params, one could check to see if there's an
ignore_fields key in the FIF params and use it's contents?

Thanks for any input,

g.

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe