Jump to content

I Need Someone to Create a Checkout Script that...


datawebcorp

Recommended Posts

I'll post the script here for those interested. I've used the clientsignup actionhook, it creates a user in supporttrio with their username set as their email address. (This can be easily changed to something else.)

 

Replace lines 15-30 in includes/actionhooks.php with the following:

(Replace the configurations values as necessary)

function actionhook_ClientSignup($vars) {
### CONFIGURATION ###
$ttgid = 0;
       // The Group ID to insert the user as belonging to. Leave as zero for no group.
$ttdb_db = "strio_db";
       // The Database name of your supporttrio installation
$ttdb_user = "strio_user";
       // The MySQL username with access to this database
$ttdb_pass = "strio_pass";
       // The MySQL user's password
$ttdb_host = "localhost";
       // The host the database is on
##################### 

$ttdb = mysql_connect($ttdb_host, $ttdb_user, $ttdb_pass);
mysql_select_db($ttdb_db, $ttdb);

$query = "INSERT INTO `tt_users` (`user`, `pass`, `s_date`, `s_time`, `name`, `email`, `status`, `gid`, `m_datetime`) VALUES ('" . mysql_real_escape_string($vars['Email']) . "', '" . base64_encode($vars['Password']) . "', NOW(), NOW(), '" . mysql_real_escape_string($vars['FirstName']) . " " . mysql_real_escape_string($vars['LastName']) . "', '" . mysql_real_escape_string($vars['Email']) . "', 1, " . (int)$ttgid . ", NOW());";
mysql_query($query, $ttdb);
mysql_close($ttdb);
}

Link to comment
Share on other sites

You might want to check if the user already has a trio account :)

 

No need, the query will fail if someone with the same username already exists and no errors will be shown as WHMCS turns them all off.

WHMCS shouldn't allow more than one client registration per-email anyway.

Link to comment
Share on other sites

No need, the query will fail if someone with the same username already exists and no errors will be shown as WHMCS turns them all off.

WHMCS shouldn't allow more than one client registration per-email anyway.

 

But they can use *anything* as their username in trio :)

You need to check if the email address is already in the trio DB or adding the record *will* break their ability to submit tickets by email...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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