Skip to content

Instantly share code, notes, and snippets.

@colinmollenhour
Created January 10, 2012 19:13
Show Gist options
  • Save colinmollenhour/1590578 to your computer and use it in GitHub Desktop.
Save colinmollenhour/1590578 to your computer and use it in GitHub Desktop.
Example SMarterTrack import
<?php
/*
* Usage: php createUsers.php [baseurl] [username] [password] [csvfile]
*/
$baseUrl = $argv[1];
$authUserName = $argv[2];
$authPassword = $argv[3];
$csvFile = $argv[4];
$client = new SoapClient($baseUrl.'Services2/svcOrganization.asmx?WSDL');
$fp = fopen($csvFile,'r') or die("Could not open $csvFile");
while($row = fgetcsv($fp)) {
$result = $client->createUser(array(
'authUserName' => $authUserName,
'authPassword' => $authPassword,
'username' => $row[1],
'password' => md5(time()),
'email' => $row[1],
'isEmailVerified' => false,
'displayName' => $row[0],
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment