@@ -116,7 +116,7 @@ |
||
| 116 | 116 | UserAPIToken_Exception::TOKEN_REQUIRED |
| 117 | 117 | ); |
| 118 | 118 | } |
| 119 | - if($this->consumerKey && $this->id && $this->sql) { |
|
| 119 | + if ($this->consumerKey && $this->id && $this->sql) { |
|
| 120 | 120 | $_token = $this->sql->real_escape_string($token); |
| 121 | 121 | if (!$this->sql->query("UPDATE `" . self::USER_TOKENS_TABLE . "` set `token` = '$_token' WHERE `consumer_key` = '{$this->consumerKey}' AND `id` = '{$this->id}'")) { |
| 122 | 122 | throw new UserAPIToken_Exception( |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $htaccessFile = __DIR__ . '/.htaccess'; |
| 99 | - if(!file_put_contents($htaccessFile, "AuthType Basic\nAuthName \"{$secrets->app->name} Admin\"\nAuthUserFile $htpasswdFile\nRequire valid-user\n")) { |
|
| 99 | + if (!file_put_contents($htaccessFile, "AuthType Basic\nAuthName \"{$secrets->app->name} Admin\"\nAuthUserFile $htpasswdFile\nRequire valid-user\n")) { |
|
| 100 | 100 | throw new CanvasAPIviaLTI_Installer_Exception( |
| 101 | 101 | "Failed to create $htaccessFile", |
| 102 | 102 | CanvasAPIviaLTI_Installer_Exception::HTACCESS_FILE |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } elseif (file_exists($ltiSchema)) { |
| 155 | 155 | $queries = explode(";", file_get_contents($ltiSchema)); |
| 156 | 156 | $created = true; |
| 157 | - foreach($queries as $query) { |
|
| 157 | + foreach ($queries as $query) { |
|
| 158 | 158 | if (!empty(trim($query))) { |
| 159 | 159 | if (!$sql->query($query)) { |
| 160 | 160 | throw new CanvasAPIviaLTI_Installer_Exception( |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | `synced` ASC |
| 15 | 15 | "); |
| 16 | 16 | |
| 17 | -while($schedule = $schedulesResponse->fetch_assoc()) { |
|
| 17 | +while ($schedule = $schedulesResponse->fetch_assoc()) { |
|
| 18 | 18 | $calendarResponse = $sql->query(" |
| 19 | 19 | SELECT * |
| 20 | 20 | FROM `calendars` |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | $smarty->assign('category', ''); |
| 7 | 7 | $smarty->assign('formAction', $metadata['APP_URL'] . '/import.php'); |
| 8 | 8 | $smarty->assign('formHidden', array( |
| 9 | - 'canvas_url' => $_SESSION['canvasInstanceUrl']. '/courses/' . $_SESSION['toolProvider']->user->getResourceLink()->settings['custom_canvas_course_id'] |
|
| 9 | + 'canvas_url' => $_SESSION['canvasInstanceUrl'] . '/courses/' . $_SESSION['toolProvider']->user->getResourceLink()->settings['custom_canvas_course_id'] |
|
| 10 | 10 | )); |
| 11 | 11 | $smarty->display('course.tpl'); |
| 12 | 12 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | /* ...otherwise, let's start with the SECRETS_FILE */ |
| 17 | 17 | } else { |
| 18 | - if(!file_exists(SECRETS_FILE)) { |
|
| 18 | + if (!file_exists(SECRETS_FILE)) { |
|
| 19 | 19 | if (isset($_REQUEST['step']) && $_REQUEST['step'] == CanvasAPIviaLTI_Installer::SECRETS_ENTERED_STEP) { |
| 20 | 20 | CanvasAPIviaLTI_Installer::createSecretsFile(CanvasAPIviaLTI_Installer::SECRETS_ENTERED_STEP); |
| 21 | 21 | } else { |
@@ -47,10 +47,11 @@ |
||
| 47 | 47 | /* look up consumer to edit, if requested */ |
| 48 | 48 | } elseif (isset($_REQUEST['consumer_key'])) { |
| 49 | 49 | $consumer = new LTI_Tool_Consumer($_REQUEST['consumer_key'], LTI_Data_Connector::getDataConnector($sql)); |
| 50 | - if (isset($_REQUEST['action'])) |
|
| 51 | - switch ($_REQUEST['action']) { |
|
| 50 | + if (isset($_REQUEST['action'])) { |
|
| 51 | + switch ($_REQUEST['action']) { |
|
| 52 | 52 | case 'delete': { |
| 53 | 53 | $consumer->delete(); |
| 54 | + } |
|
| 54 | 55 | break; |
| 55 | 56 | } |
| 56 | 57 | case 'select': { |
@@ -15,14 +15,14 @@ |
||
| 15 | 15 | ) |
| 16 | 16 | ); |
| 17 | 17 | do { |
| 18 | - foreach($events as $event) { |
|
| 18 | + foreach ($events as $event) { |
|
| 19 | 19 | $api->delete("calendar_events/{$event['id']}", |
| 20 | 20 | array( |
| 21 | 21 | 'cancel_reason' => $metadata['APP_NAME'] . " course_url={$_REQUEST['course_url']}" |
| 22 | 22 | ) |
| 23 | 23 | ); |
| 24 | 24 | } |
| 25 | - } while($events = $eventsApi->nextPage()); |
|
| 25 | + } while ($events = $eventsApi->nextPage()); |
|
| 26 | 26 | |
| 27 | 27 | $smarty->assign('content', 'Calendar purged.'); |
| 28 | 28 | } else { |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | $FIELD_MAP = array( |
| 86 | 86 | 'calendar_event[title]' => 'SUMMARY', |
| 87 | 87 | 'calendar_event[description]' => 'DESCRIPTION', |
| 88 | - 'calendar_event[start_at]' => array ( |
|
| 88 | + 'calendar_event[start_at]' => array( |
|
| 89 | 89 | 0 => 'X-CURRENT-DTSTART', |
| 90 | 90 | 1 => 'DTSTART' |
| 91 | 91 | ), |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | $_REQUEST['canvas_url'] = $argv[2]; |
| 7 | 7 | $_REQUEST['schedule'] = $argv[3]; |
| 8 | 8 | |
| 9 | - define ('IGNORE_LTI', true); |
|
| 9 | + define('IGNORE_LTI', true); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | require_once 'common.inc.php'; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | if ($canvasContext = getCanvasContext($_REQUEST['canvas_url'])) { |
| 101 | 101 | /* check ICS feed to be sure it exists */ |
| 102 | - if(urlExists($_REQUEST['cal'])) { |
|
| 102 | + if (urlExists($_REQUEST['cal'])) { |
|
| 103 | 103 | /* look up the canvas object -- mostly to make sure that it exists! */ |
| 104 | 104 | if ($canvasObject = $api->get($canvasContext['verification_url'])) { |
| 105 | 105 | |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | // TODO:0 the best window for syncing would be the term of the course in question, right? issue:12 |
| 186 | 186 | // TODO:0 Arbitrarily selecting events in for a year on either side of today's date, probably a better system? issue:12 |
| 187 | 187 | foreach ($ics->selectComponents( |
| 188 | - date('Y')-1, // startYear |
|
| 188 | + date('Y') - 1, // startYear |
|
| 189 | 189 | date('m'), // startMonth |
| 190 | 190 | date('d'), // startDay |
| 191 | - date('Y')+1, // endYEar |
|
| 191 | + date('Y') + 1, // endYEar |
|
| 192 | 192 | date('m'), // endMonth |
| 193 | 193 | date('d'), // endDay |
| 194 | 194 | 'vevent', // cType |
@@ -305,7 +305,9 @@ discard block |
||
| 305 | 305 | ), false) . '</pre>', |
| 306 | 306 | NotificationMessage::ERROR |
| 307 | 307 | ); |
| 308 | - if (php_sapi_name() != 'cli') $smarty->display('page.tpl'); |
|
| 308 | + if (php_sapi_name() != 'cli') { |
|
| 309 | + $smarty->display('page.tpl'); |
|
| 310 | + } |
|
| 309 | 311 | exit; |
| 310 | 312 | } |
| 311 | 313 | $sql->query(" |
@@ -421,7 +423,9 @@ discard block |
||
| 421 | 423 | 'The Canvas URL you submitted could not be parsed.<pre>' . $_REQUEST['canvas_url'] . '</pre>', |
| 422 | 424 | NotificationMessage::ERROR |
| 423 | 425 | ); |
| 424 | - if (php_sapi_name() != 'cli') $smarty->display('page.tpl'); |
|
| 426 | + if (php_sapi_name() != 'cli') { |
|
| 427 | + $smarty->display('page.tpl'); |
|
| 428 | + } |
|
| 425 | 429 | exit; |
| 426 | 430 | } |
| 427 | 431 | } |