コード例 #1
0
ファイル: manager.php プロジェクト: hallnewman/webmail-lite
 /**
  * @param CDomain $oDomain
  * @return bool
  */
 public function UpdateDomain(CDomain $oDomain)
 {
     $bResult = false;
     try {
         if ($oDomain->Validate()) {
             if ($oDomain->IsDefaultDomain) {
                 $oSettings =& CApi::GetSettings();
                 $aSettingsMap = $oDomain->GetSettingsMap();
                 foreach ($aSettingsMap as $sProperty => $sSettingsName) {
                     $oSettings->SetConf($sSettingsName, $oDomain->{$sProperty});
                 }
                 $bResult = $oSettings->SaveToXml();
             } else {
                 if (!$this->oStorage->UpdateDomain($oDomain)) {
                     throw new CApiManagerException(Errs::DomainsManager_DomainUpdateFailed);
                 }
                 $bResult = true;
             }
         }
     } catch (CApiBaseException $oException) {
         $bResult = false;
         $this->setLastException($oException);
     }
     return $bResult;
 }