コード例 #1
0
 public function executeUpdatedomain($eventData)
 {
     $domainQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT domainid FROM domains WHERE id=' . $eventData['domainserial']);
     $null = null;
     $domain = new \Innomatic\Domain\Domain(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $domainQuery->getFields('domainid'), $null);
     // Holds previous domain webapp skeleton information before updating.
     $currentWebappSkeleton = $domain->getWebappSkeleton();
     $domainData['domainserial'] = $eventData['domainserial'];
     $domainData['domainname'] = $eventData['domainname'];
     $domainData['domainpassword'] = $eventData['domainpassword'];
     $domainData['webappurl'] = $eventData['webappurl'];
     $domainData['dataaccesstype'] = $eventData['dataaccesstype'];
     $domainData['domaindaname'] = $eventData['domaindaname'];
     $domainData['dataaccesshost'] = $eventData['dataaccesshost'];
     $domainData['dataaccessport'] = $eventData['dataaccessport'];
     $domainData['dataaccessuser'] = $eventData['dataaccessuser'];
     $domainData['dataaccesspassword'] = $eventData['dataaccesspassword'];
     $domainData['dataaccessport'] = $eventData['dataaccessport'];
     $domainData['dataaccesstype'] = $eventData['dataaccesstype'];
     if ($domain->edit($domainData)) {
         // Changes max users limit.
         $domain->setMaxUsers($eventData['maxusers']);
         // Applies new webapp skeleton if changed.
         if ($eventData['webappskeleton'] != $currentWebappSkeleton) {
             $domain->setWebappSkeleton($eventData['webappskeleton']);
         }
         $this->status = $this->localeCatalog->getStr('domainupdated_status');
     } else {
         $this->status = $this->localeCatalog->getStr('domainnotupdated_status');
     }
     $this->setChanged();
     $this->notifyObservers('status');
 }