Jump to content

WHMCS Peter

WHMCS Staff
  • Content Count

    117
  • Joined

  • Last visited

  • Days Won

    2

WHMCS Peter last won the day on May 20

WHMCS Peter had the most liked content!

Community Reputation

18 Good

2 Followers

About WHMCS Peter

  • Rank
    WHMCS Junior Developer

Recent Profile Visitors

2214 profile views
  1. Hi @SwiftModders LLC, You should ideally not use these directly. Instead, use code like the following: <?php use WHMCS\Authentication\CurrentUser; $userId = null; $clientId = null; $ownsClientAccount = false; // User will return the WHMCS\User\User model if the user is logged in. Otherwise, returns null. $user = CurrentUser::user(); // Client will return the WHMCS\User\Client model if a client is selected/in use. Otherwise, returns null. $client = CurrentUser::client(); if ($user) { $userId = $user->id; } if ($client) { $clientId = $client->id } if ($user && $client) { if ($user->isOwner($client)) { $ownsClientAccount = true; } } There should be no need to utilise the session data. Wherever possible, it's best not to interact directly with WHMCS session variables.
  2. Hi @DennisHermannsen, This did not work because CurrentUser::client() returned null. This means that no Client was currently logged into by the user. You should ensure that a Client exists first. Give this a try: use WHMCS\Authentication\CurrentUser; add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $primaryNavbar) { $user = CurrentUser::user(); $client = CurrentUser::client(); if ($user && $client && $user->isOwner($client)) { // User is logged in, and a Client is present. Run your code. } }); I've added && $client to the conditional. Meaning that if either a User or Client is not present, the code will not run and the isOwner call will not be reached.
  3. So “Clients” are not “Login-able” entities anymore. Only users have a password for example. What I think you are looking to do is identify the owner, over other authorised parties. Would that be right? If so, you may wish to use CurrentUser::user() to grab the user, and then check the owner like so: <?php use WHMCS\Authentication\CurrentUser; $user = CurrentUser::user(); if ($user && $user->isOwner(CurrentUser::client()) { // logged in as the “owner” of this client account. }
  4. Hey! isOwner will return true if this user is the owner of the client account. You should use user() to verify a user is logged in, such as: if (CurrentUser::user()) { // I am logged in } See: https://classdocs.whmcs.com/8.0/WHMCS/Authentication/CurrentUser.html
  5. Hi @icttech Thanks for bringing this to our attention. I can confirm that this file is safe. You can confirm this by running the following command: md5sum vendor/whmcs/whmcs-foundation/lib/Carbon.php I would expect the following result: 4d59dd5683e6a6bbf745cd57db5196e1 This confirms you have a legitimate copy of the file in WHMCS v8.0 RC2 which has been unaltered. I recommend reaching out to CXS to report the false positive. Thanks again for reaching out!
  6. Hey Dennis! I can confirm that this documentation is due to be available shortly and has been written. Our Documentation has to go through a few stages before it reaches the public domain, but it’s on its way!
  7. No worries! Thanks very much for letting us know! I'm glad you've resolved it!
  8. Hi @ThemeMetro Would you be able to advise us on what the cause of your error was, and the resolution so that we can update anybody else who runs into this issue?
  9. This notice is intended for users currently testing WHMCS v8.0 Beta 1. If updating from v7.10.2 or earlier, or from Beta2/RC1 this issue will not apply. During testing of the latest Beta release, an issue was identified for users on Beta 1. An error may be encountered whilst retrieving the latest version of the software via the Automatic Updater. This issue will present itself with an error, similar to the following: Error (Help Documentation) Error: f3fa0f1ea635a9195e33 934ca495991b7852b855, control: e8bb6c2d0241a1288d4c62ddf62cc7395480c28347f9 Incorrect hash! Received file: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b In ValidatedZipDownloader.php line n/a: - Installing whmcs/whmcs (8.0.0-beta.3):Downloading(100%)Validating /home/********/whmcs/vendor/whmcs/whmcs/1d14ecb1090a66f8c826c81b839001f9.zip Package operations: 1 install, 0 updates, 0 removals Updating dependencies Loading composer repositories with package information To utilize the Automatic Updater when updating to WHMCS v8.0 Beta 3 - You will first need to apply the attached hotfix, which will resolve the issue shown above. To apply this hotfix, please unzip the contents and place them into your WHMCS directory, overwriting the existing files. Thanks for taking the time to test our Beta version of WHMCS v8.0! CORE-15039_Guzzle-deferred-fetch-errors.zip
  10. Hey Bear. Intriguing. Could you share your browser and its respective version? Could you also share with me if you see any console errors in the browser developer tools?
  11. Hi @ju5t, Here's an SQL query which would allow you to export the affected customers directly from the database, to CSV for upload to a service such as MailChimp for your email blast: SELECT `firstname`, `lastname`, `email` FROM `tblclients` WHERE `id` IN (SELECT `userid` FROM `tblhosting` WHERE `server` = SERVER_ID_HERE AND `domainstatus` IN ('Active', 'Suspended')); Replace SERVER_ID_HERE with the affected server ID from tblservers. You can see this by editing a server too, in the address bar. Use your favourite tool (such as PHPMyAdmin) to export this data to .csv and upload it per MailChimps requirements. Hopefully this is a viable workaround for you.
  12. Hi @bear, That's certainly strange! As a test, can you try (or have you tried?) replacing your current "admin" directory with a fresh copy from a new install ZIP at https://download.whmcs.com This will confirm for sure if the issue lies in your template edits or not. If that resolves it, you can start re-applying any changes you had made until it happens again. If it doesn't, let me know which browser you're using and I'll see if I can reproduce any issue. If I can, I'll provide a resolution here.
  13. Hi there! I'm sorry that you feel you have had a less than optimal experience. I have reviewed your ticket and can see that our Level 2 analysts have been assisting you with your issue. In regards to these errors: PHP Warning: Module 'imap' already loaded in Unknown on line 0 PHP Warning: Module 'mbstring' already loaded in Unknown on line 0 PHP Warning: Module 'soap' already loaded in Unknown on line 0 PHP Warning: Module 'xmlrpc' already loaded in Unknown on line 0 These are caused by a PHP configuration misconfiguration. Not WHMCS. This indicates that you have multiple lines trying to load these modules when they can of course only be loaded once. To resolve this, you would need to reach out to your qualified System Administrator and have them review your PHP configuration. They will be able to provide you with the required help you need in regards to those issues as they are System Configuration issues, not WHMCS issues. We would love to have been more helpful with this issue, but unfortunately, we aren't qualified System Administrators and of course, as you know, every server can be different. This is why having a System Administrator on hand can be useful. In case you don't already have a System Administrator, the cPanel Forums have a useful Sys Admin listing which you may find helpful: https://go.cpanel.net/sysadmin Have a great day! Peter
  14. Hi @J-B, I've just responded to you in your support ticket, #UAS-174768. I have answered all of your questions. For your ideas on how the module could be improved, I would encourage you to please submit a request to our feature requests tracker where other users can contribute to and vote on your idea. Ideas with the most votes and activity do get reviewed by our team. https://requests.whmcs.com/topic/management-function-for-direct-debits-gocardless
  15. Hi, I have removed your attachment from your original post, deleted your most recent reply and added the code in a codeblock in your original post. Please do provide code-snippets, rather than attachments as many people will not trust the authenticity of them. At this time, WHMCS does not support the adding of custom card types due to internal validation server-side. Your code will simply update the client-side validation. There is no way to work around this at this time. I'd recommend opening a Feature Request as I can see how the ability to add support for custom card types would be useful: https://requests.whmcs.com/
×
×
  • 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