Jump to content

How to remove IP Adress from ticket?


ST4R

Recommended Posts

Hi there.

 

According to this topic I've replaced {$reply.message} with this:

{$reply.message|replace:'----------------------------':''|regex_replace:'/IP Address: (\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$/':''}

 

 

But the problem didn't solve.

 

- - - Updated - - -

 

this topic

http://forum.whmcs.com/showthread.php?81286-How-to-remove-IP-Adress-from-ticket

Link to comment
Share on other sites

  • 7 years later...

I believe this solution no longer works for modern WHMCS since ipaddress is no longer part of {$reply.message}.

To remove IP address you have to set it equal to false via ClientAreaPage hook point by overriding the value from bot $vars['ascreplies'] and $vars['descreplies'] as follows:

add_hook('ClientAreaPage', 1, function($vars) {
    
    if ($vars['templatefile'] == 'viewticket') {

        $output = [];

        foreach ($vars['ascreplies'] as $index => $replies) {

            foreach ($replies as $k => $v) {

                if ($k == 'ipaddress') {

                    $v = false;
                }

                $output['ascreplies'][$index][$k] = $v;
            }
        }

        foreach ($vars['descreplies'] as $index => $replies) {

            foreach ($replies as $k => $v) {

                if ($k == 'ipaddress') {

                    $v = false;
                }

                $output['descreplies'][$index][$k] = $v;
            }
        }

        return $output;
    }
});

In case I need to update something I uploaded the script on Github since this community doesn't let me edit posts after a certain amount of time.

Edited by Kian
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