toli
(Tolisoft)
1
Hello Mates,
I want to have a different loginUrl for one of my modules. It uses different user’s table.
I changed component’s init method but this did not change anything.
Now my init method is:
public function init()
{
parent::init();
$this->setImport(array(
'cmsbe.models.*',
'cmsbe.components.*',
));
Yii::app()->setComponents(array(
'user'=>array(
'class'=>'CWebUser',
'loginUrl'=>Yii::app()->createUrl($this->getId().'/default/login2'),
),
), false);
}
Any ideas are welcome.
Thanks in advance
bettor
(Live Webscore)
2
first of all you should set a different session for the second login so they don’t mix:
public function init()
{
Yii::app()->user->setStateKeyPrefix('_cmsbe');
}
and then define the new login like:
public function init()
{
Yii::app()->user->loginUrl=array($this->getId() . '/default/login2');
}
hope this helps
toli
(Tolisoft)
3
Unfortunately it does not work. The code now looks like :
public function init()
{
parent::init();
$this->setImport(array(
'cmsbe.models.*',
'cmsbe.components.*',
));
Yii::app()->user->setStateKeyPrefix('_cmsbe');
Yii::app()->user->loginUrl = array($this->getId() . '/default/login2');
}
If I try to load mydomain.com/cmsbe/ it forward me to /site/login but is should forward me to /cmsbe/default/login2.
Where could be the problem?
toli
(Tolisoft)
4
Anyone?
What could be wrong in my case ?