/**
  * Remove Domains
  */
 public function removeDomains()
 {
     // Delete domains
     foreach ($this->post['domains'] as $domainDBO) {
         delete_DomainServicePurchaseDBO($domainDBO);
     }
     $this->setMessage(array("type" => "[DOMAINS_DELETED]"));
     $this->reload();
 }
Exemplo n.º 2
0
/**
 * Delete AccountDBO from database
 *
 * @param AccountDBO &$dbo Account DBO to delete
 * @return boolean True on success
 */
function delete_AccountDBO(&$dbo)
{
    $DB = DBConnection::getDBConnection();
    $id = intval($dbo->getID());
    // Delete any HostingSericePurchases assigned to this account
    try {
        $hosting_array = load_array_HostingServicePurchaseDBO("accountid=" . $id);
        foreach ($hosting_array as $hosting_dbo) {
            delete_HostingServicePurchaseDBO($hosting_dbo);
        }
    } catch (DBNoRowsFoundException $e) {
    }
    // Delete any DomainSericePurchases assigned to this account
    try {
        $domain_array = load_array_DomainServicePurchaseDBO("accountid=" . $id);
        foreach ($domain_array as $domain_dbo) {
            delete_DomainServicePurchaseDBO($domain_dbo);
        }
    } catch (DBNoRowsFoundException $e) {
    }
    // Delete any ProductPurchases assigned to this account
    try {
        $product_array = load_array_ProductPurchaseDBO("accountid=" . $id);
        foreach ($product_array as $product_dbo) {
            delete_ProductPurchaseDBO($product_dbo);
        }
    } catch (DBNoRowsFoundException $e) {
    }
    // Delete any Invoices assigned to this account
    try {
        $invoice_array = load_array_InvoiceDBO("accountid=" . $id);
        foreach ($invoice_array as $invoice_dbo) {
            delete_InvoiceDBO($invoice_dbo);
        }
    } catch (DBNoRowsFoundException $e) {
    }
    // Delete any Orders assigned to this account
    try {
        $orders = load_array_OrderDBO("accountid=" . $id);
        foreach ($orders as $orderDBO) {
            delete_OrderDBO($orderDBO);
        }
    } catch (DBNoRowsFoundException $e) {
    }
    // Delete the account's user
    delete_UserDBO($dbo->getUserDBO());
    // Build SQL
    $sql = $DB->build_delete_sql("account", "id = " . $id);
    // Delete the AccountDBO
    if (!mysql_query($sql, $DB->handle())) {
        throw new DBException(mysql_error($DB->handle()));
    }
}
Exemplo n.º 3
0
 /**
  * Delete Domain Purchase
  *
  * Remove a domain registration service from this account.
  */
 function deleteDomain()
 {
     // Delete the domain purchases
     foreach ($this->post['domains'] as $dbo) {
         delete_DomainServicePurchaseDBO($dbo);
     }
     // Success
     $this->setMessage(array("type" => "[DOMAIN_PURCHASE_DELETED]"));
     $this->setURLField("action", "domains");
     $this->reload();
 }