Skip to content

Commit

Permalink
Merge branch 'develop' into feature/docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Minigugus authored Nov 15, 2019
2 parents 99afc53 + 40a6345 commit 711da7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 6 additions & 7 deletions app/Services/Ginger.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,13 @@ public function responseCode(string $login)
*/
public function getContributions(string $login=null)
{
if (!$this->get()) {
if ($login) {
$this->user($login);
}

if (!$this->get()) {
return [];
}
if ($login && (!$this->user || $this->user->login != $login)) {
$this->user($login);
}

if (!$this->get()) {
return [];
}

$contributionList = $this->call(
Expand Down
9 changes: 6 additions & 3 deletions app/Services/Scopes.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function allowPublic(bool $allow=true)
}

/**
* Define the middleware to call.
* Define the middleware to call for authentication.
*
* @return string
*/
Expand Down Expand Up @@ -284,7 +284,7 @@ public function getByCategories(array $scopes)
if (!isset($middleware)) {
$middleware = $elements[0];
} else if ($middleware !== $elements[0]) {
// Scopes starting by c- and u-.
// Scopes starting by client- and user-.
throw new PortailException('Les scopes ne sont pas définis avec les mêmes types d\'authentification !');
}

Expand All @@ -299,11 +299,14 @@ public function getByCategories(array $scopes)

$categories[$elements[2]] = [
'description' => $categorie['description'],
'icon' => $categorie['icon'],
'scopes' => [
$current[$scope]
]
];

if ($elements[0] == "user") {
$categories[$elements[2]]['icon'] = $categorie['icon'];
}
} else {
array_push($categories[$elements[2]]['scopes'], $current[$scope]);
}
Expand Down

0 comments on commit 711da7b

Please sign in to comment.