cornernote / yii-audit-module

Track and display usage information including page requests, database field changes, php errors and yii logs.
https://cornernote.github.io/yii-audit-module
Other
22 stars 13 forks source link

connection resumed #14

Closed vinao closed 10 years ago

vinao commented 10 years ago

Hello good night

have one problem, when my page update by example following down 127.0.0.1/app1/index.php/search/index

error 404

connection resumed!!!

help me someone please

cornernote commented 10 years ago

Hello @vinao,

The route search/index is not part of audit module.

vinao commented 10 years ago

Hello cornernote good morning!!

thanks by reply, but not am understanding, by I configure all application in destination the paste modules, please me the one example, because my project this understanding down

http://localhost/Auditor/index.php/audit/request

but by bad write, because am brazilian the am estuding english.

very thanks

cornernote commented 10 years ago

Hello @vinao,

I am finding it a little difficult to understand your problem. Could you perhaps paste some screenshots, or send me a video screencast by using the following link: http://showmewhatswrong.com/submit/VjVVccesp

I will do my best to help once I understand the problem.

vinao commented 10 years ago

ok ok will send, one screenshots, by accurate solve today the problem :(

vinao commented 10 years ago

Following down the screenshots, remembering that all configuration the extension was performed the folder modules

captura de tela de 2014-06-11 08 35 24

cornernote commented 10 years ago

So the problem is that it breaks your whole site after you install it?

vinao commented 10 years ago

I know, by as how do solve??? have some solution?

vinao commented 10 years ago

if you want I forward the file config.main, for check.

vinao commented 10 years ago

's there?

cornernote commented 10 years ago

Yes, paste your main.php (first remove database password and sensitive information)

vinao commented 10 years ago

ok, following down the file the folder main.php

<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'My Web Application',

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

    'aliases' => array(
            'bootstrap' => realpath(__DIR__ . '/../extensions/bootstrap'), 
         'audit' =>  realpath(__DIR__ . '/../modules/audit'),
                  ),
    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
        'bootstrap.helpers.TbHtml',
        'application.modules.audit.*',  
    ),

    'modules'=>array(
        // uncomment the following to enable the Gii tool

         'audit' => array(
         //'audit.controllers.DefaultController'=>'default',
         'class' => 'application.modules.audit.AuditModule',
         'userViewUrl' => array('/audit/view', 'id' => '--user_id--'),
         'enableAuditField' => true,
         'connectionID' => 'db',
         'autoCreateTables' => true,
         'layout' => 'application.modules.audit.views.layouts.column1',
         'gridViewWidget' => 'bootstrap.widgets.TbGridView',
         'detailViewWidget' => 'zii.widgets.CDetailView',
         'controllerFilters' => array(
         'auditAccess' => array('application.modules.audit.components.AuditAccessFilter'),
                ),

         'adminUsers' => array('admin'),
         'yiiStrapPath' => 'application/extensions/bootstrap',
            ),

        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'12345',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters'=>array('127.0.0.1','::1'),
            'generatorPaths' => array('bootstrap.gii'),
        ),

    ),

    // application components
    'components'=>array(

         'errorHandler' => array(
            'class' => 'application.modules.audit.components.AuditErrorHandler',
            'errorAction' => 'audit/error',
            'trackAllRequests' => true,
            'catchFatalErrors' => true,
            'auditRequestIgnoreKeys' => array('PHP_AUTH_PW', 'password'),
                            ),
        'bootstrap' => array(
                    'class' => 'bootstrap.components.TbApi',   
                        ),
        'user'=>array(
            // enable cookie-based authentication
            'allowAutoLogin'=>true,
        ),
        // uncomment the following to enable URLs in path-format

        'urlManager'=>array(
            'urlFormat'=>'path',
            //'audit'=>'audit/default',
            'rules'=>array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            ),
        ),
        /*
        'db'=>array(
            'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
        ),
        */
        // uncomment the following to use a MySQL database

        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
            'enableProfiling' => true,
            'enableParamLogging' => true,
        ),

        'errorHandler'=>array(
            // use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                     'class' => 'application.modules.audit.components.AuditLogRoute',
                     'levels' => 'error, warning, profile, audit',
                      ),
                // uncomment the following to show log messages on web pages
                /*
                array(
                    'class'=>'CWebLogRoute',
                ),
                */
                        ),
                ),
    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params'=>array(
        // this is used in contact page
        'adminEmail'=>'webmaster@example.com',
    ),
);
vinao commented 10 years ago

received?

vinao commented 10 years ago

you identified the error??

vinao commented 10 years ago

you look the main, the my opnion by correct the main

vinao commented 10 years ago

your have some idea??? Good am exiting for food, if possible me reply the afternoon bye

vinao commented 10 years ago

Hello cornernote,

you could solve the problem??

cornernote commented 10 years ago

Hi @vinao,

You have errorHandler defined twice.

If removing the old one doesnt help, try removing this line and see if you get any better error message: 'class' => 'application.modules.audit.components.AuditErrorHandler',.

Let me know how you go.

vinao commented 10 years ago

thank very much this But me sorry, I can not see the error!! remove the line specified in your example!!!

vinao commented 10 years ago

You there!!

vinao commented 10 years ago

hey cornernote,

I managed error pack up, but not show anything on the page?

cornernote commented 10 years ago

Hello @vinao,

Please reply just once. I will respond when I have time.

Please remove errorHandler from the preload section. Let me know if that helps.

vinao commented 10 years ago

good morning

ok ok, I apologize for the replies, but I did a test here and the error persists!!

cornernote commented 10 years ago

Please remove everything to do with the audit module and see if the error persists.

vinao commented 10 years ago

My yii not created the vendor folder does the error this persisting in that?

cornernote commented 10 years ago

The vendor folder is created if you installed with composer. (https://getcomposer.org/)

cornernote commented 10 years ago

Once you removed all the audit-module stuff from your config, paste the config here so I can check it.

vinao commented 10 years ago

remove all configuration of main?

cornernote commented 10 years ago

remove all configuration from yii-audit-module from your config/main.php

vinao commented 10 years ago

It seems that solved the problem, ma has another little problem following just below your description. Error Description : Error 403 You are not allowed to access this page.

cornernote commented 10 years ago

after removing all the config for the module, your site works again?

If so, now please add the module back in, one section at a time. Let me know what causes it to break.

vinao commented 10 years ago

No No, I removed the errorHandler class scope main.php

vinao commented 10 years ago

but, that's another mistake I don't know where this coming

cornernote commented 10 years ago

I'm not sure where you are at. Can you paste your config file again, and also a screenshot of your current issue?

cornernote commented 10 years ago

Im heading to bed now, will check in the morning.

vinao commented 10 years ago

ok ok good night, morning we solve

vinao commented 10 years ago
<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'My Web Application',

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

        'aliases' => array(
                'audit' => realpath(__DIR__ . '/../modules/audit/views'),
            'bootstrap' => realpath(__DIR__ . '/../extensions/bootstrap'),
                  ),

    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
        'bootstrap.helpers.TbHtml',
        'application.modules.audit.*',  
               ),

    'modules'=>array(
          'audi',           
         'audit' => array(

            'class' => 'application.modules.audit.AuditModule', 
            'userViewUrl' => array('audit/view', 'id' => '--user_id--'),
            'enableAuditField' => true,
            'connectionID' => 'db',
            'autoCreateTables' => true,
            'layout' => 'audit.views.layouts.column1',
            'gridViewWidget' => 'application.extensions.bootstrap.widgets.TbGridView',
            'detailViewWidget' => 'zii.widgets.CDetailView',
            'controllerFilters' => array('auditAccess' => array('application.modules.audit.components.AuditAccessFilter'),
                 ),

            'adminUsers' => array('admin'),
            'yiiStrapPath' => realpath(__DIR__ . '/../vendor/yiistrap/bootstrap'),
                ),

        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'12345',
            'generatorPaths' => array('application.extensions.bootstrap.gii'),
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters'=>array('127.0.0.1','::1'),
                    ),

    ),

    // application components
    'components'=>array(

         'bootstrap' => array(
                    'class' => 'application.extensions.bootstrap.components.TbApi',   
                    ),

        'user'=>array(
            // enable cookie-based authentication
            'allowAutoLogin'=>true,
                  ),

        'urlManager'=>array(
            'urlFormat'=>'path',
            'rules'=>array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
                       ),
                     ),
        /*
        'db'=>array(
            'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
        ),
    */
        // uncomment the following to use a MySQL database
        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=Audit',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
            'enableProfiling' => true,
            'enableParamLogging' => true,
        ),

        'errorHandler'=>array(
            // use 'site/error' action to display errors
            'class' => 'application.modules.audit.components.AuditErrorHandler',
            'errorAction' => 'site/error',
            'trackAllRequests' => true,
            'catchFatalErrors' => true,
            'auditRequestIgnoreKeys' => array('PHP_AUTH_PW', 'password'),
        ),
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                     'class' => 'application.modules.audit.components.AuditLogRoute',
                     'levels' => 'error, warning, profile, audit',
                ),
                // uncomment the following to show log messages on web pages
                /*
                array(
                    'class'=>'CWebLogRoute',
                ),
                */
            ),
        ),
    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params'=>array(
        // this is used in contact page
        'adminEmail'=>'webmaster@example.com',
    ),
);
vinao commented 10 years ago

captura de tela de 2014-06-13 09 57 52

vinao commented 10 years ago

ai tried to solve this cornernote good rest

cornernote commented 10 years ago

You have to login as admin, or add your username to the adminUsers list: 'adminUsers' => array('admin'),

vinao commented 10 years ago

ok ok, thank you very much @cornernote problem solved :+1:. You have email ? we can friends..

cornernote commented 10 years ago

Glad to hear it's solved. My email is cornernote@gmail.com