Yii-Auth

I have attempted to install the yii-auth module (as per the instructions) but as soon as I do, I get the following error on my index page:

CException

Description

Property "CWebApplication.authManager" is read only.

Source File

/var/www/yii/framework/base/CModule.php(441)

I have made sure that the authentication folder and its contents (as well as the CDbAuthManager.php file) are writeable. How else do I resolve this?

Many thanks!

Could you please post your stack trace as well.

You get the “is read only error” when you have a private property and no getter (e.g. getAuthManager). As far as I know it has nothing to do with if the file is read only or not. Changed the call to Yii::app()->getAuthManager() to avoid using the CComponent’s “magic” get function. Hopefully this resolves the issue.

Also, please make sure that your application configuration is set up as in the installation instructions.

Which version of the framework are you running btw?

Please let me know if this worked for you. Also, please let me know how you like the module. Thank you in advance.

It seems you are trying to configure authManager inside the application configuration instead of in it’s sub-config ‘components’.

make sure your authManager config is specified in the components array

I updated the module’s readme.txt so that it should be clear where to place the AuthManager configuration in your application’s config.

Thanks jayrulez for pointing this out. :)