[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] Re: different default modes?


On 2004-08-28, Andreas Schuldei <suppressed> wrote:
> i write a use administration interface and i would distinguish
> between "silly" users and admins. the point in this is not to
> intimidate the users with screens which could confuse them but
> bring them to the "password-changing" page right away.
>
> so it put this code in sub setup{}:
>
>     # set the default mode for users
>     if ( is_silly( $remote_user ) ) {
>         $self->start_mode('EditUserData');
>         $self->query->params( -name  => "user_name" ,
>                               -value => $remote_user );
>     }
>     else {
>         $self->start_mode('AdminSearch');
>     }
>
> the problem is that this seems to have no effect. the users still
> end up on the "adminSearch" page. how should this be done
> properly?

Have you confirmed that "is_silly()" is ever running true? You could do
that by putting a "warn" statement in the "if" block and checking the
logs.

Otherwise, your code looks OK from what you describe as your goal.

	Mark


-- 
http://mark.stosberg.com/ 


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


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.