PHPDeleteUser

From Rackspace Email & Apps API
Revision as of 16:58, 25 August 2008 by APIAdmin (talk | contribs) (New page: <pre> <?php $client = new SoapClient('https://admin.webmail.us/mailaccounts/mailaccounts.wsdl', array('trace' => true, 'exceptions' => true)); $res = $client->__soapCall('CheckUserExists...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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('DeleteUser',
                       array('ResellerUsername' => 'someadmin',
                             'ResellerPassword' => 'somepass',
                             'HostName'         => 'somedomain',
                             'UserID'           => 'madeupemail'));
  echo "Deleted the user\n";
}
else {
  echo "No such user to delete\n";
}

?>