[ic] Set FormIgnore dynamically at runtime?

Mike Heins interchange-users@interchange.redhat.com
Sun Mar 31 21:00:01 2002


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]

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Friends don't let friends use Outlook. -- Bob Blaylock