[ic] Set FormIgnore dynamically at runtime?

Dan Browning interchange-users@interchange.redhat.com
Mon Apr 1 15:40:01 2002


At 08:59 PM 3/31/2002 -0500, you wrote:
>Quoting Kevin Walsh (kevin@cursor.biz):
> > >
> > > Is there any way to set FormIgnore dynamically at runtime?
> > >
> > > I would like to make it so that a certain class of users (dealers) 
> cannot
> > > change their shipping address themselves, but regular users still
> > > can.  Three ideas:
> > >
> > > * A way to set FormIgnore dynamically (would be cool)
> > >
> > > * A way to set FormIgnore with some ITL mixed in?
> > >
> > > * Conditionally remove the HTML <INPUT...>'s for dealers [this method 
> not
> > > very secure]
> > >
> > > * Reset the values during mv_click
> > >
> > > * Any other suggestions?
> > >
> > How about something in the catalog.cfg along the lines of:
> >
> >     Autoload <<EOA
> >         [perl]
> >             if ($Scratch->{'dealer'}){
> >                 $Config->{FormIgnore}{somevar} = 1;
> >             }
> >         [/perl]
> >     EOA
> >
> > I forget when the Autoload kicks in, so it may be too late.
> > Of course, its no use in an Autoend directive, for obvious
> > reasons.
>
>It is not too late, so that would work.
>
>Also, you can do it in an mv_click, for it takes effect at
>values update time which is after mv_click.
>
>[set Place Order]
>
>     [perl]
>         $Config->{FormIgnore}{mv_order_route} = ! $Scratch->{dealer};
>     [/perl]
>
>     mv_todo=submit
>
>[/set]

Thanks Mike.  That should shave off a few cycles on page loading.


+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Dan Browning, Kavod Technologies <db@kavod.com>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Chicago, n.:
         Where the dead still vote ... early and often!