Upon logging in (i haven’t modified the generated login code except user/pass in that hardcoded array, I am redirected to http://www.ftlauderdalewindinspection.com/assets/72efb40a/jquery.min.js
After experiencing this issue, the assets directory contains just empty published folders with no javascript or css inside.
what’s the deal?
mdomba
(Maurizio Domba Cerin)
October 1, 2010, 6:39am
2
I doubt that only changing user/pass has caused this… must be something else changed, too…
Without looking at the code it’s difficult to see what is going on…
If you haven’t changed the code that after the login there is a redirect to Yii::app()->user->returnUrl, check the value of that…
mdomba:
I doubt that only changing user/pass has caused this… must be something else changed, too…
Without looking at the code it’s difficult to see what is going on…
If you haven’t changed the code that after the login there is a redirect to Yii::app()->user->returnUrl, check the value of that…
Thanks for the reply, I checked the returnUrl directly after the call to login()
Here it is:
/assets/72efb40a/jquery.yiiactiveform.js
Here is the login snippet:
/**
* Displays the login page
*/
public function actionLogin()
{
$model = new LoginForm();
if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
if(isset($_POST['LoginForm']))
{
$model->attributes=$_POST['LoginForm'];
// validate user input and redirect to the previous page if valid
if($model->validate() && $model->login())
{
echo Yii::app()->user->returnUrl; exit;
$this->redirect(Yii::app()->user->returnUrl);
}
}
$this->layout = '//layouts/backend/column1';
$this->render('login', array('model'=>$model));
}
This is an incredibly strange error. It has to be something stupid simple, I’ve already checked the permissions on assets.
mdomba
(Maurizio Domba Cerin)
October 1, 2010, 3:21pm
4
Very strange…
What is the URL from which you get the login page?
The generated login view just redirects the form back to site/login by leaving the action empty.
It’s almost as if ClientScript is failing to create the assets and the returnUrl gets set to the failed asset.
The root problem is that some of the assets (not all) are failing to generate, a side-effect to this issue is this redirection bug I am seeing.
<?php
$this->pageTitle=Yii::app()->name . ' - Login';
$this->breadcrumbs=array(
'Login',
);
?>
<h1>Login</h1>
<p>Please fill out the following form with your login credentials:</p>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'login-form',
'enableAjaxValidation'=>true,
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<div class="row">
<?php echo $form->labelEx($model,'username'); ?>
<?php echo $form->textField($model,'username'); ?>
<?php echo $form->error($model,'username'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'password'); ?>
<?php echo $form->passwordField($model,'password'); ?>
<?php echo $form->error($model,'password'); ?>
</div>
<div class="row rememberMe">
<?php echo $form->checkBox($model,'rememberMe'); ?>
<?php echo $form->label($model,'rememberMe'); ?>
<?php echo $form->error($model,'rememberMe'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Login'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
mdomba
(Maurizio Domba Cerin)
October 1, 2010, 5:55pm
6
try to check here the value of Yii::app()->user->returnUrl to find out when it gets set to "[color="#008800 "]/assets/[/color][color="#006666 "]72efb40a[/color][color="#666600 "]/[/color]jquery[color="#666600 "].[/color]yiiactiveform[color="#666600 "].[/color]js"