Yii User Management Firstvisit Page

Hi,

I have installed yii user management module, and its working fine,

I am able to register, send activation mail and activate account.

However, I tried to set the firstVisit Parameter in User.module to the membership order page. But when I login for the first time after activating my account, I am still getting redirected to the home page, rather than the membership page.

I was trying to trace it from the YumAuthController redirect function, by adding logs:


 public function redirectUser($user) {

     Yii::log('----------Redirecting User---');

     $user->lastvisit = time();

     $user->save(true, array('lastvisit'));

     Yii::log('----------set last visit time ---');

 

     Yii::app()->user->setState('first_login', true);

     Yii::log('----------set state  first login ---');

     if(isset($_POST) && isset($_POST['returnUrl']))

       $this->redirect(array($_POST['returnUrl']));

     Yii::log('----------return url test for admin  ---');

 

     if ($user->superuser && Yum::module()->returnAdminUrl)

       $this->redirect(Yum::module()->returnAdminUrl);

 

     Yii::log('----------return url test for user  ---');

     if(isset(Yii::app()->user->returnUrl))

       $this->redirect(Yii::app()->user->returnUrl);

 

     Yii::log('----------pwd expired---');

     if ($user->isPasswordExpired())

       $this->redirect(array('passwordexpired'));

 

     Yii::log('----------return url not set for user  ---');

     if (Yum::module()->returnUrl !== '')

       $this->redirect(Yum::module()->returnUrl);

     else

       $this->redirect(Yii::app()->user->returnUrl);

     Yii::log('----------now redirect to first vist---');

     $this->redirect(Yum::module()->firstVisitUrl);

   }



The trace file shows the following trace:




2013/05/25 17:50:23 [info] [application] ----------Redirecting User---

2013/05/25 17:50:23 [trace] [system.caching.CFileCache] Serving "yum_translations_en_us_yum" from cache 

2013/05/25 17:50:23 [trace] [system.caching.CFileCache] Serving "yum_translations_en_us_yum" from cache 

2013/05/25 17:50:23 [trace] [system.caching.CFileCache] Serving "yum_translations_en_us_yum" from cache 

2013/05/25 17:50:23 [trace] [system.base.CModule] Loading "avatar" module

2013/05/25 17:50:23 [trace] [system.db.ar.CActiveRecord] YumUser.update()

2013/05/25 17:50:23 [trace] [system.db.ar.CActiveRecord] YumUser.updateByPk()

2013/05/25 17:50:23 [trace] [system.db.CDbCommand] Executing SQL: UPDATE `user` SET `lastvisit`=:yp0 WHERE `user`.`id`='21'

2013/05/25 17:50:23 [trace] [system.base.CModule] Loading "profile" module

2013/05/25 17:50:23 [trace] [system.db.CDbCommand] Querying SQL: SHOW COLUMNS FROM `privacysetting`

2013/05/25 17:50:23 [trace] [system.db.CDbCommand] Querying SQL: SHOW CREATE TABLE `privacysetting`

2013/05/25 17:50:23 [trace] [system.db.ar.CActiveRecord] YumPrivacysetting.findByPk()

2013/05/25 17:50:23 [trace] [system.db.CDbCommand] Querying SQL: SELECT * FROM `privacysetting` `t` WHERE `t`.`user_id`='21' LIMIT 1

2013/05/25 17:50:23 [trace] [system.db.ar.CActiveRecord] writing MANY_MANY data for YumUser

2013/05/25 17:50:23 [trace] [system.caching.CFileCache] Serving "yum_user_relations" from cache

2013/05/25 17:50:23 [info] [application] ----------set last visit time ---

2013/05/25 17:50:23 [info] [application] ----------set state  first login ---

2013/05/25 17:50:23 [info] [application] ----------return url test for admin  ---

2013/05/25 17:50:23 [info] [application] ----------return url test for user  ---



Please let me know why am I not able to transfer to the membership page.

Thanks and Regards,

nice…