Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

11 Good

About WisTex

  • Rank
  1. The update broke the login redirect. Previously you could use the following code: <form action="/dologin.php?goto=/subdirectory/filename.php?variable=1" method="post"> And it would redirect you to https://example.com/subdirectory/filename.php?variable=1 as intended. Instead, it is redirecting you to https://example.com/filename.php?variable=1 For some reason, it is removing the subdirectory, which totally breaks our website. Can we get this fixed, please?
  2. Yes, you have to legally disclose those types of cookies, as indicated in the link to the EU government website. But the WHMCS session cookie legally does not have to be declared. The EU government even states as such. While it is true that it is better to err on the safe side to avoid fines (if you are subject to EU jurisdiction), on the other hand, if everyone has a cookie notice, then the cookie notice becomes meaningless because consumers cannot tell the difference between a website that is using exempt cookies and a website using marketing or tracking cookies. As a website operator, you should know what cookies are being generated and provide the appropriate notice. Not doing so means that you don't understand the security and data collection of your own website.
  3. I've noticed some threads about cookies and I was wondering myself about WHMCS cookies and the EU Cookie Law. I did a little digging and the cookie that WHMCS generates appears to be exempt from the law because it is necessary for the operation of the website. Or, in other words, under the law, the user's action of creating an account implies consent that a cookie is used to manage user sessions so the user can actually log in, therefore you don't have to ask for consent. http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm So, unless you are adding additional cookies, you don't need to ask for consent to use cookies. You don't have to ask for consent for a user login session cookie.
  4. Will using the DirectoryIndex directive in .htaccess affect WHMCS in any way? All the calls WHMCS tries to make seem to be directed to index.php, so there does not appear to be a problem. .htaccess DirectoryIndex main.php Is this the best way to change the default home page or is there a better way?
  5. WisTex

    Detect Logged In User Outside WHMCS

    Since I can't edit the previous post, I'd like to clarify that: This is a way to create pages that can access the WHCMS login state outside of the WHMCS root directory. Not sure if my usage of "root" in the last sentence was clear that I meant the WHMCS root, and not necessarily the root of your website.
  6. WisTex

    Detect Logged In User Outside WHMCS

    Good point. I was thinking of "outside" as being "not in the WHMCS root directory" because the documentation on how to make pages clearly states that using the example code outside of the root directory is not supported. So a more accurate statement would have been that this is a way to create pages outside of the root directory.
  7. WisTex

    Detect Logged In User Outside WHMCS

    Found the solution. The sample code provided by WHMCS assumes you want to use the WHMCS templating system. But if you do not want to use WHMCS's templating system and output your PHP code directly, then you have to take a different approach. First, you create a file in WHMCS's root directory that accesses WHMCS's session and sets variables: getuserid.php <?php // gets session variables from WHMCS require("init.php"); $ca = new WHMCS_ClientArea(); // sets userid for the logged in user. Is set to 0 if no one is logged in. $userid = $ca->getUserID() ; // sets loggedin to true if logged in, and false if not logged in. If ($userid > 0) { $loggedin = true; } else { $loggedin = false; } // if you want to test if it is working, uncomment this line. // echo "User ID = " . $userid; // if you want to test whether $loggedin variable is set, uncomment these 2 lines. // if ($loggedin) { echo "Logged in"; } // else { echo "Not logged in"; } ?> You can then include this in any PHP file you want anywhere in the file system. So if you want to put your custom code or third-party script in a subdirectory, you can. You would include the following code and then use the variable as needed. any.php <?php // use this if your file is in the same directory. require("getuserid.php"); // use this instead if your file is in a subdirectory. // require("../getuserid.php"); // test to make sure it is working. echo $userid; // use if then logic to determine what to show. if ($loggedin) { /* insert code for logged in users here */ } else { /* insert code for everyone else here */ } ?> Modify as needed, obviously. I hope that helps.
  8. WisTex

    Where to Add Code in Example Module?

    It appears modules would not be a suitable solution for my issue, for the following reasons: The example code outputs the WHMCS header and footer even though I don't need it. The template and the PHP code are separated in WHMCS and in my existing script, HTML and PHP are merged. As such, it is actually impossible to just cut and paste the code from the other script into the module and have it work. Since the whole purpose of integrating the other script is to not have to rewrite it, modules would not be an ideal way to do it.
  9. In a PHP script, is there a way to detect whether a user is logged into WHMCS (and which UserID is logged in)? Situation / Criteria: The PHP script is located on the same domain and hosting account as WHMCS. The PHP script does not use WHMCS templates. The PHP script is not a WHMCS module. The PHP script is not located in the WHMCS root directory. The following variables would need to be defined: $loggedin (true/false) $userid (from WHMCS database) I looked through the API docs and I do not see a simple way to detect whether someone is already logged in. I am not looking for a way to make them login twice, once at WHMCS and once in the script. The PHP script needs to detect whether they logged into WHMCS, and the script will send them to the WHMCS login page if not logged in. WHMCS basically handles the login for the PHP script. Is it possible to do this, preferably with some include file I can put at the top of the PHP pages?
  10. WisTex

    Where to Add Code in Example Module?

    I read that whole section. The only examples I see use hooks and functions. The existing code is old-school. No functions. Just database query, output HTML. It appears it would go in addonmodule.php but that code seems to want functions. Do I just replace the function with HTML? Do I put the HTML in the function?
  11. I have some already existing code that I would like to integrate with WHMCS. It is fairly simple old school code (query database, write HTML). Not the modern way of doing things, but the code works well, and I don't have the time nor budget to rewrite the entire script. I was hoping to enhance the code by tapping into the WHMCS login system and prepopulating fields with information stored in the WHMCS database. I was looking at the sample code for creating an Addon Module, and it was not clear where you would paste such code. For example, if I wanted to execute the following code, where would you put it? <?php $message = "Hello World!"; echo $message; ?> Or are modules structured in such a way where old-school code won't work? If that is the case, should I just create pages then?
  12. When I try to login to the WHMCS admin with my Android G1, it does not log me in and just reloads the login page. Since it gives no error message, I am guessing it is a session issue. I can login to other sites, such as this one, with no problem. (I am posting this from my phone now, actually.) The admin area is one of the only sites I can't login to. Being able to login via the phone is useful, especially in emergencies. If you could look into this, it'd be appreciated. Thanks.
  13. WisTex

    Hsphere Control Panel & WHMCS

    Any progress? I have a client who is interested in this and wants to buy WHMCS, but will not if h-Sphere is not supported.
  14. WisTex

    Pay by cash

    You can also change the name displayed to customers. We changed our "Mail in Payment" to display "In Person Payment" instead, since we do not accept mailed payments, but do accept payments in person (cash, check, etc.). You could change it to display "Cash or Check Payment" or something like that instead.
  15. WisTex

    Email marketing software recommendations?

    I saw one called MailChimp that looks good. I haven't used it to send campaigns, but they have a very nice interface.

Important Information

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