Skip to content

Commit

Permalink
Add user creation example
Browse files Browse the repository at this point in the history
  • Loading branch information
TertiumQuid committed Oct 25, 2018
1 parent 4981099 commit 5097542
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions examples/users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/php
<?php
include("common.php");
$client = SuperSaaS\Client::Instance();
$client->verbose = true;

echo "\n\r# SuperSaaS Users Example\n\r";

echo "## Account: ".$client->account_name ."\n\r";

echo "creating new user...";

$attributes = array(
'name' => 'testing123@example.com',
'email' => 'testing123@example.com',
'password' => 'pass123',
'full_name' => 'Tester Test',
'address' => '123 St, City',
'mobile' => '555-5555',
'phone' => '555-5555',
'country' => 'US',
'field_1' => 'f 1',
'field_2' => 'f 2',
'super_field' => 'sf',
'role' => 3
);

$client->users->create($attributes, '123456fk');

echo "\n\r";
?>
2 changes: 1 addition & 1 deletion src/SuperSaaS/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Configuration

public function __construct () {
$this->account_name = getenv('SSS_API_ACCOUNT_NAME');
$this->host = Configuration::DEFAULT_HOST;
$this->host = getenv('SSS_API_HOST') ? getenv('SSS_API_HOST') : Configuration::DEFAULT_HOST;
$this->password = getenv('SSS_API_PASSWORD');
$this->user_name = getenv('SSS_API_USER_NAME');
$this->dry_run = FALSE;
Expand Down

0 comments on commit 5097542

Please sign in to comment.