I thought this should work, but it goes through the CHttpRequest::redirect() which causes a header Location change and it loses the ajax status on the request in that process (at least that's as close as I can figure what's happening).
This is the change I made:
public funciton actionLogin()
{
$model = new LoginForm;
if (isset($_POST['ajax'] && $_POST['ajax'] ==='login-form')
{
// ... standard stuff here
}
if ( $request = Yii::app()->getRequest() && $request->isAjaxRequest)
{
// ensure we're rendering this in a parent window, not an update div
$this->renderPartial('loginRedirect', array(), false, true);
Yii::app()->end();
}
... //original code continues
}
Then the new views/site/ folder - loginRedirect.php
<script>
window.location = '<?php echo $this->createAbsoluteUrl('site/login')?>';
</script> However, it's rendering the full render('login') NOT the partial page, within the div.
I can't use the beforeAction method of the controller unless I change the access controller completely for every controller that may use ajax updates. This definitely does not appeal to me as a solution.
I don't really want to have to extend CWebUser either if I don't have to -- so I'm wondering if there's an elegant solution to this issue that I'm overlooking?
Any insight would be greatly appreciated.

Help














