PHPModifyUser

From Rackspace Email & Apps API
Jump to: navigation, search
<?php

$client = new SoapClient('https://admin.webmail.us/mailaccounts/mailaccounts.wsdl', array('trace' => true, 'exceptions' => true));

$res = $client->__soapCall('CheckUserExists',
                            array('ResellerUsername' => 'someadmin',
                                  'ResellerPassword' => 'somepass',
                                  'HostName'         => 'somedomain',
                                  'UserID'           => 'madeupemail'));

if ($res == 1) {
  $res = $client->__soapCall('AddUser',
                       array('ResellerUsername' => 'someadmin',
                             'ResellerPassword' => 'somepass',
                             'HostName'         => 'somedomain',
                             'UserID'           => 'madeupemail',
                             'Password'         => '22222',
                             'Active'           => '1',
                             'FirstName'        => 'first',
                             'LastName'         => 'newlast',
                             'StreetAddress'    => '1234 Some Street',
                             'City'             => 'SomeCity',
                             'State'            => 'SomeState',
                             'Country'          => 'SomeCountry',
                             'PostalCode'       => '00000',
                             'Telephone'        => '800-555-1212',
                             'Organization'     => 'SomeCompany',
                             'Department'       => 'Development'));
  echo "Modified the user\n";
}
else {
  echo "No such user to modify\n";
}
?>