WHMCS Service Information Display
WHMCS Service Information Display
Category
WHMCS Modifications
WHMCS
Database
PHP
Hooks
Service
Information
Display
Username
Password
Server
In WHMCS v5, there was an area of the template where 'service information' was shown. I'm referring to the username, server, domain, etc. With the v6 template, this disappeared. Using this action hook, you can return theWHMCS service information display to your clients. Take a look. As always, if you have questions, please do contact us. If you want something custom developed, or customized, again, please do contact us. We're absolutely here and ready to help however we can.
The problem:
Sometimes, clients just need a reminder of what their password is, what their server, or username is. It's natural. This is why this information was originally provided in v5. Unfortunately, it was removed from the secondary sidebar in v6.The solution:
This hook will return the WHMCS service information display to the sidebar in v6, but ONLY if the client is on a page where it should be shown. This will show the following information- Username
- Password
- Domain
- IP Address
- Hostname
- NS1
- NS2
Usage:
Simply copy and paste the following code into a php file in your includes/hooks directory:
<?php
use WHMCS\View\Menu\Item as MenuItem;
use Illuminate\Database\Capsule\Manager as Capsule;
/* Add credentials to the end of all secondary sidebars. */
add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar)
{
/* Get the credentials. */
$service = Menu::context('service');
$username = "{$service->username}";
$serverid = "{$service->server}";
$domain = "{$service->domain}";
$password = "{$service->password}";
$server = Capsule::table('tblservers')->where('id', '=', $serverid)->pluck('hostname');
$ipaddress = Capsule::table('tblservers')->where('id', '=', $serverid)->pluck('ipaddress');
$name1 = Capsule::table('tblservers')->where('id', '=', $serverid)->pluck('nameserver1');
$name2 = Capsule::table('tblservers')->where('id', '=', $serverid)->pluck('nameserver2');
$password = decrypt($password);
/* If the username isn't empty let's show them! */
if ($username != '') {
/*
Add a panel to the end of the secondary sidebar for credentials.
Declare it with the name "credentials" so we can easily retrieve it
later.
*/
$secondarySidebar->addChild('credentials', array(
'label' => 'Service Information',
'uri' => '#',
'icon' => 'fa-desktop',
));
/* Retrieve the panel we just created. */
$credentialPanel = $secondarySidebar->getChild('credentials');
$credentialPanel->moveToBack();
/* Show the username. */
$credentialPanel->addChild('username', array(
'label' => $username,
'order' => 1,
'icon' => 'fa-user',
));
/* Show the password. */
$credentialPanel->addChild('password', array(
'label' => $password,
'order' => 2,
'icon' => 'fa-lock',
));
/* Show the password. */
$credentialPanel->addChild('domain', array(
'label' => $domain,
'order' => 3,
'icon' => 'fa-globe',
));
/*show the server IP*/
$credentialPanel->addChild('ip', array(
'label' => $ipaddress,
'order' => 4,
'icon' => 'fa-info',
));
/*show the server name*/
$credentialPanel->addChild('server', array(
'label' => $server,
'order' => 5,
'icon' => 'fa-server',
));
/*NS1*/
$credentialPanel->addChild('name1', array(
'label' => $name1,
'order' => 6,
'icon' => 'fa-info-circle',
));
/*NS2*/
$credentialPanel->addChild('name2', array(
'label' => $name2,
'order' => 7,
'icon' => 'fa-info-circle',
));
}
});Now, take a look at your client's service page. You should see an additional sidebar with this WHMCS service information display. See below

Reactions
Search
Categories
All Posts
All Categories
Business
7
development
15
News
2
Template modifications
2
Tips and Tricks
7
Uncategorized
2
WHMCS Modifications
17
Tags
Adding 2
Addon 1
Addons 7
Admin 1
Admin Area 5
Ahead 1
API 2
Around 1
Authentication 1
Barely 2
Basics 1
Bumps 1
Business 3
Capsule 1
Certificate 1
Changing 1
Client 1
Client Area 10
Coming 2
Communicating 1
Corner 1
cPanel 1
Cron Jobs 1
Cron Notifications 3
Database 12
development 12
Disabling 1
Discord 1
Display 1
Domain 3
Domains 3
Downs 1
Email 7
Extended 8
Factor 1
Farewell 2
Files 1
Further 1
GDPR 1
Hooks 7
Increase 1
Information 1
Invoice 1
Invoices 5
IP Control 3
Keeping 1
Laravel 3
Licensing 1
Logged 1
Login 1
Major 1
Modifications 1
Modules 10
Mynewaddon 1
MySQL 3
new platform 1
new site 1
News 2
Notification 2
Notification Methods 1
Notifications 9
Notify 10
Notify Extended 20
Password 1
PHP 15
Problem 1
Problems 1
Productivity 1
Pushalot 1
Pushbullet 1
Pushover 3
Queries 3
Quick 2
Renew 1
Renewal 1
Right 1
Schema 1
Security 4
Server 1
Service 1
Serving 1
Slack 2
Sneak 1
Speed 1
SSL 2
Stuff 1
Support Tickets 3
Telegram 2
Template 1
Templates 8
Tickets 8
Tips and Tricks 11
Tools 2
Track 1
Tricks 11
Troubleshooting 2
Twilio 5
Two Factor Authentication 1
Understand 1
Understanding 1
Uniquecolumn 1
updates 1
Upgrade 2
Upgrades 1
Upgrading 1
Username 1
Users 1
v3 1
Webhooks 1
website 1
Welcome 8
WhatsApp 8
WHMCS 51
whmcs guru 1
WHMCS Notify 19
WHMCS Notify Extended 18
WHMCS User 3
WHMCS User and IP Control 3
Wrong 1