Jump to content

markhughes

Member
  • Posts

    28
  • Joined

  • Last visited

About markhughes

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

markhughes's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. Are you trying to decrypt the password of a client? You can't. You can only decrypt service and server passwords/hashes. The client passwords are a one-way hash, using bcrypt. You can't even use a rainbow table as they are all attached with a unique salt. You generally use GetClientPassword to set a session. What are you trying to do?
  2. You have to use the new WHMCS\ClientArea class now. See this: https://developers.whmcs.com/advanced/creating-pages/
  3. Yes. Passwords for servers are reversible, if you use them. cPanel and some other software offers an access hash which you can restrict to IPs (aka, the WHMCS server) - so you would just use the username + access hash. You don't have to use the root password in this case! Actually, never use the root password or root account. Create a reseller account with root reseller privileges. If we don't have a password or access hash for the server you can not use automatic setup. Your password is encrypted with the hash set in your configuration file (do not change this) so other installations of WHMCS can not decrypt your passwords or hashes. See "Add a cPanel Server": http://docs.whmcs.com/CPanel/WHM#Adding_a_cPanel_Server I am fairly sure you can create a new Plesk reseller account with a different username and also restrict its IP to the WHMCS installation.
  4. I prefer putting things into modules than the hooks folder personally, seems more organised IMO! But then again I guess I tend to organise all my modules a little oddly too If you wanna add my on Skype or something just so you can test it quickly when I'm done? Won't charge you for it, just a better communication method
  5. Chris, This wiki page needs to be updated too: http://docs.whmcs.com/Premium_Domains#Hooks
  6. There is not an API method for this sadly. But what is your use case here? I have built Office365 OAuth integration that automatically creates the account in WHMCS etc - it's not documented, but you have to use the internal classes. I had to use the PHP function get_class_methods to find out how to do it. Is this what you're trying to do?
  7. I think we need some more information to understand whats happening: How does your javascript handle the result? Were there any PHP errors? Do you get "Email exist" or "false"? Why are you passing stats to ValidateLogin? A different array should be used for each request. I know WHMCS has logged me out when I call functions incorrectly or POST to pages incorrectly - so maybe something like that is happening. Heres an example: $values = [ "email" => $_POST["email"], "password2" => $_POST["password"] ]; // .. do call to ValidateLogin $values = [ "clientid" => $clientId, "email" => $email, "stats" => true ]; // .. do call to GetClientsDetails You could print_r the $results variable of validatelogin so we can verify it was a sucessful login?
  8. As well as ensuring your 3rd modules don't use the older ioncube encoder, its also important to make sure they aren't using the deprecated mysql_ package. (e.g. using functions like mysql_query, mysql_connect - it should be mysqli_query, mysqli_connect, etc) - or even better, PDO. As this has been removed all together in PHP 7. Theres some other stuff too: https://secure.php.net/manual/en/migration70.incompatible.php PHP 7 is faster. No questions asked, it is even faster than HHVM in many cases. We're not talking "the page will load 100x faster" but it will probably shave 1-2 seconds off page load time for heavy scripts (which is still really good) Take a look at this too: https://www.zend.com/en/resources/php7_infographic
  9. Using the cloudflare CDN should help you in regards to speeds from all geographic locations. But you will need to keep the fontawesome fonts if you wish to keep using the fontawesome icons
  10. We've used the module by Edge Hosting with one of our setups: https://edgehosting.uk/whmcs-xero-addon The Xero clients already existed and so did some invoices - a few years worth of existing data actually. But it worked it all out and synced everything perfectly first time round.
  11. It shouldn't be getting called twice though, this sounds like a bug. Are you sure you don't have duplicate code anywhere?
  12. Do you have the Stripe module on WHMCS? If so, you don't have to use the Stripe API you can just add cardtype, cardnum, expdate, and cvv to AddClient and the Stripe module will take over and update store the card remotely for you. But if you want to do it outside of WHMCS part you will need to store it using a database query.
  13. No worries! So with PHP I always start with my opening tag <?php on my first line. It's not required at the end of a document though, I think its best just to drop it unless you want to insert some html. Just some notes: After 'deptid' => $vars['deptid']) you forgot your end semicolon Your logActivity call is going to be called multiple times. Did you only want it called once? I would put it outside the loop. The first variable used in your add_hook is missing its first quote. Do you have $AdminUser defined for your localAPI function? I usually create a seperate WHMCS account called "api" and put it in it's own role called "API Only" with all it's permission unticked except for "API Access" (this permission grants all privileges on the API). I would not use a user from the loop to access the API - they probably won't have API Access (and shouldn't, for security purposes) BUT that API method will send an email to ALL admins. You will have to use the internal function sendAdminMessage for this. function Support_Admin_Reply_Notification_Function($vars) { $mergefields = [ 'messagename' => 'Admin Ticket Reply', 'ticket_id' => $vars['ticketid'], 'ticket_department' => $vars['deptname'], 'ticket_subject' => $vars['subject'], 'ticket_priority' => $vars['priority'], 'ticket_message' => nl2br($vars['message']), 'type' => 'support', 'deptid' => $vars['deptid'] ]; foreach (\WHMCS\User\Admin::all() as $admin) { if (in_array($vars["deptid"], $admin->supportDepartmentIds)) { sendAdminMessage("Admin Ticket Reply", $mergefields, null, $admin->id); } } } You can find the current admin username that is send the ticket in $vars["admin"] Because this is a support email they must have support emails enabled. If you're not a developer I'm happy to package this into a module for you.
  14. InvoiceCreated has been dodgy for me in the past. I think we need a WHMCS developer to come to a peek. How does InvoiceCreation work for you? InvoiceCreation is before the invoice is sent. It has worked for me in the past (I'll do some testing later)
×
×
  • 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