Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Passing MD5 to template

Discussion in 'cPanel Developers' started by linuxguy75, Jan 30, 2016.

  1. linuxguy75

    linuxguy75 Registered

    Jan 30, 2016
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    I've been a linux admin for 13 years so I know my way around a linux server. But I'm a noob when it comes to cpanel API. So I apologize in advance for my ignorance.

    I have created a global header template. /var/cpanel/customizations/includes/

    It works great. However, the part where I'm stuck, I have a string inside this template that I need to convert using MD5 or SHA1. I've been unable to access the perl module MD5 or SHA inside the template.

    Anyone have any ideas on maybe how to access an MD5 function inside the template?

    Or maybe I need to write a perl plugin that returns the md5 string to the template.
  2. cPDavidN

    cPDavidN cPanel Developer
    Staff Member

    Mar 19, 2013
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    DataCenter Provider

    Probably the easiest way to do what you need to would be to write a UAPI module with a subroutine that does what you need, and then invoke that from within your header template. UAPI modules are just Perl modules written a specific way and stored in /usr/local/cpanel/Cpanel/API. Once a UAPI call is available, calling it from inside Template Toolkit code just looks like "execute( 'Module', 'function', { 'key' => 'value' } );"

    UAPI - Custom UAPI Modules - Software Development Kit - cPanel Documentation

    If you have any more questions about this, please don't hesitate to ask.

    David Nielson
    cPanel developer
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice