Yii Rights Afterlogin

Hi all,

i started using yii-rights module but i’m having trouble using afterLogin function in RWebUser.

Considering that i followed correctly the yii-rights doc and so all configuration should be ok, on firing actionLogin i get this php error message:

"Using $this when not in object context in path\to\RAuthorizer.php".

The stack trace stop at function: RAuthorizer::isSuperuser( ) location: …\RWebUser.php:21". If i remove afterLogin function (as test) it doesn’t give any problem but, obviously, in this way Superuser is not identified.

Do you have any idea?

Thanks all!

Hey Vot , usually this php error message is generated in a static context. Meaning you are using a static funcion , try removing the static from the public function . Let me know if you are having problems. Look in the RAuthorizer.php

Yes, i thought this too cause i engaged this kind of problem time ago, but that function isn’t static by default.

By the way i tried installing module again and this error didn’t appear anymore.

Thanks anyway gunnit!