Skip to content

Commit 63c2f21

Browse files
authored
Merge pull request #18 from cmu-sei/gameboard-topomojo-api-keys
Gameboard topomojo api keys
2 parents bbf8152 + 41ad613 commit 63c2f21

File tree

5 files changed

+104
-347
lines changed

5 files changed

+104
-347
lines changed

block_crucible.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,18 @@ public function get_content() {
148148
$userid = $USER->idnumber;
149149
$showapps = get_config('block_crucible', 'showallapps');
150150
$showcomms = get_config('block_crucible', 'enablecommapps');
151+
$userperms = $crucible->get_user_permissions();
151152

152153
////////////////////PLAYER/////////////////////////////
153154
$playerurl = get_config('block_crucible', 'playerappurl');
154-
155-
$permsplayer = null;
156155
$showplayer = null;
157156
$views = null;
158157

159158
if ($playerurl) {
160-
$permsplayer = $crucible->get_player_permissions();
161159
$showplayer = get_config('block_crucible', 'showplayer');
162160
}
163161

164-
if ($permsplayer || $showplayer) {
162+
if ($userperms || $showplayer) {
165163
$data->player = $playerurl;
166164
$data->playerDescription = get_string('playerdescription', 'block_crucible');
167165
$data->playerLogo = $OUTPUT->image_url('crucible-icon-player', 'block_crucible');
@@ -180,11 +178,11 @@ public function get_content() {
180178
$showalloy = get_config('block_crucible', 'showalloy');
181179
}
182180

183-
if ($permsplayer || $showalloy) {
181+
if ($userperms || $showalloy) {
184182
$data->alloy = get_config('block_crucible', 'alloyappurl');
185183
$data->alloyDescription = get_string('alloydescription', 'block_crucible');
186184
$data->alloyLogo = $OUTPUT->image_url('crucible-icon-alloy', 'block_crucible');
187-
} else if ($permsplayer == 0 && $permsplayer != null) {
185+
} else if ($userperms == 0 && $userperms != null) {
188186
debugging("No permissions found on Alloy for User: " . $userid, DEBUG_DEVELOPER);
189187
}
190188

@@ -214,21 +212,19 @@ public function get_content() {
214212

215213
////////////////////CASTER/////////////////////////////
216214
$casterurl = get_config('block_crucible', 'casterappurl');
217-
$permscaster = null;
218215
$showcaster = null;
219216

220217
if ($casterurl) {
221-
$permscaster = $crucible->get_caster_permissions();
222218
$showcaster = get_config('block_crucible', 'showcaster');
223219
}
224220

225-
if ($permscaster || $showcaster) {
221+
if ($userperms || $showcaster) {
226222
$data->caster = $casterurl;
227223
$data->casterDescription = get_string('casterdescription', 'block_crucible');
228224
$data->casterLogo = $OUTPUT->image_url('crucible-icon-caster', 'block_crucible');
229-
} else if ($permscaster == 0 && $permscaster != null) {
225+
} else if ($userperms == 0 && $userperms != null) {
230226
debugging("No user data found on Caster for User: " . $userid, DEBUG_DEVELOPER);
231-
} else if ($permscaster == null) {
227+
} else if ($userperms == null) {
232228
debugging("Caster not configured. Configure plugin settings to enable this application.", DEBUG_DEVELOPER);
233229
}
234230

@@ -282,21 +278,19 @@ public function get_content() {
282278

283279
////////////////////STEAMFITTER/////////////////////////////
284280
$steamfitterurl = get_config('block_crucible', 'steamfitterappurl');
285-
$permssteam = null;
286281
$showsteamfitter = null;
287282

288283
if ($steamfitterurl) {
289-
$permssteam = $crucible->get_steamfitter_permissions();
290284
$showsteamfitter = get_config('block_crucible', 'showsteamfitter');
291285
}
292286

293-
if ($permssteam || $showsteamfitter) {
287+
if ($userperms || $showsteamfitter) {
294288
$data->steamfitter = $steamfitterurl;
295289
$data->steamfitterDescription = get_string('steamfitterdescription', 'block_crucible');
296290
$data->steamfitterLogo = $OUTPUT->image_url('crucible-icon-steamfitter', 'block_crucible');
297-
} else if ($permssteam == 0 && $permssteam != null) {
291+
} else if ($userperms == 0 && $userperms != null) {
298292
debugging("No user data found on Steamfitter for User: " . $userid, DEBUG_DEVELOPER);
299-
} else if ($permssteam == null) {
293+
} else if ($userperms == null) {
300294
debugging("Steamfitter not configured. Configure plugin settings to enable this application.", DEBUG_DEVELOPER);
301295
}
302296

@@ -404,6 +398,8 @@ public function get_content() {
404398

405399
$keycloakuserurl = get_config('block_crucible', 'keycloakuserurl');
406400
$keycloakadminurl = get_config('block_crucible', 'keycloakadminurl');
401+
$keycloakGroups = [];
402+
$keycloakRoles = [];
407403

408404
if ($keycloakuserurl || $keycloakadminurl) {
409405
$keycloakGroups = $crucible->get_keycloak_groups();

0 commit comments

Comments
 (0)