I'm doing some minor changes to our client clientareahome.tpl to display list of available hosting services associated with this user no client area home page, using the {$customerHostingData} that is already available on the page through a hook,
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
function hook_pullingLastCustomerWebsite($vars){
$client = Menu::context('client');
$hostingData = Capsule::table('tblhosting')
->where('userid', $client->id)
->where('domain','<>','')
->select('id','domain','domainstatus','packageid')
->orderBy('id', 'DESC')
->get();
$encodedata = json_encode($hostingData);
$decodedata = json_decode($encodedata, true);
return array("customerHostingData" => $decodedata);
}
add_hook("ClientAreaPageHome", 1, "hook_pullingLastCustomerWebsite");
i was able to loop through the {$customerHostingData} array as {$site} and display all the information i need my customers.
This is my $customerHostingData as provided by WHMCS default installation
array(5) {
[0]=>
array(4) {
["id"]=>
int(1856)
["domain"]=>
string(19) "example.net"
["domainstatus"]=>
string(6) "Active"
["packageid"]=>
int(1)
}
[1]=>
array(4) {
["id"]=>
int(1851)
["domain"]=>
string(17) "example2.net"
["domainstatus"]=>
string(6) "Active"
["packageid"]=>
int(54)
}
[2]=>
array(4) {
["id"]=>
int(1481)
["domain"]=>
string(12) "example3.net"
["domainstatus"]=>
string(6) "Active"
["packageid"]=>
int(54)
}
[3]=>
array(4) {
["id"]=>
int(1320)
["domain"]=>
string(17) "example4.com"
["domainstatus"]=>
string(6) "Active"
["packageid"]=>
int(54)
}
[4]=>
array(4) {
["id"]=>
int(667)
["domain"]=>
string(24) "example5.com"
["domainstatus"]=>
string(6) "Active"
["packageid"]=>
int(54)
}
}
Now i have implemented a login button on every hosting account on the list to redirect customer to their website dashboard URL
URL: can be http or https://{$site.domain}/dashboard/login
the problem that i'm facing with the code above is that the {$customerHostingData} array do not contain any information about the ssl status on account, to basically i cant check if the ssl is active or not?
So how can i make this type of check to determine which hosting account on the array has active SSL certificate?
Any ideas?