Single Sign-On
With this feature, the client or administrator will access the hosting control panel with one click via the service detail.
If you add these functions to the class, the enter button will appear automatically in the service detail.
There is no return value, it will reflect the output of the function to the user when the enter link is clicked.
Separate functions are used for the client and the administrator.
Sample Function for Client Panel
public function use_clientArea_SingleSignOn()
{
$api_result = 'OK|bmd5d0p384ax7t26zr9wlwo4f62cf8g6z0ld';
if(substr($api_result,0,2) != 'OK'){
echo "An error has occurred, unable to access.";
return false;
}
$token = substr($api_result,2);
$url = 'https://modulewebsite.com/api/access/'.$token;
Utility::redirect($url);
echo "Redirecting...";
}
Sample Function for Administrator Panel
public function use_adminArea_SingleSignOn()
{
$api_result = 'OK|bmd5d0p384ax7t26zr9wlwo4f62cf8g6z0ld';
if(substr($api_result,0,2) != 'OK'){
echo "An error has occurred, unable to access.";
return false;
}
$token = substr($api_result,2);
$url = 'https://modulewebsite.com/api/access/'.$token;
Utility::redirect($url);
echo "Redirecting...";
}