public function getFromattedUgroupsThatCanReadWikiPage(WikiPage $wiki_page)
 {
     $project = $this->project_manager->getProject($wiki_page->getGid());
     $ugroup_ids = $this->permission_manager->getAuthorizedUgroupIds($wiki_page->getId(), self::WIKI_PERMISSION_READ);
     $ugroup_ids = $this->filterWikiPagePermissionsAccordingToService($project, $ugroup_ids);
     $ugroup_ids = $this->filterWikiPagePermissionsAccordingToProject($project, $ugroup_ids);
     return $this->literalizer->ugroupIdsToString($ugroup_ids, $project);
 }
Exemplo n.º 2
0
 public function getFormattedContent(WikiPage $page)
 {
     $formatter = new WikiPageVersionContentFormatter($page->getGid());
     return $formatter->getFormattedContent($page, $this);
 }
 /**
  *
  */
 function setWikiPagePerms()
 {
     global $feedback;
     $wp = new WikiPage($_POST['object_id']);
     if ($_POST['reset']) {
         $ret = $wp->resetPermissions();
     } else {
         $ret = $wp->setPermissions($_POST['ugroups']);
     }
     if (!$ret) {
         exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('wiki_actions_wikiserviceadmin', 'update_page_perm_err', array($feedback)));
     }
     $event_manager = EventManager::instance();
     $event_manager->processEvent("wiki_page_permissions_updated", array('group_id' => $wp->getGid(), 'wiki_page' => $wp->getPagename()));
 }
 /**
  * Remove an indexed wiki page
  *
  * @param WikiPage $wiki_page The item to delete
  */
 public function delete(WikiPage $wiki_page)
 {
     $this->logger->debug('[Wiki] ElasticSearch: delete wiki page ' . $wiki_page->getPagename() . ' #' . $wiki_page->getId());
     try {
         $this->client->getIndexedElement($wiki_page->getGid(), $wiki_page->getId());
         $this->client->delete($wiki_page->getGid(), $wiki_page->getId());
     } catch (ElasticSearch_ElementNotIndexed $exception) {
         $this->logger->debug('[Wiki] ElasticSearch: wiki page ' . $wiki_page->getPagename() . ' #' . $wiki_page->getId() . ' not indexed, nothing to delete');
         return;
     }
 }
 public function getIndexedWikiPageData(WikiPage $wiki_page)
 {
     $wiki_page_metadata = $wiki_page->getMetadata();
     return array('id' => $wiki_page->getId(), 'group_id' => $wiki_page->getGid(), 'page_name' => $wiki_page->getPagename(), 'last_modified_date' => date('c', $wiki_page_metadata[self::PHPWIKI_METADATA_LAST_MODIFIED_DATE]), 'last_author' => $wiki_page_metadata[self::PHPWIKI_METADATA_AUTHOR_ID], 'last_summary' => isset($wiki_page_metadata[self::PHPWIKI_METADATA_SUMMARY]) ? $wiki_page_metadata[self::PHPWIKI_METADATA_SUMMARY] : '', 'content' => isset($wiki_page_metadata[self::PHPWIKI_METADATA_CONTENT]) ? $wiki_page_metadata[self::PHPWIKI_METADATA_CONTENT] : '', 'permissions' => $this->getCurrentPermissions($wiki_page));
 }