Jump to content

Get client data in custom page


Eliav

Recommended Posts

Hi there,

I am looking for a way to get some of the client data in a custom page for my WHMCS install.

I currently want a list of all hosting accounts that are a specific type (like id=22 or something). The best thing would be getting the usernames of the client's hosting packages- in an array or something else.

I can easily do this in my own mysql query, but I wasn't sure if it did it already, and I also need to get some client data to use for the WHERE section of the mysql query.

If I am making no sense at all, let me know and I will try to explain it in another way.

 

Thanks!

Link to comment
Share on other sites

Okay, I figured out how to do what I wanted.

Let me know if there is an easier way, but I just used:

$id = $clientsdetails['id'];

$q1 = mysql_query("SELECT username FROM tblhosting WHERE userid = '$id' ");

$r1 = mysql_fetch_array( $q1 );

$username = $r1['username'];

 

That gives me the username of the hosting account of the current user that is logged in.

For those who need other variables, you can just change the SELECT statement to what you need or use *.

Link to comment
Share on other sites

Okay, another problem.

I need a way to decrypt the server password located in the mysql database (I am adding some server functions that are not yet implemented in WHMCS).

I am not sure what API method you use for the servers, so I just used the PHP one on Direct Admin.

If you are using the same one, that would make things easier (just let me know how to use your current config). If not, then is there a way I can decrypt my server password to login to the server from my own file?

I have everything else worked out the way I need it to, but I just need to get the passwords working (so I dont have to store server passwords in a file and so I dont have to manually edit the file everytime I add a new server).

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated