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)); }
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())); }
public function loginAction() { $validatedRequest = $this->getValidatedRequest('User', 'Login'); $this->getBusiness()->login($validatedRequest->getUsername(), $validatedRequest->getPassword()); Registry::getActionLogger()->logAction(UserBusiness::USER_LOGIN_ACTION, array()); }
/** * @test * @group library */ public function setActionLoggerShouldSetActionLogger() { $this->assertInstanceOf('Seitenbau\\Logger\\Action', Registry::getActionLogger()); }
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())); }
/** * @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); }
/** * @param array $submitted_additional_info */ protected function logSuccessfulSent($submitted_additional_info) { Registry::getActionLogger()->logAction(CliBusiness::SPACE_SUBMITTED_LOG, $submitted_additional_info); }
public static function logDiskUsage() { Registry::getActionLogger()->logAction(CliBusiness::SPACE_DISK_USAGE_ACTION, array('disk_usage' => self::getDiskUsage(), 'metric_value' => 'disk_usage')); }
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); }
/** * 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)); }
/** * @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)); }