Yii Framework Forum: Module based login - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Module based login Can't figure out what I am doing wrong Rate Topic: -----

#1 User is offline   Julie 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 01-August 11

Posted 22 October 2011 - 10:13 AM


(Sorry for my bad English, but I am from France and trying my best)

I have a webApplication with an admin module.
We can login in the admin module or on the website, but the two logins are completely independant. I think that it was working before, but now, when I go to index.php?r=admin, I am redirected to index.php?r=site/login instead of index.php?r=admin/index/login. And when I loggin on the website, I can access the admin interface like if I was logged in.

Here is my config/main.php
return array(
	// autoloading model and component classes

	// application components
			// enable cookie-based authentication
			// use 'site/error' action to display errors

And here is the AdminModule.php

class AdminModule extends CWebModule
	public $defaultController = 'index';
	public function init()
		// this method is called when the module is being created
		// you may place code here to customize the module or the application

		// import the module-level models and components
			'user' => array(
				'class'          => 'CWebUser',
				'stateKeyPrefix' => 'admin',
				'loginUrl'       => Yii::app()->createUrl('/admin/index/login'),

	public function beforeControllerAction($controller, $action)
		if(parent::beforeControllerAction($controller, $action))
			// this method is called before any module controller action is performed
			// you may place customized code here
			return true;
			return false;

I only use basic login form and user identities.
So if you have any idea of what I could be missing, it would be a great help
Thanks !!

Share this topic:

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users