public static function authPing() { try { $scormcloudorigin = ScormEngineUtilities::getCanonicalOriginString("IgnitorLabs", "Ignitor Portal", "Version 2.0"); $ScormService = new ScormEngineService(ScormCloudAPIController::$scromCloudUrl, ScormCloudAPIController::$scromCloudAppId, ScormCloudAPIController::$scormCloudSecretKey, ScormCloudAPIController::$scormcloudorigin); $debugService = $ScormService->getdebugService(); if ($debugService->CloudAuthPing()) { return json_encode("success"); } else { return json_encode("failure"); } } catch (Exception $e) { $app->halt("400", json_encode($e->getMessage())); return json_encode("failure"); } }
$lrsAccountService = $ScormService->getLrsAccountService(); write_log('lrsAccountService Created'); if (isset($_POST['submit'])) { $url = $_REQUEST['callbackurl']; $lrsAccountService->setAppLrsAuthCallbackUrl($url); echo 'Succes!'; } echo '<form action="ActivityProviderListSample.php" method="POST">'; ?> <h3>Set Auth CallBack Url</h3> URL: <input type="text" name="callbackurl" /><br/> <input type="submit" name="submit" value="Submit" /> </form> <br/><br/> <?php $debugService = $ScormService->getdebugService(); if ($debugService->CloudPing()) { echo "<p style='color:green'>CloudPing call was successful.</p>"; } else { echo "<p style='color:red'>CloudPing call was not successful.</p>"; } if ($debugService->CloudAuthPing()) { echo "<p style='color:green'>CloudAuthPing call was successful.</p>"; } else { echo "<p style='color:red'>CloudAuthPing call was not successful.</p>"; } echo "<br/><br/>"; echo '<a href="AddActivityProviderSample.php">Add Activity Provider</a>'; echo "<br/><br/>"; write_log('Getting listActivityProviders'); $allResults = $lrsAccountService->listActivityProviders();