Skip to content

Commit

Permalink
replaced mysql call with mysqli to remote LMS link
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrgay committed Feb 10, 2016
1 parent 703f28e commit 827cf81
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions oauth/lti/util/lti_util.php
Expand Up @@ -74,22 +74,21 @@ function __construct($parm=false, $usesession=true, $doredirect=true) {
define('TR_INCLUDE_PATH', '../../include/');
include_once(TR_INCLUDE_PATH.'config.inc.php');

mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db(DB_NAME);

$dbr = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

$sql = 'SELECT * FROM '.$parm['table'].' WHERE '.
($parm['key_column'] ? $parm['key_column'] : 'oauth_consumer_key').
'='.
"'".mysql_real_escape_string($oauth_consumer_key)."'";
"'".mysqli_real_escape_string($dbr, $oauth_consumer_key)."'";

$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
$result = mysqli_query($dbr, $sql);
$num_rows = mysqli_num_rows($result);

if ( $num_rows != 1 ) {
$this->message = "Your consumer is not authorized oauth_consumer_key=".$oauth_consumer_key;
return;
} else {
while ($row = mysql_fetch_assoc($result)) {
while ($row = mysqli_fetch_assoc($result)) {
$secret = $row[$parm['secret_column']?$parm['secret_column']:'secret'];
$context_id = $row[$parm['context_column']?$parm['context_column']:'context_id'];
if ( $context_id ) $this->context_id = $context_id;
Expand Down

0 comments on commit 827cf81

Please sign in to comment.