Well, I found some way of how to do it.
First of all, my folders structure, looks similar as it:
common/
css/
images/
js/
extensions/
bootstrap/
auth/
protected/
/* Yii Default directory folder*/
Application1/
css/
images/
js/
protected/
/* Yii Default directory folder*/
Config File Under Common Folder
return array(
'import'=>array(
'common.components.*',
'common.models.*',
),
'modules' => array(
'auth',
),
'components' => array(
'authManager' => array(
'behaviors' => array(
'auth' => array(
'class' => 'common.modules.auth.components.AuthBehavior',
'admins'=>array('admin', 'foo', 'bar'),
),
),
),
'user' => array(
'class' => 'common.modules.auth.components.AuthWebUser',
),
'bootstrap'=>array(
'class'=>'common2.extensions.bootstrap.components.Bootstrap',
),
),
);
Login
The login is under 'common', so, to redirect to the login page, I just call the SiteController.php
and I implented there the login process, giving for the user the ability to select the application that he wants to get in.
After the login, I redirect the user to the application address:
$this->redirect(Yii::app()->request->getBaseUrl(true) . "/../" .$App. "/" . "");
Config File Under Application Folder
under the application, the index.php
file has the alias
for the common directory, is the way that they can still 'talking'.
Yii::setPathOfAlias('common', dirname(__FILE__) . $directory);
If you want to do something similar and are finding hard to understand, let me know, I will put here more information, if you need to.