Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Make sure to use ConfService::listRepositoriesWithCriteria() instead …
Browse files Browse the repository at this point in the history
…of directly conf storage implementation, otherwise the hardcode workspaces/templates may be missing.
  • Loading branch information
cdujeu committed Jun 26, 2015
1 parent 3c0db46 commit 773423c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
Expand Up @@ -1126,9 +1126,10 @@ public function switchAction($action, $httpVars, $fileVars)
case "get_templates_definition":

AJXP_XMLWriter::header("repository_templates");
$repositories = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array(
$count = 0;
$repositories = ConfService::listRepositoriesWithCriteria(array(
"isTemplate" => '1'
));
), $count);
foreach ($repositories as $repo) {
if(!$repo->isTemplate) continue;
$repoId = $repo->getUniqueId();
Expand Down Expand Up @@ -2035,7 +2036,8 @@ public function listRoles($root, $child, $hashValue = null, $returnNodes = false
//if(strpos($roleId, "AJXP_GRP_") === 0 && !$this->listSpecialRoles) continue;
$r = array();
if(!AuthService::canAdministrate($roleObject)) continue;
$repos = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array("role" => $roleObject));
$count = 0;
$repos = ConfService::listRepositoriesWithCriteria(array("role" => $roleObject), $count);
foreach ($repos as $repoId => $repository) {
if($repository->getAccessType() == "ajxp_shared") continue;
if(!$roleObject->canRead($repoId) && !$roleObject->canWrite($repoId)) continue;
Expand Down
10 changes: 6 additions & 4 deletions core/src/plugins/access.ajxp_user/class.UserDashboardDriver.php
Expand Up @@ -284,9 +284,10 @@ public function listUsers()
$loggedUser = AuthService::getLoggedUser();
$users = ConfService::getConfStorageImpl()->getUserChildren($loggedUser->getId()); // AuthService::listUsers();
$mess = ConfService::getMessages();
$repoList = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array(
$count = 0;
$repoList = ConfService::listRepositoriesWithCriteria(array(
"owner_user_id" => $loggedUser->getId()
));
), $count);
$userArray = array();
foreach ($users as $userIndex => $userObject) {
$label = $userObject->getId();
Expand Down Expand Up @@ -330,9 +331,10 @@ public function listRepositories()
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist"><column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/><column messageId="user_dash.9" attributeName="parent_label" sortType="String"/><column messageId="user_dash.9" attributeName="repo_accesses" sortType="String"/></columns>');
$repoArray = array();
$loggedUser = AuthService::getLoggedUser();
$repos = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array(
$count = 0;
$repos = ConfService::listRepositoriesWithCriteria(array(
"owner_user_id" => $loggedUser->getId()
));
), $count);

$searchAll = ConfService::getCoreConf("CROSSUSERS_ALLGROUPS", "conf");
$displayAll = ConfService::getCoreConf("CROSSUSERS_ALLGROUPS_DISPLAY", "conf");
Expand Down
5 changes: 3 additions & 2 deletions core/src/plugins/core.conf/class.AbstractConfDriver.php
Expand Up @@ -940,9 +940,10 @@ public function switchAction($action, $httpVars, $fileVars)
case "get_user_templates_definition":

AJXP_XMLWriter::header("repository_templates");
$repositories = ConfService::getConfStorageImpl()->listRepositoriesWithCriteria(array(
$count = 0;
$repositories = ConfService::listRepositoriesWithCriteria(array(
"isTemplate" => 1
));
), $count);
$pServ = AJXP_PluginsService::getInstance();
foreach ($repositories as $repo) {
if(!$repo->isTemplate) continue;
Expand Down

0 comments on commit 773423c

Please sign in to comment.