Skip to content

Commit

Permalink
Merge pull request #86 from Learnosity/LRN-19033/feature/vg7-support
Browse files Browse the repository at this point in the history
Use $domain rather than $_SERVER['SERVER_NAME']
  • Loading branch information
mcgoughn committed Jul 20, 2018
2 parents 14a44a1 + 97b2004 commit d699a30
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
5 changes: 3 additions & 2 deletions www/authoring/questioneditor/algorithmicMath/demo.php
@@ -1,5 +1,6 @@
<?php
$host = $_SERVER['HTTP_HOST'];
include_once '../../../../config.php';

$version = '1.0.0';
$versionPath = 'dev';

Expand Down Expand Up @@ -56,7 +57,7 @@

<!-- EXAMPLE -->
<script>
var domain = '<?php echo $host; ?>';
var domain = '<?php echo $domain; ?>';
var versionPath = '<?php echo $versionPath; ?>';
</script>

Expand Down
2 changes: 1 addition & 1 deletion www/casestudies/customquestions/custom.php
Expand Up @@ -10,7 +10,7 @@

$security = [
'user_id' => $studentid,
'domain' => $_SERVER['SERVER_NAME'],
'domain' => $domain,
'consumer_key' => $consumer_key
];

Expand Down
2 changes: 1 addition & 1 deletion www/casestudies/customquestions/custom_box_whisker.php
Expand Up @@ -10,7 +10,7 @@

$security = [
'user_id' => $studentid,
'domain' => $_SERVER['SERVER_NAME'],
'domain' => $domain,
'consumer_key' => $consumer_key
];

Expand Down
2 changes: 1 addition & 1 deletion www/casestudies/customquestions/custom_mathcore.php
Expand Up @@ -10,7 +10,7 @@

$security = [
'user_id' => $studentid,
'domain' => $_SERVER['SERVER_NAME'],
'domain' => $domain,
'consumer_key' => $consumer_key
];

Expand Down
2 changes: 1 addition & 1 deletion www/casestudies/customquestions/custom_percentage_bar.php
Expand Up @@ -10,7 +10,7 @@

$security = [
'user_id' => $studentid,
'domain' => $_SERVER['SERVER_NAME'],
'domain' => $domain,
'consumer_key' => $consumer_key
];

Expand Down
2 changes: 1 addition & 1 deletion www/casestudies/customquestions/custom_shorttext.php
Expand Up @@ -10,7 +10,7 @@

$security = [
'user_id' => $studentid,
'domain' => $_SERVER['SERVER_NAME'],
'domain' => $domain,
'consumer_key' => $consumer_key
];

Expand Down
Expand Up @@ -10,7 +10,7 @@

$security = [
'user_id' => $studentid,
'domain' => $_SERVER['SERVER_NAME'],
'domain' => $domain,
'consumer_key' => $consumer_key
];

Expand Down
10 changes: 9 additions & 1 deletion www/config.php
Expand Up @@ -14,7 +14,15 @@
// Note - Consumer secret should never get displayed on the page - only used for creation of signature server side
$consumer_secret = '74c5fd430cf1242a527f6223aebd42d30464be22';

// Some products need the domain as part of the security signature. Demos has been tested on "localhost"
// Some products need the domain (and domain only: no port number) as part of the security signature.
//
// Note that using SERVER_NAME may cause issues leading to signature mismatches if SERVER_NAME differs from the name
// the client is using to access the server, as is the case when using aliases. In this case, using HTTP_HOST may address the issue
// This comes with the caveat that HTTP_HOST contains the port used by the client, if non-standard, which will also
// break the signature. If using server aliases on non-standard port, it will be necessary to trim the HTTP_HOST value
// after the last colon (:), to remove the port number.
//
// Demos has been tested on "localhost"
$domain = $_SERVER['SERVER_NAME'];

// Generate timestamp in format YYYYMMDD-HHMM for use in signature
Expand Down

0 comments on commit d699a30

Please sign in to comment.