Hello,I'm new in osTicket and at this stage I just installed a copy for testing. My current context to explain my goal: I'm a software author and after some years managing my support through simple email (quite hard sometimes), I decided to switch to a real support platform (sure, I'll sleep better). My users buy support through yearly membership and I would like to automatically add (and remove) them in realtime (on post-order) when they purchase or renew. I can write a CGI (in Perl or C in my case) to read my customers database and write the relevant info into the osTicket one, but I would like to know if this kind of "hack" (bypasing the osTicket board) will generate some side-effects I have not in mind? And what are the table(s) and fields to fill-in to achieve a complete and clean registration? The goal being they'll have not to register by themselves (anyway, I will remove the possibility to sign-up by hand or submit a ticket as guest).Best,Eric

Moving thread to Mods and Customizations.

I created then validated (replying to confirmation email) a new user through the interface, then compared database dump before and after. It sounds like three tables are modified only. It may help someone else...Best--Attached if the result of "diff -y --suppress-common-lines osticket_before.sql osticket_after.sql > diff.txt"

snap_0003122.png

5 days later

I use this php to add userslook a little before execute, because i made it to my needs. you need to put the correct password for your db, modify the users to add, add a mail element in the array (i dont use that because all the mails are user_name@mail.com in my case), modify the language, etcsorry for my bad english and for some comments in the code in spanishto use it, you need to rename it to .php (because i can attach a file with that extension)then you need to put the files "class.passwd.php" and "PasswordHash.php" in the same folder. this files you can find it in "osTicket_installation_folder\include"to execute the file, put it in your apache folder and just open the direction in a web browser

[add_user.txt](https://forum.osticket.com/assets/files/migrated/FileUpload/34/14c0b581d5869f125abd90a083623f.txt)

6 years later

This is a better way using the internal functions
$acct = ClientAccount::lookupByUsername($username);
//If client does not exist lets create it manually.
if (!$acct) {
$info['name'] = $info['first'] . " " . $info['last'];
$info['email'] = $info['email'];
$info['full'] = $info['full'];
$info['first'] = $info['first'];
$info['last'] = $info['last'];
$info['username'] = $info['username'];
$info['backend'] = 'ldap.client';
$info['sendemail'] = false;

				if ($cfg->getClientRegistrationMode() == "closed" && $this->getConfig()->get('multiauth-force-register')){
					$create = User::fromVars($info);
					$register = UserAccount::register($create, $info, $errors);
					$client = new ClientSession(new EndUser($register->getUser()));
				}
			}
    a year later
    Write a Reply...