Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by twhiting9275

  1. Hi @WHMCS ChrisD Did this upgrade get made?
  2. On an unrelated (??) note.... Same thing happened when I tried to paste php code into a ticket yesterday. Same, exact, thing. so, both forums and tickets have been essentially made worthless at this point 😞 I get the need for security, believe me, but, there's a point when it's just too much, and it makes the services unusable. No, I won't be using pastebin, or txt files. I simply won't be addressing those threads or helping there. Doesn't affect me at all. When you make life harder on those trying to help, especially in a community, you find that fewer people are willing to help
  3. This thread is over 2 years old now. You need to start your own, as this is not likely the same issue. Hijacking threads, not cool.
  4. I don't disagree, and I have a feeling that's why people like Brian , as well as myself stopped coming around to help. I still do, every once in a while, but things like this make it impossible to actually provide community help here. My only point in this thread was to bring it up so that it could be hashed out. If it's not, that's on staff.
  5. This is a poor response. I mean, really there is plenty that can be done about it. The whole point of modsec is that rules can be enabled or disabled, even edited so that one doesn’t have to use those outside resources
  6. Not sure what happened, or when, but trying to upload common code, or paste it into a code block is, literally, blocked. Request is met with a 403 This was working fine just a year or so ago, but same code , not able to be pasted today. No hacking attempts here, simply trying to provide help and examples. Kind of hard to do when you can't even use basic community functionality Affected code attached as zip, but that's not really the proper approach. unpaid_invoices.zip
  7. I wrote this a few years ago. Just tried it on 8.6 and it still works like a charm If client has an overdue invoice (with grace period added), it doesn't block them from the client area (you don't really want that), it simply redirects them to the invoice page so they can pay it. Unzip, upload php to includes/hooks/ and you're good to go. unpaid_invoices.zip
  8. The WHMpress plugin can be safely removed from WHMCS. It's only purpose, really, is to redirect people to your WordPress page . You can still use the WHMpress features in WordPress (package listing , ordering, even the account stuff) directly from the Wordpress page. The only thing that this plugin for WHMCS does is force individuals to use thw WP site.
  9. This is definitely not a "fix" or "solution" to anything. It's intended to be used as a temporary, or stopgap method to attempt to see iif those are the issues. You need to find a real resolution, and stop hijacking years old threads.
  10. Going to have to roll back to backup, then try a manual update.
  11. It's possible to do . A query like this will do it: $productid = "INSERT PRODUCT ID HERE"; foreach (Capsule::table('tblhosting')->WHERE('packageid', '=', $productid)-> WHERE('domainstatus', '=', 'Active')->get() as $orderlist) { $userid = $orderlist->userid; $server = $orderlist->server; $domain = $orderlist->domain; $paymentmethod = $orderlist->paymentmethod; $billingcycle = $orderlist->billingcycle; $nextinvoicedate = $orderlist->nextinvoicedate; $amount = $orderlist->amount; print ("$userid: $server : $domain: $paymentmethod: $billingcycle: $nextinvoice: $amount<br />"); } Implementation is going to be on you, but this will get you started
  12. This isn't really a WHMCS question, more like a general programming/development question You'll need to put together a custom form handler to parse the response, and interact with each field as necessary.
  13. I mean, this is a billing system. These emails are somewhat important to receive. If they're dead set on not getting these though, you'll have to write a custom hook . Start by looking at EmailPreSend and work on from there. The following hook will get you to completely disable mail. You'll have to add custom user fields and then get this checked against those. You have the tools, go forth and learn to do it. <?php function no_invoice_email($vars) { $messagename = $vars['messagename']; $merge_fields['abortsend'] = TRUE; return $merge_fields; } add_hook("EmailPreSend",1,"no_invoice_email"); ?>
  14. huh? If you could elaborate, I'm sure you'd get better assistance here. What, exactly are you seeing, and what, exactly are you trying to prevent?
  15. If your module isn't compatible with the latest version of WHMCS, then you should contact the developer of the module, not hold back updating. That's just silly. A well done module won't break when WHMCS is updated, or, if it does, the developer will get on it as soon as possible. You just have to let them know
  16. Welcome to corporate life. This is very, very true, unfortunately. Surprised there hasn't actually been an addon built to deal with this already 🤔 If only I wasn't in the middle of about a zillion other projects at the moment. Good things on the way, Berry good things!!
  17. Just tested in 8.4.3 and it absolutely is working. Make sure you're using the code from this post , and that you're not logged in as admin (or have admnotify set to TRUE at the top)
  18. Double check your code. Dependency files, everything. Try running them through a debugger 1 by 1. 10:1, if the upgrade function isn't working, it's because something, somewhere , is broken inside code, and it can't work. I've seen this way, way too many times over the years
  19. Just out of curiosity, when was the last time you were able to get DecryptPassword to work for passwords (not encrypted strings). I do believe something's changed in the last few releases, as it does not accurately decrypt passwords any more. At least where WHMCS is concerned. Don't have access to cPanel at the moment to test this It used to do this, but they've changed something, somewhere
  20. On the subject of customizing with things like 'location': It's important to understand that this is not reliable. This is why this was originally left out of the hook. IP location relies on third party services, and the IP owner, actually being up to date and honest. When it comes to location, outside of the US, not terribly accurate. Even inside of the US , it can be inaccurate . Hell, I just checked my own IP against some of the popular sites claiming to be accurate, about a 30% failure rate as far as accuracy goes This is another one of those points of failure and confusion.
  21. 'not that hard is subjective, and you didn't provide any information in your post at all. Again, it's not documented. I had to read through it a couple times, and I've been dealing with WHMCS for a number of years If the user has to do more than copy and paste something into a file, in today's world, you're going to run into issues, and of course, those are passed on to others, and make finding and resolving problems even harder. When it comes to things like this, follow the KISS principle (look it up), and you'll have fewer problems. More working parts, more components, more chances of breakage and confusion
  22. <?php /* Client area login notifications for WHMCS (works with versions 6-8) Created by whmcsguru Contributions by brian! */ use WHMCS\Database\Capsule; $myver = get_whmcs_version(); $isadmin = $_SESSION['adminid']; $admnotify = FALSE; //change this to true you want to send notifications when admin logged in.. //NOT advisable. this will let your clients know when you're logging into their account if (!empty($isadmin)) { if (!$admnotify) { return; } } function hook_client_login_notify($vars) { $mailsent=FALSE; global $myver; $myver = get_whmcs_version(); if ($myver < 8) { $userid = $vars['userid']; send_login_notify($userid); return; } if ($myver >= 8) { $user = $vars['user']; $userid = $user->id; //a dirty hack to try to work around a couple of things, maybe $acctowner = Capsule::table('tblusers_clients') ->where('auth_user_id', '=', $userid) ->where('owner', '=', 1) ->count(); $numrows = Capsule::table('tblusers_clients') ->where('auth_user_id', '=', $userid) ->count(); //we own our account. We must always notify us directly if ($acctowner > 0) { send_login_notify($userid); return; } //we don't own our account, so, notify the owner, if we only exist once. if ($numrows < 2) { foreach (Capsule::table('tblusers_clients')->WHERE('auth_user_id', '=', $userid)->get() as $userstuff){ $userid = $userstuff->auth_user_id; $clientid = $userstuff->client_id; $owner = $owner; if ($acctowner < 1) { send_login_notify($clientid, $userid); return; } } } return; } } function send_login_notify($myclient, $theuserid="") { global $myver; $ip = $_SERVER['REMOTE_ADDR'] ; $hostname = gethostbyaddr($ip); if ($myver < 8) { $clientinfo = Capsule::table('tblclients')->select('firstname', 'lastname')->WHERE('id', $myclient)->get(); foreach ($clientinfo as $clrow) { $firstname = $clrow->firstname; $lastname = $clrow->lastname; } } if ($myver >= 8) { $clientinfo = Capsule::table('tblusers')->select('first_name', 'last_name')->WHERE('id', $myclient)->get(); foreach ($clientinfo as $clrow) { $firstname = $clrow->first_name; $lastname = $clrow->last_name; } } $command = "sendemail"; $values["customtype"] = "general"; if (empty($theuserid)) { $values["customsubject"] = "Account Login from $hostname"; $values["custommessage"] = "<p>Hello $firstname $lastname,<p>Your account was recently successfully accessed by a remote user. If this was not you, please do contact us immediately<p>IP Address: $ip<br/>Hostname: $hostname<br />"; } elseif ($theuserid > 0) { $moreinfo = Capsule::table('tblusers')->select('first_name', 'last_name', 'email')->WHERE('id', $theuserid)->get(); //greet them foreach ($moreinfo as $userrow) { $ufirst = $userrow->first_name; $ulast = $userrow->last_name; $uemail = $userrow->email; } $values["customsubject"] = "Subaccount Login from $hostname"; $values["custommessage"] = "<p>Hello $firstname $lastname,<p> A subaccount of yours just logged in. Please see the details of the login below <p> Name: $ufirst $ulast Email: $uemail IP Address: $ip Hostname: $hostname<br />"; } $values["id"] = $myclient; $results = localAPI($command, $values); } if ($myver < 8) { add_hook('ClientLogin', 1, 'hook_client_login_notify'); } if ($myver >= 8) { add_hook('UserLogin', 1, 'hook_client_login_notify'); } function get_whmcs_version() { $theversion = Capsule::table('tblconfiguration')->where('setting', '=', 'Version')->value('value'); $retver = substr($theversion, 0,1); return ($retver); } Updated version! 1 - there was an issue with 7.x installs pulling the greeting name (thusly causing the notification to bail) . I had the wrong table / values used in the last update. This version corrects that, and I've tested on 7.x all the way up to 8.1. All good 2 - I added an admnotify bool . This is a quick way to test that this is working, or to send notifications if you're logged in as an admin user (really not recommended, as it'll let users know when you're logging into their account, and give them your ip address). As far as templating and the like: The reason I chose not to do this (could have , years ago) was to reduce the confusion and possible areas of issues. This way, all you have to do is drop the code into a file and you're done.
  23. Please create your own thread for your modifications, rather than diluting this one. As it is, yours is not documented, and will end up causing confusion, because of this I realize that you think you're trying to improve this, but this isn't helping at all. As posted, your modification does not work, while the hook I created can indeed simply be cut and pasted into a file and works as posted on 8.0 and 8.1.
  24. This does indeed work in both 8.0 and 8.1 . Just updated (was waiting on theme devs to release an 8.1 theme) If you're not seeing this working on 8.0 or 8.1, then something is up with your install, but the hook (as of my last update) works like a charm The most common issue is going to be you being logged in to the admin area. You'll need to be logged out entirely, or use a different browser to test this. Not sure on 7.0 yet, haven't been playing around in that beast for a bit. Will do some digging on that this afternoon, as Brian did mention it seems to not.
  • 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