trying to add jetbackup shortcut to whmcs client area

cPanel, Industry leading hosting platform with world-class support.
Post Reply
allwebnow
Posts: 5
Joined: March 20th, 2021, 7:58 pm

trying to add jetbackup shortcut to whmcs client area

Post by allwebnow »

Hello,

I'm currently trying to customize our client billing area called whmcs to have custom shortcut icons to link to certain cpanel pages. Currently we're using this method as an example for creating a shortcut to "ssl/tls status" page in cpanel. We get the user link variable with this command:

# whmapi1 get_users_links user=allwebstage
*....
SSL_TLS_Status: frontend/paper_lantern/security/tls_status/
...*

So an example shorcut link would look like this app= is what tells our billing software what cpanel page to load:

<div class="col-md-3 col-sm-4 col-xs-6 col-6" id="SSL_TLS_Status">
<a href="clientarea.php?action=productdetails&id={$serviceid}&dosinglesignon=1&app=SSL_TLS_Status" target="_blank">
SSL Status
</a>
</div>

This works great for native cpanel pages and features. But I can't find a Jetbackups equivalent to this user_link variable so the code would look like this example. (which obv doesn't work)

<div class="col-md-3 col-sm-4 col-xs-6 col-6" id="Jet_Backups">
<a href="clientarea.php?action=productdetails&id={$serviceid}&dosinglesignon=1&app=Jet_Backups" target="_blank">
Jet Backups
</a>
</div>

Is there a way to find that?

Thanks!
JetAppsRichard
Staff Member
Staff Member
Posts: 97
Joined: January 1st, 2021, 12:51 am

Re: trying to add jetbackup shortcut to whmcs client area

Post by JetAppsRichard »

Hello allwebnow,

I notice you are using the following cPanel WHMAPI command:

Code: Select all

whmapi1 get_users_links user=allwebstage
This command, from the cPanel API docs, returns "a list of application keys (appkeys) and the URLs that correspond to applications for the cPanel user's theme." In order to have JetBackup URL's appear in this list you must add the "implements" key/value to JetBackup's `install.json` file and run the following cPanel install plugin script:

Code: Select all

/usr/local/cpanel/scripts/install_plugin
You can find the JetBackup Plugin Install Package in the following locations:

JetBackup 4:

Code: Select all

/usr/local/jetapps/install/jetbackup/cpanel_plugins_paper_lantern.tar.gz
JetBackup 5:

Code: Select all

/usr/local/jetapps/install/jetbackup5/cpanel/jetbackup5_cpanel.tar.gz/
You will need to extract the found .tar.gz folders in order to edit the "install.json" file. You can follow cPanel's guide at https://documentation.cpanel.net/displa ... el+Plugins for more information about how to add the "implements" key to the objects within the "install.json" file.

After all edits have been made recompress the files with the same naming format as before and run the install_plugin script like the following:

Code: Select all

/usr/local/cpanel/scripts/install_plugin COMPRESSED_FILE.tar.gz --theme USERTHEME
The `get_users_links` command will then have the JetBackup URLs included in the response with the value you assigned for "implements". Let us know if you have any further questions or concerns!
Best Regards,
Richard, JetApps Team
allwebnow
Posts: 5
Joined: March 20th, 2021, 7:58 pm

Re: trying to add jetbackup shortcut to whmcs client area

Post by allwebnow »

ahh thank you!

So does this look right attached? I got it from this page (which was a link on the page you posted about "implements")
https://documentation.cpanel.net/displa ... +and+Later

Also if I pack this up again and reinstall, in theory, nothing in jetbackups will happen with the current installation (nothing will reset or anything) correct?

Also what do i put in USERTHEME in the install command here --theme USERTHEME? Paper_Lantern?

Lastly, is it possible to just add this by default for future releases so users/businesses have this appkey at their disposal without having to do this?
Attachments
pic705.jpg
pic705.jpg (60.22 KiB) Viewed 2708 times
JetAppsRichard
Staff Member
Staff Member
Posts: 97
Joined: January 1st, 2021, 12:51 am

Re: trying to add jetbackup shortcut to whmcs client area

Post by JetAppsRichard »

Hello,
So does this look right attached?
For JetBackup 4 the first object inside the install.json file is of type "group" and does not have a "uri" element that can be used with the whmapi1 call. You will need to add the "implements" element to the objects that are of type "link" and have an "uri" element set. For example, if you want the URL for the jetbackup 4 main page you would add the implements element to the following object located at the bottom of the install.json file:

Code: Select all

{
      "icon" : "jetbackup_single.png",
      "group_id" : "files",
      "order" : 0,
      "name" : "JetBackup",
      "description" : "Manage and Restore your account information from backups",
      "type" : "link",
      "id" : "jetbackupsingle",
      "uri" : "jetbackup/index.html#!/",
      "implements" : "JetBackup_Index"
}
This URL would lead to the page showed in the attached image:
jetbackup4index.PNG
jetbackup4index.PNG (36.64 KiB) Viewed 2699 times
Also if I pack this up again and reinstall, in theory, nothing in jetbackups will happen with the current installation (nothing will reset or anything) correct?
Yes, we have tested this on our internal servers and did not find any issues with our jetbackup installations after running the cpanel plugin install script.
Also what do i put in USERTHEME in the install command here --theme USERTHEME? Paper_Lantern?
Apologies for any confusion. USERTHEME will be whatever theme you are using for the end users. It appears based on your configuration you are using paper_lantern so you would replace USERTHEME with paper_lantern. A full example command we used on our test servers was the following:

Code: Select all

/usr/local/cpanel/scripts/install_plugin /usr/local/jetapps/install/jetbackup5/cpanel/jetbackup5_cpanel.tar.gz --theme paper_lantern
Lastly, is it possible to just add this by default for future releases so users/businesses have this appkey at their disposal without having to do this?
We have noted this to our developers and have opened an internal git issue to have these changes implemented in future releases so that no customization would be required by the user.

Please let us know if you have any other questions and thank you for your continued support of our product!
Best Regards,
Richard, JetApps Team
allwebnow
Posts: 5
Joined: March 20th, 2021, 7:58 pm

Re: trying to add jetbackup shortcut to whmcs client area

Post by allwebnow »

Thank you for this!

So it's the bottom code that needs to be changes (not the top)? See attached on mine...

Also thanks for all the other explanations.
Attachments
pic710.jpg
pic710.jpg (91.93 KiB) Viewed 2698 times
allwebnow
Posts: 5
Joined: March 20th, 2021, 7:58 pm

Re: trying to add jetbackup shortcut to whmcs client area

Post by allwebnow »

oh my goodness! I ran the installer and it actually worked! Thank you!!
JetAppsRichard
Staff Member
Staff Member
Posts: 97
Joined: January 1st, 2021, 12:51 am

Re: trying to add jetbackup shortcut to whmcs client area

Post by JetAppsRichard »

So it's the bottom code that needs to be changes (not the top)? See attached on mine..
The attached code you provided is correct.

You are welcome! Glad to see it worked for you as well!

If you ever have any more questions or concerns please let us know.
Best Regards,
Richard, JetApps Team
allwebnow
Posts: 5
Joined: March 20th, 2021, 7:58 pm

Re: trying to add jetbackup shortcut to whmcs client area

Post by allwebnow »

Yes thank you! One last question to see if you have any insight on.

Do you know how to get the "zone_editor" app_key implements added when you run the command: whmapi1 get_users_links user=user

When I run that command, it does not come up. Here's the documentation for app_keys but I don't know how to add it on our server. I'm assuming it would be similar to the way we added it with yours using an install.json file or something but I have no idea where to even start since it's not related to jetapps install.json file.

https://documentation.cpanel.net/displa ... +-+Appkeys

Let me know if you have any knowledge of at all or point me in the right direction. The cpanel docs don't make sense to me.
JetAppsRichard
Staff Member
Staff Member
Posts: 97
Joined: January 1st, 2021, 12:51 am

Re: trying to add jetbackup shortcut to whmcs client area

Post by JetAppsRichard »

Hello,

Unfortunately, from reading their documentation, it appears the methods we used to add the JetBackup app_key are only valid for adding "plugins" app_keys. After some further research I was able to find a uapi command that was able to list a partial URL for zone_editor:

Code: Select all

uapi --user=username Branding get_application_information app_key='zone_editor'
I was able to find this command here: https://api.docs.cpanel.net/openapi/cpa ... formation/

This command returned the following URL:

Code: Select all

... 
 url: zone_editor/index.html
 ...
 
This may not be exactly like the other URLs that we were able to fetch from the whmapi1 command but it is a good start. I would suggest reaching out to the cPanel forums for further assistance if needed.

I hope you find this information helpful and let us know if you have any further questions.
Best Regards,
Richard, JetApps Team
Post Reply