Andreas -
Do you have a value for $remote_user at this point? I would add
'use strict' and 'use warnings' to the top of your C::A module and see
what happens.
The issue I think that's happening is that C::A runs setup()
when you call new(), not when a page request is handled.
A better solution for what you're trying to do may be to put the
following in your cgiapp_prerun():
# Populate $remote_user before this code is executed
if ( $self->run_mode eq $self->start_mode ) {
if ( is_silly( $remote_user ) ) {
$self->prerun_mode( 'EditUserData' );
$self->query->params( ... );
}
}
In your setup() method, go ahead and default the start_mode to
'AdminSearch'. That way, you don't have the else statement in the
cgiapp_prerun().
Does that make sense?
Thanks,
Rob
-----Original Message-----
From: Andreas Schuldei [mailto:suppressed
Sent: Saturday, August 28, 2004 4:46 AM
To: cgiapp
Subject: different default modes?
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?
CONFIDENTIALITY NOTICE: The information in this electronic transmission and any documents accompanying it may contain confidential information belonging to the sender, which is legally privileged. The information is intended only for the use of the individual or entities named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this transmission in error, please destroy the message in its entirety.
---------------------------------------------------------------------
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.