/** * Parse * @param DOMNode $contribNode */ protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if ($this->pluginConf["ENABLE_324_IMPORT"] == true) { return; } if ($contribNode->nodeName != "actions") { return; } $actionXpath = new DOMXPath($contribNode->ownerDocument); $compressNodeList = $actionXpath->query('action[@name="import_from_324"]', $contribNode); if (!$compressNodeList->length) { return; } unset($this->actions["import_from_324"]); $compressNode = $compressNodeList->item(0); $contribNode->removeChild($compressNode); $compressNodeList = $actionXpath->query('action[@name="migrate_metaserial"]', $contribNode); if (!$compressNodeList->length) { return; } unset($this->actions["import_from_324"]); $compressNode = $compressNodeList->item(0); $contribNode->removeChild($compressNode); }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if (isset($this->actions["share"])) { $disableSharing = false; $downloadFolder = ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER"); if ($downloadFolder == "") { $disableSharing = true; } else { if (!is_dir($downloadFolder) || !is_writable($downloadFolder)) { $this->logDebug("Disabling Public links, {$downloadFolder} is not writeable!", array("folder" => $downloadFolder, "is_dir" => is_dir($downloadFolder), "is_writeable" => is_writable($downloadFolder))); $disableSharing = true; } else { if (AuthService::usersEnabled()) { $loggedUser = AuthService::getLoggedUser(); if ($loggedUser != null && AuthService::isReservedUserId($loggedUser->getId())) { $disableSharing = true; } } else { $disableSharing = true; } } } if ($disableSharing) { unset($this->actions["share"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="share"]', $contribNode); $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } } }
public function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if ($contribNode->nodeName != "actions") { return; } $actionXpath = new DOMXPath($contribNode->ownerDocument); $paramList = $actionXpath->query('action[@name="scheduler_addTask"]/processing/standardFormDefinition/param[@name="repository_id"]', $contribNode); if (!$paramList->length) { return; } $paramNode = $paramList->item(0); $sVals = array(); $repos = ConfService::getRepositoriesList("all"); foreach ($repos as $repoId => $repoObject) { $sVals[] = $repoId . "|" . AJXP_Utils::xmlEntities($repoObject->getDisplay()); } $sVals[] = "*|All Repositories"; $paramNode->attributes->getNamedItem("choices")->nodeValue = implode(",", $sVals); if (!AuthService::usersEnabled() || AuthService::getLoggedUser() == null) { return; } $paramList = $actionXpath->query('action[@name="scheduler_addTask"]/processing/standardFormDefinition/param[@name="user_id"]', $contribNode); if (!$paramList->length) { return; } $paramNode = $paramList->item(0); $paramNode->attributes->getNamedItem("default")->nodeValue = AuthService::getLoggedUser()->getId(); }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if ($this->detectStreamWrapper() !== false) { $this->actions["cross_copy"] = array(); } }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if (isset($this->actions["share"])) { $disableSharing = false; $downloadFolder = ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER"); if ($downloadFolder == "") { $disableSharing = true; } else { if (!is_dir($downloadFolder) || !is_writable($downloadFolder)) { $this->logDebug("Disabling Public links, {$downloadFolder} is not writeable!", array("folder" => $downloadFolder, "is_dir" => is_dir($downloadFolder), "is_writeable" => is_writable($downloadFolder))); $disableSharing = true; } else { if (AuthService::usersEnabled()) { $loggedUser = AuthService::getLoggedUser(); if ($loggedUser != null && AuthService::isReservedUserId($loggedUser->getId())) { $disableSharing = true; } } else { $disableSharing = true; } } } $repo = ConfService::getRepository(); // Hacky but necessary to edit roles... if (!is_a($repo->driverInstance, "AjxpWrapperProvider") && !(isset($_GET["get_action"]) && $_GET["get_action"] == "list_all_plugins_actions")) { $disableSharing = true; } $xpathesToRemove = array(); if ($disableSharing) { // All share- actions $xpathesToRemove[] = 'action[contains(@name, "share-")]'; } else { $folderSharingAllowed = $this->getAuthorization("folder", "any"); // $this->pluginConf["ENABLE_FOLDER_SHARING"]; $fileSharingAllowed = $this->getAuthorization("file"); //$this->pluginConf["ENABLE_FILE_PUBLIC_LINK"]; if ($fileSharingAllowed === false) { // Share file button $xpathesToRemove[] = 'action[@name="share-file-minisite"]'; } if (!$folderSharingAllowed) { // Share folder button $xpathesToRemove[] = 'action[@name="share-folder-minisite-public"]'; } } foreach ($xpathesToRemove as $xpath) { $actionXpath = new DOMXPath($contribNode->ownerDocument); $nodeList = $actionXpath->query($xpath, $contribNode); foreach ($nodeList as $shareActionNode) { $contribNode->removeChild($shareActionNode); } } } }
public function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if (!self::rsyncEnabled() && $contribNode->nodeName == "actions") { // REMOVE rsync actions, this will advertise the fact that // rsync is not enabled. $xp = new DOMXPath($contribNode->ownerDocument); $children = $xp->query("action", $contribNode); foreach ($children as $child) { $contribNode->removeChild($child); } } }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if ($contribNode->nodeName != "actions") { return; } // WEBDAV ACTION if (empty($this->pluginConf["USER_EVENTS"])) { unset($this->actions["get_my_feed"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="get_my_feed"]', $contribNode); $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } }
/** * Extend parent * @param DOMNode $contribNode */ protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); $disableSharing = false; $downloadFolder = ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER"); if (empty($downloadFolder) || (!is_dir($downloadFolder) || !is_writable($downloadFolder))) { $this->logError("Warning on public links, {$downloadFolder} is not writeable!", array("folder" => $downloadFolder, "is_dir" => is_dir($downloadFolder), "is_writeable" => is_writable($downloadFolder))); } $xpathesToRemove = array(); if (strpos(ConfService::getRepository()->getAccessType(), "ajxp_") === 0) { $xpathesToRemove[] = 'action[@name="share-file-minisite"]'; $xpathesToRemove[] = 'action[@name="share-folder-minisite-public"]'; $xpathesToRemove[] = 'action[@name="share-edit-shared"]'; } else { if (AuthService::usersEnabled()) { $loggedUser = AuthService::getLoggedUser(); if ($loggedUser != null && AuthService::isReservedUserId($loggedUser->getId())) { $disableSharing = true; } } else { $disableSharing = true; } } if ($disableSharing) { // All share- actions $xpathesToRemove[] = 'action[contains(@name, "share-")]'; } else { $folderSharingAllowed = $this->getAuthorization("folder", "any"); $fileSharingAllowed = $this->getAuthorization("file", "any"); if ($fileSharingAllowed === false) { // Share file button $xpathesToRemove[] = 'action[@name="share-file-minisite"]'; } if (!$folderSharingAllowed) { // Share folder button $xpathesToRemove[] = 'action[@name="share-folder-minisite-public"]'; } } foreach ($xpathesToRemove as $xpath) { $actionXpath = new DOMXPath($contribNode->ownerDocument); $nodeList = $actionXpath->query($xpath, $contribNode); foreach ($nodeList as $shareActionNode) { $contribNode->removeChild($shareActionNode); } } }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); // DISABLE STUFF if (empty($this->pluginConf["USER_EVENTS"])) { if ($contribNode->nodeName == "actions") { $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="get_my_feed"]', $contribNode); $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } else { if ($contribNode->nodeName == "client_configs") { $actionXpath = new DOMXPath($contribNode->ownerDocument); $children = $actionXpath->query('component_config', $contribNode); foreach ($children as $child) { $contribNode->removeChild($child); } } } } }
public function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if (!self::rsyncEnabled() && $contribNode->nodeName == "actions") { // REMOVE rsync actions, this will advertise the fact that // rsync is not enabled. $xp = new DOMXPath($contribNode->ownerDocument); $children = $xp->query("action[contains(@name, 'filehasher')]", $contribNode); foreach ($children as $child) { $contribNode->removeChild($child); } } if ($this->getFilteredOption("CACHE_XML_TREE") !== true && $contribNode->nodeName == "actions") { // REMOVE pre and post process on LS action $xp = new DOMXPath($contribNode->ownerDocument); $children = $xp->query("action[@name='ls']", $contribNode); foreach ($children as $child) { $contribNode->removeChild($child); } } }
/** * Parse * @param DOMNode $contribNode */ protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if (substr($_SERVER["REQUEST_URI"], 0, strlen('/user')) != '/user') { if ($contribNode->nodeName == "client_configs") { $children = $contribNode->childNodes; foreach ($children as $child) { if ($child->nodeType == XML_ELEMENT_NODE) { $contribNode->removeChild($child); } } } else { if ($contribNode->nodeName == "actions") { $children = $contribNode->childNodes; foreach ($children as $child) { if ($child->nodeType == XML_ELEMENT_NODE && $child->nodeName == "action" && $child->getAttribute("name") == "login") { $contribNode->removeChild($child); } } } } } }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if (!ConfService::getCoreConf("WEBDAV_ENABLE") && $contribNode->nodeName == "actions") { unset($this->actions["webdav_preferences"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="webdav_preferences"]', $contribNode); $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } if (!ConfService::getCoreConf("USER_CREATE_REPOSITORY", "conf") && $contribNode->nodeName == "actions") { unset($this->actions["user_create_repository"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="user_create_repository"]', $contribNode); $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); unset($this->actions["user_delete_repository"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="user_delete_repository"]', $contribNode); $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if ($contribNode->nodeName != "actions") { return; } if (AuthService::usersEnabled() && $this->passwordsEditable()) { return; } // Disable password change action if (!isset($actionXpath)) { $actionXpath = new DOMXPath($contribNode->ownerDocument); } $passChangeNodeList = $actionXpath->query('action[@name="pass_change"]', $contribNode); if (!$passChangeNodeList->length) { return; } unset($this->actions["pass_change"]); $passChangeNode = $passChangeNodeList->item(0); $contribNode->removeChild($passChangeNode); }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if (isset($this->actions["public_url"]) && (!is_dir(PUBLIC_DOWNLOAD_FOLDER) || !is_writable(PUBLIC_DOWNLOAD_FOLDER))) { AJXP_Logger::logAction("Disabling Public links, PUBLIC_DOWNLOAD_FOLDER is not writeable!", array("folder" => PUBLIC_DOWNLOAD_FOLDER, "is_dir" => is_dir(PUBLIC_DOWNLOAD_FOLDER), "is_writeable" => is_writable(PUBLIC_DOWNLOAD_FOLDER))); unset($this->actions["public_url"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="public_url"]', $contribNode); $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } if ($this->detectStreamWrapper() !== false) { $this->actions["cross_copy"] = array(); } }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if (isset($this->actions["public_url"])) { $disableSharing = false; if (!is_dir(PUBLIC_DOWNLOAD_FOLDER) || !is_writable(PUBLIC_DOWNLOAD_FOLDER)) { AJXP_Logger::logAction("Disabling Public links, PUBLIC_DOWNLOAD_FOLDER is not writeable!", array("folder" => PUBLIC_DOWNLOAD_FOLDER, "is_dir" => is_dir(PUBLIC_DOWNLOAD_FOLDER), "is_writeable" => is_writable(PUBLIC_DOWNLOAD_FOLDER))); $disableSharing = true; } else { if (AuthService::usersEnabled()) { $loggedUser = AuthService::getLoggedUser(); /* // Should be disabled by AJXP_Controller directly $currentRepo = ConfService::getRepository(); if($currentRepo != null){ $rights = $loggedUser->getSpecificActionsRights($currentRepo->getId()); if(isSet($rights["public_url"]) && $rights["public_url"] === false){ $disableSharing = true; } } */ if ($loggedUser->getId() == "guest" || $loggedUser == "shared") { $disableSharing = true; } } else { $disableSharing = true; } } if ($disableSharing) { unset($this->actions["public_url"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="public_url"]', $contribNode); $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } } if ($this->detectStreamWrapper() !== false) { $this->actions["cross_copy"] = array(); } }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); if ($contribNode->nodeName == 'client_configs' && !ConfService::getCoreConf("WEBDAV_ENABLE")) { $actionXpath = new DOMXPath($contribNode->ownerDocument); $webdavCompNodeList = $actionXpath->query('component_config/additional_tab[@id="webdav_pane"]', $contribNode); if ($webdavCompNodeList->length) { $contribNode->removeChild($webdavCompNodeList->item(0)->parentNode); } } if ($contribNode->nodeName != "actions") { return; } // WEBDAV ACTION if (!ConfService::getCoreConf("WEBDAV_ENABLE")) { unset($this->actions["webdav_preferences"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="webdav_preferences"]', $contribNode); if ($publicUrlNodeList->length) { $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } } // SWITCH TO DASHBOARD ACTION $u = AuthService::getLoggedUser(); $access = true; if ($u == null) { $access = false; } else { $acl = $u->mergedRole->getAcl("ajxp_user"); if (empty($acl)) { $access = false; } } if (!$access) { unset($this->actions["switch_to_user_dashboard"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="switch_to_user_dashboard"]', $contribNode); if ($publicUrlNodeList->length) { $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } } // PERSONAL INFORMATIONS $hasExposed = false; $cacheHasExposed = AJXP_PluginsService::getInstance()->loadFromPluginQueriesCache("//server_settings/param[contains(@scope,'user') and @expose='true']"); if ($cacheHasExposed !== null) { $hasExposed = $cacheHasExposed; } else { $paramNodes = AJXP_PluginsService::searchAllManifests("//server_settings/param[contains(@scope,'user') and @expose='true']", "node", false, false, true); if (is_array($paramNodes) && count($paramNodes)) { $hasExposed = true; } AJXP_PluginsService::getInstance()->storeToPluginQueriesCache("//server_settings/param[contains(@scope,'user') and @expose='true']", $hasExposed); } //$hasExposed = true; if (!$hasExposed) { unset($this->actions["custom_data_edit"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="custom_data_edit"]', $contribNode); $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } // CREATE A NEW REPOSITORY if (!ConfService::getCoreConf("USER_CREATE_REPOSITORY", "conf")) { unset($this->actions["user_create_repository"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="user_create_repository"]', $contribNode); if ($publicUrlNodeList->length) { $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } unset($this->actions["user_delete_repository"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="user_delete_repository"]', $contribNode); if ($publicUrlNodeList->length) { $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } } // CREATE A NEW USER if (!ConfService::getCoreConf("USER_CREATE_USERS", "conf")) { unset($this->actions["user_create_user"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="user_create_user"]', $contribNode); if ($publicUrlNodeList->length) { $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } unset($this->actions["user_update_user"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="user_update_user"]', $contribNode); if ($publicUrlNodeList->length) { $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } unset($this->actions["user_delete_user"]); $actionXpath = new DOMXPath($contribNode->ownerDocument); $publicUrlNodeList = $actionXpath->query('action[@name="user_delete_user"]', $contribNode); if ($publicUrlNodeList->length) { $publicUrlNode = $publicUrlNodeList->item(0); $contribNode->removeChild($publicUrlNode); } } }
protected function parseSpecificContributions(&$contribNode) { parent::parseSpecificContributions($contribNode); }