本文整理汇总了PHP中ConfService::repositoryIsAccessible方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfService::repositoryIsAccessible方法的具体用法?PHP ConfService::repositoryIsAccessible怎么用?PHP ConfService::repositoryIsAccessible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfService
的用法示例。
在下文中一共展示了ConfService::repositoryIsAccessible方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listRepositories
/**
* @param AbstractAjxpUser $user
* @return Array
*/
public function listRepositories($user = null)
{
$all = AJXP_Utils::loadSerialFile($this->repoSerialFile);
if ($user != null) {
foreach ($all as $repoId => $repoObject) {
if (!ConfService::repositoryIsAccessible($repoId, $repoObject, $user)) {
unset($all[$repoId]);
}
}
}
return $all;
}
示例2: canSwitchTo
/**
* Test if user can switch to this repository
*
* @param integer $repositoryId
* @return boolean
*/
public function canSwitchTo($repositoryId)
{
$repositoryObject = ConfService::getRepositoryById($repositoryId);
if ($repositoryObject == null) {
return false;
}
return ConfService::repositoryIsAccessible($repositoryId, $repositoryObject, $this, false, true);
/*
if($repositoryObject->getAccessType() == "ajxp_conf" && !$this->isAdmin()) return false;
if($repositoryObject->getUniqueUser() && $this->id != $repositoryObject->getUniqueUser()) return false;
return ($this->mergedRole->canRead($repositoryId) || $this->mergedRole->canWrite($repositoryId)) ;
*/
}
示例3: getAccessibleRepositories
/**
* @static
* @param AbstractAjxpUser $userObject
* @param bool $details
* @param bool $labelOnly
* @param bool $skipShared
* @return Repository[]
*/
public static function getAccessibleRepositories($userObject = null, $details = false, $labelOnly = false, $includeShared = true)
{
$result = array();
$allReps = ConfService::getRepositoriesList("user");
foreach ($allReps as $repositoryId => $repositoryObject) {
if (!ConfService::repositoryIsAccessible($repositoryId, $repositoryObject, $userObject, $details, $includeShared)) {
continue;
}
if ($labelOnly) {
$result[$repositoryId] = $repositoryObject->getDisplay();
} else {
$result[$repositoryId] = $repositoryObject;
}
}
return $result;
}
示例4: substr
$uri = substr($uri, strlen($scriptUri));
$uri = explode("/", trim($uri, "/"));
// GET REPO ID
$repoID = array_shift($uri);
// GET ACTION NAME
$action = array_shift($uri);
$path = "/" . implode("/", $uri);
if ($repoID == 'pydio') {
ConfService::switchRootDir();
$repo = ConfService::getRepository();
} else {
$repo = ConfService::findRepositoryByIdOrAlias($repoID);
if ($repo == null) {
die("Cannot find repository with ID " . $repoID);
}
if (!ConfService::repositoryIsAccessible($repo->getId(), $repo, AuthService::getLoggedUser(), false, true)) {
header('HTTP/1.0 401 Unauthorized');
echo 'You are not authorized to access this workspace.';
exit;
}
ConfService::switchRootDir($repo->getId());
}
// DRIVERS BELOW NEED IDENTIFICATION CHECK
if (!AuthService::usersEnabled() || ConfService::getCoreConf("ALLOW_GUEST_BROWSING", "auth") || AuthService::getLoggedUser() != null) {
$confDriver = ConfService::getConfStorageImpl();
$Driver = ConfService::loadDriverForRepository($repo);
}
AJXP_PluginsService::getInstance()->initActivePlugins();
$xmlResult = AJXP_Controller::findRestActionAndApply($action, $path);
if (!empty($xmlResult) && !headers_sent()) {
AJXP_XMLWriter::header();