[Catalyst] Redirects not working under Catalyst with Debian server
in IE
Giancarlo Corcuera
giancarlo at capybara-software.com
Mon Dec 29 16:36:47 GMT 2008
Sorry, if you referred to this...
Here is my login method:
sub login :Chained('lang') :PathPart('sign_in') :Args(0) :Form {
my ($self, $c) = @_;
my $url_language = $c->stash->{'language'};
my $lang_id = $c->stash->{'language_id'};
my $form_data = load_tags($c,'fe_login_form', $lang_id);
$c->stash->{'page_title'} = $form_data->{'form_title'};
my $form = $self->formbuilder->new(
{
'source' => $c->config->{'home'}.'/root/forms/login/login.fb',
'title' => $form_data->{'form_title'},
'submit' => $form_data->{'sign_in'},
'header' => 0
} );
$form->field(
'name' => 'username',
'label' => $form_data->{'username'}
);
$form->field(
'name' => 'password',
'label' => $form_data->{'password'}
);
$form->field(
'name' => 'qr_submit',
'type' => 'hidden'
);
if ( $form->submitted && $form->validate ) {
my $qr_submit = $form->field('qr_submit') || 0;
if ( $c->login( $form->field('username'),
$form->field('password') ) ) {
$c->session->{'user_id'} = $c->user->user_id;
$c->session->{'is_client'} = $c->user->is_client;
if ( $c->user->is_client eq 'Y' ) {
$c->session->{'user_cty'} = $c->user->b_customer_id->
b_country_id->country_code;
$c->forward('set_currency_format',[$c->session->{'user_cty'}]);
$url_language = $c->user->b_customer_id->b_country_id
->language_iso;
}
else {
$c->session->{'user_cty'} = 'US';
$c->forward('set_currency_format', ['US']);
};
$c->forward('user_roles', [$c->user->user_id]);
$c->forward('lang_session',[]);
}
else {
if ( $qr_submit == 1 ) {
$c->flash->{'login_username'} = $form->field('username');
$c->flash->{'login_qr'} = 1;
$c->flash->{'login_error'} = $form_data->{'error_message'};
$c->session->{'rq'} = undef;
_*
$c->res->redirect($c->uri_for("/$url_language/quotes/edit"));
$c->detach();*_
};
$c->flash->{'error'} = $form_data->{'error_message'};
_* $c->res->redirect($c->uri_for("/$url_language/sign_in"));
$c->detach();*_
};
if ( $qr_submit == 1 ) {
$c->session->{'rq'} = undef;
_* $c->res->redirect($c->uri_for("/$url_language/quotes/edit"));
$c->detach();*_
};
if ( $c->user->is_client eq 'N' ) {
_* $c->res->redirect($c->uri_for('/administrator'));
$c->detach();*_
}
else {
$c->session->{'rq'} = undef;
_*
$c->res->redirect($c->uri_for("/$url_language"));
$c->detach();*_
};
};
$c->stash->{'path'} = $c->request->{'path'};
$c->stash->{'template'} = 'login.tt2';
};
after some operations and/or validations (which are working perfectly)
none of the redirects works in IE but it does on Firefox.
Thanks,
Giancarlo
J. Shirley wrote:
> On Mon, Dec 29, 2008 at 8:06 AM, Giancarlo Corcuera
> <giancarlo at capybara-software.com> wrote:
>
>> I made an application that works fine in the Debian server with catalyst.
>> The problem comes when I use any redirect inside a controller module.
>>
>> For example:
>> When I sign in the application redirects me to the appropiate page according
>> to the user type but in IE it doesn't redirect and showed an error page that
>> states "IE can't show the desired page". So after I press back and ctrl+F5 I
>> can see that the session is already created so the user is now logged in the
>> system.
>>
>> Any advice will be appreciated,
>>
>> Regards,
>>
>> Giancarlo Corcuera
>>
>>
>
> Hi there,
>
> Please paste in the controller code that is relevant.
>
> Thanks,
> -Jay
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
More information about the Catalyst
mailing list