Jump to content

eccen

Retired Forum Member
  • Posts

    20
  • Joined

  • Last visited

About eccen

eccen's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. I am wondering if there is a way to have a client login automatically after having his/her account created using 'addclient' api. Is there an API or hook that I can use?
  2. Found a solution. Seems like WHMCS documentation has some false information
  3. I am having trouble trying to implement client add api... I keep getting "The following error occured: Authentication Failed" in return.. and yes, I added correct IP address to API IP Access Restriction under Genera Settings > Security Help please Here is my testing code: <? $url = "http://www.mydomain.com/whmcs/includes/api.php"; $username = "admin"; $password = "adminpass"; $postfields["action"] = "addclient"; $postfields["firstname"] = "Test"; $postfields["lastname"] = "User"; $postfields["companyname"] = "WHMCS"; $postfields["email"] = "demo@whmcs.com"; $postfields["address1"] = "123 Demo Street"; $postfields["city"] = "Demo"; $postfields["state"] = "Florida"; $postfields["postcode"] = "AB123"; $postfields["country"] = "US"; $postfields["phonenumber"] = "123456789"; $postfields["password2"] = "demo"; $postfields["currency"] = "1"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $data = curl_exec($ch); curl_close($ch); $data = explode(";",$data); foreach ($data AS $temp) { $temp = explode("=",$temp); $results[$temp[0]] = $temp[1]; } if ($results["result"]=="success") { # Result was OK! } else { # An error occured echo "The following error occured: ".$results["message"]; } ?>
  4. So... does anyone know this?
  5. also want to know.... any information on this?
  6. I am having trouble with actionhook... I need to retrieve 'invoice' id from AfterShoppingCartCheckout hook. My code looks like this: function updateinfo($vars) { $invoiceid = $vars["InvoiceID"]; // Access Database include "/home/etc/user/public_html/oamysql.class.php"; $mysqldb = new mysqlClass("localhost", "dbuser", "password","dbname"); $mysqldb->connect(); $mysqldb->select(); $mysqldb->query("INSERT INTO customdbtable SET invoiceid='$invoiceid'"); mysql_close(); } add_hook("AfterShoppingCartCheckout",1,"updateinfo",""); what am I doing wrong?
  7. Ah problem solved! Thanks a lot! why does the underscore cause the problem? I guess it thinks the underscore is a space?
  8. Hmm... I still can't get it work. What am I doing wrong? Thanks! Here is my code: login form <form method="post" action="/account/dologin.php?goto=pw_create"> <input type="hidden" name="token" value="---tokencode---" /> Email Address: <input type="text" name="username" size="50"><br> Password: <input type="password" name="password" size="20"><br> <input type="submit" value="Login"> </form> (whmcs root)/pw_create.php <?php define("CLIENTAREA",true); require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = $_LANG['pw_createtitle']; $pageicon = "images/support/clientarea.gif"; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>'; $breadcrumbnav .= ' > <a href="pw_create.php">pw_create</a>'; initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav); if ($_SESSION['uid']) { # User is Logged In - put any code you like here } # To assign variables in Smarty use the following syntax. # This can then be used as {$variablename} in the template # Define the template filename to be used without the .tpl extension $templatefile = "pw_create"; outputClientArea($templatefile); ?> and added $_LANG["pw_createtitle"] = "pw_create"; to (whmcs root)/lang/English.txt
  9. I am having trouble redirecting to a custom page after client login. I created a custom page based on the documentation (http://wiki.whmcs.com/Creating_Pages) and it loads up fine. However, dologin.php?goto=custom does not work, and it loads to clientarea instead of the custom page I created. I added $_LANG["customtitle"] = "custom"; to my language file as well. What am I doing wrong? I have the latest version of whmcs
  10. I just fresh installed 3.8.1 and following error is showing up in the admin page. Anyone know why this is showing and how to fix?
  11. In checkout actionhook.. how do you make the domain array into variable? Something like... $domain = $vars["Domains"];... I am having trouble figuring this out
  12. just to clarify, $sid above is not related to session
  13. Thank you for the help. Here is what I am trying to achieve. Customers will purchase an item at a url like below. whmcs/cart.php?a=add&pid=3&sid=$sid Here, $sid is a unique product number assigned from a script outside of WHMCS. I would like to pass this variable through the domain checker and ordering process. When the payment is complete, I want to have a database table value associated with $sid changed. (querying UPDATE product SET status='Active' WHERE sid='$sid') For better understanding, I am selling template websites and I want my customers to create 'draft' sites at no cost. These 'draft' sites will have product status as 'Draft' and will change to 'Active' upon purchase. Anyway, I was thinking I could do this using 'custom field' feature in WHMCS and apparently having trouble... Please let me know if you can give me some direction!
  14. I am wondering if there is a way to assign a variable to a product custom field value. I am 'guessing' it can be done by something like I have been trying to figure this out for whole day but have not had any luck Hope someone can help me out. I am doing this in template/orderforms/cart/configureproduct.tpl.
×
×
  • 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