Created
January 10, 2012 19:13
-
-
Save colinmollenhour/1590578 to your computer and use it in GitHub Desktop.
Example SMarterTrack import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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