Jump to content

Custom code configuredomains.tpl


web2008

Recommended Posts

Hello,

I had a custom code in configuredomains.tpl that doesn't work anymore.

Is there someone who can help?

{if $smarty.session.cart.domains.{$num}.type eq "transfer"}This is a transfer!!!!!{elseif $smarty.session.cart.domains.{$num}.type eq "register"}This is a new registration!!!{/if}
Link to comment
Share on other sites

Hi there,

You need to add the following to your configuration.php file due to the Smarty Security Policy (https://docs.whmcs.com/Smarty_Security_Policy).

$smarty_security_policy = [
    'system' => [
        'enabled_special_smarty_vars' => [
            'session'
        ],
    ]
]; 

Make sure to put your code in the  {foreach $domains as $num => $domain} loop for it to work as it references $num e.g.

{foreach $domains as $num => $domain}

                    <div class="sub-heading">
                        <span class="primary-bg-color">{$domain.domain} ({if $smarty.session.cart.domains.{$num}.type eq "transfer"}This is a transfer!!!!!{elseif $smarty.session.cart.domains.{$num}.type eq "register"}This is a new registration!!!{/if})</span>
                    </div>

...

 

Link to comment
Share on other sites

Sorry, I meant if you remove the following from your configuredomains.tpl file, does the same issue occur

{if $smarty.session.cart.domains.{$num}.type eq "transfer"}This is a transfer!!!!!{elseif $smarty.session.cart.domains.{$num}.type eq "register"}This is a new registration!!!{/if}

If so, do you have any other custom code in that template or any other modules or hooks that may be conflicting with the security policy? Perhaps you may need to add more variables to the security policy such as 

$smarty_security_policy = [
    'system' => [
        'enabled_special_smarty_vars' => [
            'session', 'cookies', 'server'
        ]
    ]
];

You may need to play around with it, more details can be found at https://docs.whmcs.com/Smarty_Security_Policy

Edited by leemahoney3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated