Yii Framework Forum: Yii-Auth - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii-Auth Property "CWebApplication.authManager" is read only. Rate Topic: -----

#1 User is offline   C Boyd 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 28-April 10
  • Location:New York City, NY

Posted 04 May 2010 - 05:23 PM

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!
0

#2 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 05 May 2010 - 01:18 AM

View PostC Boyd, on 04 May 2010 - 05:23 PM, said:

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.
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#3 User is offline   jayrulez 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 348
  • Joined: 29-July 09

Posted 05 May 2010 - 01:05 PM

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
php:
foreach(array('cat', 'dog', 'cow') as $animal) echo $animal."\n";

python:
[(animal, print(animal)) for animal in ['cat', 'dog', 'cow']]

ruby:
['cat', 'dog', 'cow'].each {|animal| puts animal}


You say Tomato, I say Tomato.
0

#4 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 05 May 2010 - 02:14 PM

View Postjayrulez, on 05 May 2010 - 01:05 PM, said:

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. :)
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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