tingobol / yii-rights

Automatically exported from code.google.com/p/yii-rights
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Property "CWebApplication.authManager" is read only. #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I downloaded yii-rights-1.1.0.r132.zip and unziped it in <my web 
root>\protected\modules\rights and after that I executed <my web app 
root>\protected\modules\rights\data\schema.sql

After that I can not open any page. The error that appears is:

===============================

CException
Description

Property "CWebApplication.authManager" is read only.
Source File

D:\www\yii-1.1.5.r2654\framework\base\CModule.php(467)

00455:         }
00456:     }
00457: 
00458:     /**
00459:      * Configures the module with the specified configuration.
00460:      * @param array $config the configuration array
00461:      */
00462:     public function configure($config)
00463:     {
00464:         if(is_array($config))
00465:         {
00466:             foreach($config as $key=>$value)
00467: $this->$key=$value;
00468:         }
00469:     }
00470: 
00471:     /**
00472:      * Loads static application components.
00473:      */
00474:     protected function preloadComponents()
00475:     {
00476:         foreach($this->preload as $id)
00477:             $this->getComponent($id);
00478:     }
00479: 

Stack Trace

#0 D:\www\yii-1.1.5.r2654\framework\base\CModule.php(467): 
CComponent->__set('authManager', Array)
#1 D:\www\yii-1.1.5.r2654\framework\base\CApplication.php(117): 
CModule->configure(Array)
#2 D:\www\yii-1.1.5.r2654\framework\YiiBase.php(118): 
CApplication->__construct('D:\www\tracksta...')
#3 D:\www\yii-1.1.5.r2654\framework\YiiBase.php(91): 
YiiBase::createApplication('CWebApplication', 'D:\www\tracksta...')
#4 D:\www\trackstar\index.php(13): 
YiiBase::createWebApplication('D:\www\tracksta...')
#5 {main}

Here is my main.php:
===============================

<?php
return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'My Web Application',

    // preloading 'log' component
    'preload'=>array('log'),

    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
        'application.modules.rights.*',
        'application.modules.rights.components.*',
        'application.extensions.debugtoolbar.*',
    ),

    'modules'=>array(
        // uncomment the following to enable the Gii tool
        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'1',
        ),
        'rights'=>array( 
            'install'=>true, // Enables the installer. 
            'debug'=>true,
        ),
    ),

    'authManager'=>array(
        'class'=>'CDbAuthManager',
        'connectionID'=>'db',
    ),

    // application components
    'components'=>array(
        'user'=>array(
            'allowAutoLogin'=>true,
            'class'=>'RightsWebUser', // Allows super users access implicitly.
        ),
        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=trackstar',
            'emulatePrepare' => true,
            'username' => '*****',
            'password' => '*****',
            'charset' => 'utf8',
            'tablePrefix' => 'tbl_',
        ),
        'authManager'=>array(
            'class'=>'RightsAuthManager',
            'connectionID'=>'db',
            'itemTable'=>'authitem',
            'itemChildTable'=>'authitemchild',
            'assignmentTable'=>'authassignment',
            'rightsTable'=>'rights',
         ),
        'errorHandler'=>array(
            // use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning',
                ),
                // uncomment the following to show log messages on web pages
                /*
                array(
                    'class'=>'CWebLogRoute',
                ),
                */
            ),
        ),
    ),

    'params'=>array(
        // this is used in contact page
        'adminEmail'=>'webmaster@example.com',
    ),
);

Original issue reported on code.google.com by gandra...@gmail.com on 8 Jan 2011 at 2:43

GoogleCodeExporter commented 9 years ago
Here is additional info:
OS: Windows XP 32 bit
PHP Version 5.3.3
yii version: 1.1.5.r2654

Original comment by gandra...@gmail.com on 8 Jan 2011 at 10:47

GoogleCodeExporter commented 9 years ago
I will take a look at this as soon as possible. Thank you for reporting this 
issue.

Original comment by Christof...@gmail.com on 9 Jan 2011 at 12:12

GoogleCodeExporter commented 9 years ago
I took some time to check your configuration and you have an authManager 
configuration array outside of the components and one within the components 
configuration. Remove this and it should work. Please report back and tell me 
if this fixed the issue.

Original comment by Christof...@gmail.com on 9 Jan 2011 at 11:03

GoogleCodeExporter commented 9 years ago
Thanks ChristofferNiska,
but meanwhile I found where was my problem.
this solved my problem!
Thnaks!

Although I today recently fiond solution you were faster with your answer!
:)

Thank you!

Original comment by gandra...@gmail.com on 9 Jan 2011 at 11:43

GoogleCodeExporter commented 9 years ago
What is the problem and how do you solved it.

I have the same problem.

can you tell me how do i solve it.

Thanks!

Original comment by uday.kum...@gmail.com on 30 Oct 2011 at 7:11

GoogleCodeExporter commented 9 years ago
answer:
'authManager'=>array(...
must be after 
// application components

first time i put it in "// autoloading model and component classes" too.

P.S. i want to kill someone cause all was done by following the instructions )))

Original comment by murtazin...@gmail.com on 17 Jan 2012 at 4:57