예제 #1
0
 public function buildwebsiteAction()
 {
     $validatedRequest = $this->getValidatedRequest('Builder', 'BuildWebsite');
     $this->getBusiness()->checkUserRights('buildWebsite', array('websiteId' => $validatedRequest->getWebsiteId()));
     $build = $this->getBusiness()->buildWebsite($validatedRequest->getWebsiteId(), $validatedRequest->getComment());
     Registry::getActionLogger()->logAction(BuilderBusiness::BUILDER_BUILD_ACTION, array('websiteId' => $validatedRequest->getWebsiteId(), 'id' => $build->getId()));
     $this->responseData->setData(new Response\Build($build));
 }
예제 #2
0
 public function editAction()
 {
     $validatedRequest = $this->getValidatedRequest('TemplateSnippet', 'Edit');
     // Darf das TemplateSnippet bearbeitet werden?
     $check = array('id' => $validatedRequest->getId(), 'websiteId' => $validatedRequest->getWebsiteId());
     $this->getBusiness()->checkUserRights('edit', $check);
     $columnsValues = array('websiteid' => $validatedRequest->getWebsiteId(), 'name' => $validatedRequest->getName(), 'description' => $validatedRequest->getDescription(), 'category' => $validatedRequest->getCategory(), 'content' => $validatedRequest->getContent());
     $templateSnippet = $this->getBusiness()->update($validatedRequest->getWebsiteId(), $validatedRequest->getId(), $columnsValues);
     Registry::getActionLogger()->logAction(TemplateSnippetBusiness::TEMPLATESNIPPET_EDIT_ACTION, array('websiteId' => $validatedRequest->getWebsiteId(), 'id' => $templateSnippet->getId(), 'name' => $templateSnippet->getName()));
 }
예제 #3
0
 public function loginAction()
 {
     $validatedRequest = $this->getValidatedRequest('User', 'Login');
     $this->getBusiness()->login($validatedRequest->getUsername(), $validatedRequest->getPassword());
     Registry::getActionLogger()->logAction(UserBusiness::USER_LOGIN_ACTION, array());
 }
예제 #4
0
 /**
  * @test
  * @group library
  */
 public function setActionLoggerShouldSetActionLogger()
 {
     $this->assertInstanceOf('Seitenbau\\Logger\\Action', Registry::getActionLogger());
 }
예제 #5
0
 public function editmetaAction()
 {
     $validatedRequest = $this->getValidatedRequest('Template', 'EditMeta');
     // Darf das Template bearbeitet werden?
     $check = array('id' => $validatedRequest->getId(), 'websiteId' => $validatedRequest->getWebsiteId());
     $this->getBusiness()->checkUserRights('edit', $check);
     // Es darf kein Lock auf dem Modul vorhanden sein!
     $hasLock = $this->hasLock($validatedRequest->getId(), $validatedRequest->getWebsiteId(), LockBusiness::LOCK_TYPE_TEMPLATE);
     if (false !== $hasLock) {
         return false;
     }
     $attributes = array();
     if ($validatedRequest->getName() !== null) {
         $attributes['name'] = $validatedRequest->getName();
     }
     $template = $this->getBusiness()->update($validatedRequest->getId(), $validatedRequest->getWebsiteId(), $attributes);
     Registry::getActionLogger()->logAction(TemplateBusiness::TEMPLATE_EDIT_META_ACTION, array('websiteId' => $validatedRequest->getWebsiteId(), 'id' => $template->getId(), 'name' => $template->getName(), 'contentChecksum' => $template->getContentchecksum()));
 }
예제 #6
0
파일: Cli.php 프로젝트: rukzuk/rukzuk
 /**
  * @param string|null $toVersion
  *
  * @return array
  * @throws \Doctrine\DBAL\Migrations\MigrationException
  */
 protected function migrateDb($toVersion = null)
 {
     // the order is important
     $updateInfo = array();
     // 1. reset/clear opcode cache
     $this->resetOpCodeCache();
     // 2. migrate database
     $configuration = $this->getDoctrineMigrationConfig();
     // Information ermitteln
     $currentVersion = $configuration->getCurrentVersion();
     $latestVersion = $configuration->getLatestVersion();
     if ($toVersion === null) {
         $toVersion = $latestVersion;
     }
     // DB-Migration durchfuehren
     $migration = new \Doctrine\DBAL\Migrations\Migration($configuration);
     $migration->migrate($toVersion, false);
     $versionInfo = array('current' => (string) $currentVersion, 'latest' => (string) $latestVersion, 'migrateto' => (string) $toVersion);
     // log migrate
     Registry::getActionLogger()->logAction(self::SPACE_MIGRATED_ACTION, $versionInfo);
     return array('version' => $versionInfo);
 }
예제 #7
0
 /**
  * @param array $submitted_additional_info
  */
 protected function logSuccessfulSent($submitted_additional_info)
 {
     Registry::getActionLogger()->logAction(CliBusiness::SPACE_SUBMITTED_LOG, $submitted_additional_info);
 }
예제 #8
0
 public static function logDiskUsage()
 {
     Registry::getActionLogger()->logAction(CliBusiness::SPACE_DISK_USAGE_ACTION, array('disk_usage' => self::getDiskUsage(), 'metric_value' => 'disk_usage'));
 }
예제 #9
0
 protected function logImport($actionName, array $importData, $info)
 {
     if (isset($importData['importId'])) {
         $info['importId'] = $importData['importId'];
     }
     if (isset($importData['websiteId'])) {
         $info['websiteId'] = $importData['websiteId'];
     }
     if (isset($importData['conflict']) && is_array($importData['conflict'])) {
         $info['conflict'] = array();
         if (isset($importData['conflict']['modules'])) {
             $info['conflict']['modules'] = count($importData['conflict']['modules']);
         }
         if (isset($importData['conflict']['templates'])) {
             $info['conflict']['templates'] = count($importData['conflict']['templates']);
         }
         if (isset($importData['conflict']['templatesnippets'])) {
             $info['conflict']['templatesnippets'] = count($importData['conflict']['templatesnippets']);
         }
         if (isset($importData['conflict']['media'])) {
             $info['conflict']['media'] = count($importData['conflict']['media']);
         }
     }
     $info['imported'] = array();
     if (isset($importData['modules'])) {
         $info['imported']['modules'] = count($importData['modules']);
     }
     if (isset($importData['templates'])) {
         $info['imported']['templates'] = count($importData['templates']);
     }
     if (isset($importData['templatesnippets'])) {
         $info['imported']['templatesnippets'] = count($importData['templatesnippets']);
     }
     if (isset($importData['pages'])) {
         $info['imported']['pages'] = count($importData['pages']);
     }
     if (isset($importData['media'])) {
         $info['imported']['media'] = count($importData['media']);
     }
     if (isset($importData['usergroups'])) {
         $info['imported']['usergroups'] = count($importData['usergroups']);
     }
     if (isset($importData['website'])) {
         $info['imported']['website'] = count($importData['website']);
     }
     Registry::getActionLogger()->logAction($actionName, $info);
 }
예제 #10
0
 /**
  * Verschiebt eine Page innerhalb der Website-Navigation
  */
 public function moveAction()
 {
     $validatedRequest = $this->getValidatedRequest('Page', 'Move');
     // darf page geloescht werden?
     $check = array('id' => $validatedRequest->getId(), 'websiteId' => $validatedRequest->getWebsiteId());
     $this->getBusiness()->checkUserRights('createChildren', $check);
     // darf page an neuer stelle eingebunden werden?
     $check = array('id' => $validatedRequest->getParentId(), 'websiteId' => $validatedRequest->getWebsiteId());
     $this->getBusiness()->checkUserRights('createChildren', $check);
     $navigation = $this->getBusiness()->movePageInNavigation($validatedRequest->getId(), $validatedRequest->getWebsiteId(), $validatedRequest->getParentId(), $validatedRequest->getInsertBeforeId());
     Registry::getActionLogger()->logAction(PageBusiness::PAGE_MOVE_ACTION, array('websiteId' => $validatedRequest->getWebsiteId(), 'id' => $validatedRequest->getId(), 'parentId' => $validatedRequest->getParentId(), 'beforeId' => $validatedRequest->getInsertBeforeId()));
     $this->responseData->setData(new Response\Move($navigation));
 }
예제 #11
0
 /**
  * @SWG\Api(
  *   path="/website/updatecontent",
  *   @SWG\Operation(
  *        method="GET, POST",
  *        summary="Update all contents of the website",
  *        notes="Updates all contents of the website with the given id.",
  *        type="WebsiteUpdateContent",
  *        nickname="UpdateContent")
  * ))
  */
 public function updatecontentAction()
 {
     /** @var \Cms\Request\Website\UpdateContent $validateRequest */
     $validateRequest = $this->getValidatedRequest('Website', 'UpdateContent');
     $websiteId = $validateRequest->getProperty('websiteid');
     $this->getBusiness()->checkUserRights('updatecontent', array('websiteId' => $websiteId));
     $this->getBusiness('Lock')->removeLocksByWebsiteId($websiteId);
     $this->getBusiness('ContentUpdater')->updateAllContentsOfWebsite($websiteId);
     Registry::getActionLogger()->logAction(WebsiteBusiness::WEBSITE_UPDATE_CONTENT_ACTION, array('websiteId' => $websiteId));
 }