test if module (FEU) is installed and active

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

test if module (FEU) is installed and active

Post by rotezecke »

I am using FrontEndUsers but only really need it a few times per year on request. the rest of the time i would like to keep it disabled.

How can i test in smarty whether or not the (a) module is installed and active? something like {if is_object(feu_smarty)} Yeah {/if}. Thank you.
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: test if module (FEU) is installed and active

Post by Rolf »

Check CGExtensions module {cge_have_module}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: test if module (FEU) is installed and active

Post by rotezecke »

Thanks Rolf. {cge_have_module} works fine but it does not prevent execution of FEU code

Code: Select all

{$is_rpc_agent = false scope=global}
{$hasFEU = {cge_have_module module='FrontEndUsers'}}
{if $hasFEU}
  {if feu_smarty::is_user_memberof('sales_staff')}
    {$is_rpc_agent = true scope=global}
  {/if}
{/if}
The code works fine with FEU enabled, but i get an OOPs when FEU is disabled, "access to static class 'feu_smarty' not allowed by security setting". Looks like what i want to do cannot be achieved?
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: test if module (FEU) is installed and active

Post by Rolf »

Try $config['permissive_smarty'] = 1; in config.php
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: test if module (FEU) is installed and active

Post by rotezecke »

That does the trick. Cheers!
Post Reply

Return to “The Lounge”