By rsomaskandan on
I have installed the Premium Module for 5.x When I try to restrict access on pages containing PHP codes , the page throws a fatal error when viewed in anonymous mode. On logging in the page works as expected. It says that there is a redeclaration of a function in common.inc file. I have renamed the function in my PHP code but it still shows the message.
I tried the same thing in my local server but didn't get any error anywhere.
How do I correct this?
Comments
Weird. It sounds like for
Weird. It sounds like for some reason the PHP is getting parsed twice, which indeed would throw that error. You might file a bug report on the Premium module's issue tracker page.
A quick work-around would be something like this: use PHP's function_exists() to protect your code. This will keep the function from being declared twice.
- Corey
Strange!!!
Corey, I added if(!function_exists) to my code and it didnt throw any error but what is even stranger is that the premium module didn't work at all after adding it....It shows the page to all users including anonymous users.
RS.
Maybe it's because I left
Maybe it's because I left out a ")" in the code above... grrrr....
if (!function_exists("foo")) {If that doesn't work, then I'm not sure... I've never used the Premium module myself.
- Corey
I added the )
Corey,
I added the parantheses but still doesn't work.
Thanks for your help....
RS