示例#1
0
 function DispatchPollDeleteDomain(PollDeleteDomainResponse $resp)
 {
     if ($resp->IsFailed()) {
         Log::Log(sprintf('DispatchPollDeleteDomain failed. Registry response: %s', $resp->ErrMsg), E_USER_ERROR);
         throw new Exception($resp->ErrMsg, $resp->Code);
     }
     if ($resp->Succeed()) {
         list($name, $extension) = FQDN::Parse($resp->HostName);
         $domain = $this->DBDomain->LoadByName($name, $extension, $this->GetManifest());
         if ($resp->Result) {
             $this->DBDomain->Delete($domain);
             $this->FireEvent('DomainDeleted', $domain);
         } else {
             $op = $this->DB->GetRow('SELECT * FROM pending_operations WHERE objectid=? AND objecttype=?', array($domain->ID, self::OBJ_DOMAIN));
             if (!$op) {
                 throw new Exception('Pending operation not found');
             }
             $Before = unserialize($op['object_before']);
             $domain->Status = $Before->Status;
             $this->DBDomain->Save($domain);
         }
         return true;
     }
 }