Insert Script to Pages served for certain package.

muneeb852

Member
May 25, 2021
9
2
3
Pakistan
cPanel Access Level
Root Administrator
Hello there,
I have 3 packages on my test cPanel server. (Plan1, Plan2, Plan3).
What I want to achieve is "For all Plan1 cPanel user's website that is served should have a script inserted on each page".
So, all cPanel account's which are subscribed to Plan1 when their website loads on browser. I want my custom JavaScript to inserted into their HTML, so when the website loads the script will execute. This is a safe script that insert some picture at bottom of website to convey some information.
Is there a way or method to do this.
Please experts, Shed a light on this for me.
Thanks.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,447
697
313
cPanel Access Level
Root Administrator
Hey there! There aren't any tools that let you create content based on the package assigned to a user - that would take come custom coding by a developer. If that is something you wanted to explore I would recommend checking out our API system here to see what is available:


For example, you could use this call (Return cPanel account's configuration settings · cPanel & WHM Developer Portal) to view the feature list assigned to the user, and incorporate that into your code to call other actions.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,447
697
313
cPanel Access Level
Root Administrator
Me either - this would require some significant development work by a person familiar with cPanel tools. The API system would be useful in finding the accounts using the packages, but the rest would need to be built from scratch.