@@ -14,7 +14,7 @@ |
||
14 | 14 | if (empty($_SESSION[Toolbox::class])) { |
15 | 15 | $_SESSION[Toolbox::class] = Toolbox::fromConfiguration(CONFIG_FILE); |
16 | 16 | } |
17 | -$toolbox =& $_SESSION[Toolbox::class]; |
|
17 | +$toolbox = & $_SESSION[Toolbox::class]; |
|
18 | 18 | |
19 | 19 | /* set the Tool Consumer's instance URL, if present */ |
20 | 20 | if (empty($_SESSION[CANVAS_INSTANCE_URL]) && |
@@ -8,8 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | /* store any requested actions for future handling */ |
10 | 10 | $action = (empty($_REQUEST['action']) ? |
11 | - ACTION_UNSPECIFIED : |
|
12 | - strtolower($_REQUEST['action']) |
|
11 | + ACTION_UNSPECIFIED : strtolower($_REQUEST['action']) |
|
13 | 12 | ); |
14 | 13 | |
15 | 14 | /* action requests only come from outside the LTI! */ |
@@ -25,7 +24,7 @@ discard block |
||
25 | 24 | @session_unset(); |
26 | 25 | @session_start(); |
27 | 26 | @session_regenerate_id(true); |
28 | - $_SESSION[Toolbox::class] =& $toolbox; |
|
27 | + $_SESSION[Toolbox::class] = & $toolbox; |
|
29 | 28 | session_write_close(); |
30 | 29 | $toolbox->lti_authenticate(); |
31 | 30 | exit; |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | /* if not authenticated, default to showing credentials */ |
40 | 39 | } else { |
41 | 40 | $action = (empty($action) ? |
42 | - ACTION_CONFIG : |
|
43 | - $action |
|
41 | + ACTION_CONFIG : $action |
|
44 | 42 | ); |
45 | 43 | } |
46 | 44 | |
@@ -49,7 +47,7 @@ discard block |
||
49 | 47 | /* reset cached install data from config file */ |
50 | 48 | case ACTION_INSTALL: |
51 | 49 | $_SESSION['toolbox'] = Toolbox::fromConfiguration(CONFIG_FILE, true); |
52 | - $toolbox =& $_SESSION['toolbox']; |
|
50 | + $toolbox = & $_SESSION['toolbox']; |
|
53 | 51 | |
54 | 52 | /* test to see if we can connect to the API */ |
55 | 53 | try { |
@@ -148,8 +148,7 @@ |
||
148 | 148 | $enrollment = $toolbox->api_post( |
149 | 149 | ( |
150 | 150 | $courseEnrollment ? |
151 | - "/courses/{$_REQUEST['course']}/enrollments" : |
|
152 | - "/sections/{$_REQUEST['section']}/enrollments" |
|
151 | + "/courses/{$_REQUEST['course']}/enrollments" : "/sections/{$_REQUEST['section']}/enrollments" |
|
153 | 152 | ), |
154 | 153 | array( |
155 | 154 | 'enrollment[user_id]' => $user['id'], |
@@ -121,7 +121,7 @@ |
||
121 | 121 | /* ...and purge users who should not be enrolled */ |
122 | 122 | } elseif (!isset($potentialDuplicates[$enrollment['user']['id']])) { |
123 | 123 | if (empty($enrollment['id'])) { |
124 | - $toolbox->smarty_addMessage('No enrollment to delete', '<pre>'. print_r($enrollment, true) . '</pre>', NotificationMessage::WARNING); |
|
124 | + $toolbox->smarty_addMessage('No enrollment to delete', '<pre>' . print_r($enrollment, true) . '</pre>', NotificationMessage::WARNING); |
|
125 | 125 | } else { |
126 | 126 | $toolbox->api_delete( |
127 | 127 | "courses/$courseId/enrollments/{$enrollment['id']}", |
@@ -70,7 +70,7 @@ |
||
70 | 70 | if ($step == STEP_FORCE) { |
71 | 71 | try { |
72 | 72 | $notificationPreferences = []; |
73 | - foreach($_REQUEST['notification_preferences'] as $notification => $settings) { |
|
73 | + foreach ($_REQUEST['notification_preferences'] as $notification => $settings) { |
|
74 | 74 | if (!empty($settings['enabled']) && $settings['enabled']) { |
75 | 75 | $notificationPreferences[$notification]['frequency'] = $settings['frequency']; |
76 | 76 | } |