Sign in to follow this
Followers
0

php Get the email of the account owner.
By
JesusSuarz, in
Developer Corner
-
Similar Content
-
By JesusSuarz
Hello,
I'm trying to get some way to query if a user is online.
I don't want to know the current user.
if not something you can define for example $clientid or $userid or $emailclient ...
I am making an external site. and i need to work with user sessions. (I am making a remote connection with the api).
this function does not currently exist in the api available.
I've been seeing this: https://developers.whmcs.com/advanced/authentication/
however I do not see that it allows to define the user.
I was also seeing this: https://docs.whmcs.com/Sessions
I was able to save the cookie in the database, however I can't find any way to identify the one that belongs to each user.
any idea how I can get (which users are online?) ..
(please nothing to do with smarty, only php).
postdata: forget to tell the method I use to get user authentication in my application.
create the following code for my application:
I first make a connection to the api: https://developers.whmcs.com/api/authentication/
soon ValidateLogin: https://developers.whmcs.com/api-reference/validatelogin/
soon GetClientsDetails: https://developers.whmcs.com/api-reference/getclientsdetails/
soon CreateSsoToken: https://developers.whmcs.com/api-reference/createssotoken/
// validar usuario $command = 'ValidateLogin'; $postData = array( 'email' => $email_user, //post 'password2' => $password_user, //post ); $api_login = localAPI($command, $postData); //var de id de usuario: $api_login["userid"]; // si se encuentra el user entonces traer detalles del usuario via email $clientid = array(); // array que tiene el id del cliente if ($api_login["userid"] == true) { $command = 'GetClientsDetails'; $postData = array( 'email' => $email_user, // email login ); $details_client = localAPI($command, $postData); $clientid[] = $details_client["client_id"]; } // variable del clientid es: $clientid[0]; // crear token de session $command = 'CreateSsoToken'; $postData = array( 'client_id' => $clientid[0], ); $results_ssotoken = localAPI($command, $postData); echo '<pre>'; var_dump($results_ssotoken); echo '</pre>'; this will create the url with (CreateSsoToken) where the user will be redirected for autologin, however the cookie is created only after entering the client area. that's why I don't know how to get the cookie, or identify the user.
@brian! would you help me with this?
-
By Mas-J
Dear All,
I want to show the Next Invoice Date under Next Due Date when admin access Page Client Details on Product/Services Tab.
But, I've no idea how to show it, I just know to get the Next Invoice Date value related from tblhosting
Anyone can help me to show it ? Thank you.
<?php use WHMCS\Database\Capsule; add_hook('AdminClientServicesTabFields', 1, function($vars) { $PID = $vars['id']; $nextinvoicedate = Capsule::table('tblhosting')->where('id', $PID)->pluck('nextinvoicedate'); $result = array(); $result['nextinvoicedate'] = $nextinvoicedate; return $result });
-
By ramf
Hi,
Can someone please help me with this hook?
It was created by @brian! and appeared here- but sadly he can't help me.
Since I'm selling mostly one time products - I have lots of inactive clients and I want to be able to find them easily without the hassle of changing the search toggle.
There it this feature request that was opened 2 years ago to make the hide inactive clients optional (please vote) - but until this happens I have no choice but to use this hook:
<?php add_hook('AdminAreaHeadOutput', 1, function($vars) { if ($vars['filename'] == 'clients' OR in_array($vars['pagetitle'], array(AdminLang::trans('services.title'), AdminLang::trans('services.listaddons'), AdminLang::trans('services.listdomains')))) { $autoPost = <<<HTML if ($('input#checkboxShowHidden').is(':checked')) { $('body').addClass('hidden'); $('#checkboxShowHidden').click(); } HTML; } return <<<HTML <script> $(document).on('ready', function() { if ($('input#intelliSearchHideInactiveSwitch').is(':checked')) { $('#intelliSearchHideInactiveSwitch').click(); } {$autoPost} }) </script> HTML; }); The problem with this one is that the search bar is always opened with this error - in every page loading:
So even If i'm not clicking on the search field - the search bar is opened with this message.
Can someone help me figure out what should be changed in this hook file so it will not open the search bar automatically - but when we do search we will see the inactive clients alongside the active onse?
Thanks!
-
By Eldremor
Hello, is there anyway via hook or modifying the php to add images before X configurable option name?
Example:
-
By Nelson Neoh
Hi all,
I wish to perform some registrar API activities in the registrar hooks, but as the hook's vars or params didn't provide credential details, I tried to get direct from DB Capsule and unfortunately noticed the data stored in encrypted format...
Any suggestions to over come this?
TQ.
Best Regards,
Nelson
-
-
Recently Browsing 0 members
No registered users viewing this page.