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

Commit fc354f4

Browse files
committed
Make sure to never call getRepositoriesList() on "user" scope before the user is actually logged, otherwise it caches an incomplete list (e.g. in updateDefaultRights). Fixes incomplete list in sync client sometime, and make fix some issues with default rights as well.
1 parent c8b12e1 commit fc354f4

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

core/src/core/classes/class.AuthService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ public static function updateDefaultRights(&$userObject)
632632
{
633633
if (!$userObject->hasParent()) {
634634
$changes = false;
635-
$repoList = ConfService::getRepositoriesList();
635+
$repoList = ConfService::getRepositoriesList("all");
636636
foreach ($repoList as $repositoryId => $repoObject) {
637637
if(!self::allowedForCurrentGroup($repoObject, $userObject)) continue;
638638
if($repoObject->isTemplate) continue;

core/src/core/classes/class.ConfService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ public function switchRootDirInst($rootDirIndex=-1, $temporary=false)
350350
* See instance method
351351
* @static
352352
* @param String $scope "user" or "all"
353+
* @param bool $includeShared
353354
* @return Repository[]
354355
*/
355356
public static function getRepositoriesList($scope = "user", $includeShared = true)

core/src/plugins/action.scheduler/class.AjxpScheduler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function parseSpecificContributions(&$contribNode)
7878
if(!$paramList->length) return;
7979
$paramNode = $paramList->item(0);
8080
$sVals = array();
81-
$repos = ConfService::getRepositoriesList();
81+
$repos = ConfService::getRepositoriesList("all");
8282
foreach ($repos as $repoId => $repoObject) {
8383
$sVals[] = $repoId."|". AJXP_Utils::xmlEntities($repoObject->getDisplay());
8484
}
@@ -189,7 +189,7 @@ public function runTask($taskId, $status = null, &$currentlyRunning = -1, $force
189189
$data["user_id"] = "queue:".$tmpQueue;
190190
}
191191
if ($data["repository_id"] == "*") {
192-
$data["repository_id"] = implode(",", array_keys(ConfService::getRepositoriesList()));
192+
$data["repository_id"] = implode(",", array_keys(ConfService::getRepositoriesList("all")));
193193
}
194194
$process = AJXP_Controller::applyActionInBackground(
195195
$data["repository_id"],

0 commit comments

Comments
 (0)