コード例 #1
0
ファイル: ltilogin.class.php プロジェクト: vinod-co/centa
 function init($object)
 {
     parent::init($object);
     $this->lti = UoN_LTI::get_instance();
     $this->lti->init_lti0($this->db);
     $this->savetodebug('Starting LTI');
     $this->lti->init_lti();
     if (!isset($this->lti_i)) {
         $this->lti_i = lti_integration::load();
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: vinod-co/centa
            }
            $extra = "<input type=\"radio\" name=\"paperlinkID\" id=\"paperlinkID-{$plk}\" value=\"{$plk}\"{$checked}><label for=\"paperlinkID-{$plk}\">";
            $extra1 = "</label>";
            echo "<div style=\"padding-left:20px\">{$extra}<img src=\"../artwork/" . $icons[$paper_type] . "_16.gif\" width=\"16\" height=\"16\" alt=\"" . $paper_type . "\" />&nbsp;" . $paper_title . "{$extra1}</div>\n";
            $_SESSION['postlookup'][$plk] = array($crypt_name, $moduleid);
            $plk++;
        }
        echo '</div>';
        $block_id++;
    } else {
        // no papers
    }
    $results2->close();
    return array($block_id, $plk);
}
$lti = UoN_LTI::get_instance();
if (!$lti->valid) {
    $tempvar = $lti->message;
    if (!isset($string[$tempvar])) {
        $string[$tempvar] = $lti->message;
    }
    $message = $string[$tempvar];
    UserNotices::display_notice($string['LTIFAILURE'], $message, '../artwork/access_denied.png', '#C00000');
    $mysqli->close();
    exit;
}
if (!isset($lti_i)) {
    $lti_i = lti_integration::load();
}
if (isset($_REQUEST['paperlinkID'])) {
    list($retlookup, $retlookup2) = $_SESSION['postlookup'][$_REQUEST['paperlinkID']];
コード例 #3
0
ファイル: play.php プロジェクト: jak786/xerteonlinetoolkits
     $mysqli = new mysqli($xerte_toolkits_site->database_host, $xerte_toolkits_site->database_username, $xerte_toolkits_site->database_password, $xerte_toolkits_site->database_name);
     if ($mysqli->error) {
         try {
             throw new Exception("0MySQL error {$mysqli->error} <br> Query:<br> {$query}", $mysqli->errno);
         } catch (Exception $e) {
             echo "Error No: " . $e->getCode() . " - " . $e->getMessage() . "<br />";
             echo nl2br($e->getTraceAsString());
         }
     }
 }
 if (!isset($lti)) {
     require_once 'LTI/ims-lti/UoN_LTI.php';
     if (strlen($xerte_toolkits_site->database_table_prefix) > 0) {
         $lti = new UoN_LTI($mysqli, array('table_prefix' => $xerte_toolkits_site->database_table_prefix));
     } else {
         $lti = new UoN_LTI($mysqli);
     }
     if (session_id() == '') {
         session_start();
     }
     $lti->init_lti();
 }
 if ($lti->valid) {
     $success = true;
     unset($errors);
 } else {
     $returnedproc = login_processing(false);
     list($success, $errors) = $returnedproc;
 }
 if ($success && empty($errors)) {
     //sucessfull authentication
コード例 #4
0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
require_once "../../../config.php";
require "../user_library.php";
require "management_library.php";
if (is_user_admin()) {
    if (!isset($mysqli)) {
        $mysqli = new mysqli($xerte_toolkits_site->database_host, $xerte_toolkits_site->database_username, $xerte_toolkits_site->database_password, $xerte_toolkits_site->database_name);
        if ($mysqli->error) {
            try {
                throw new Exception("0MySQL error {$mysqli->error} <br> Query:<br> {$query}", $mysqli->errno);
            } catch (Exception $e) {
                echo "Error No: " . $e->getCode() . " - " . $e->getMessage() . "<br />";
                echo nl2br($e->getTraceAsString());
            }
        }
    }
    if (!isset($lti)) {
        require_once '../../../LTI/ims-lti/UoN_LTI.php';
        $lti = new UoN_LTI($mysqli);
    }
    $lti->update_lti_key($_REQUEST['lti_keys_id'], $_REQUEST['lti_keys_name'], $_REQUEST['lti_keys_key'], $_REQUEST['lti_keys_secret'], $_REQUEST['lti_keys_context_id']);
    include 'site.php';
} else {
    management_fail();
}
コード例 #5
0
ファイル: add_LTIkeys.php プロジェクト: vinod-co/centa
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rogō.  If not, see <http://www.gnu.org/licenses/>.
/**
 *
 * @author Simon Atack
 * @version 1.0
 * @copyright Copyright (c) 2014 The University of Nottingham
 * @package
 */
require '../include/sysadmin_auth.inc';
require_once 'ims-lti/UoN_LTI.php';
$lti = new UoN_LTI();
$lti->init_lti0($mysqli);
if (isset($_POST['submit'])) {
    $ltiname = trim($_POST['ltiname']);
    $ltikey = trim($_POST['ltikey']);
    $ltisec = trim($_POST['ltisec']);
    $lticontext = trim($_POST['lticontext']);
    $insert_id = $lti->add_lti_key($ltiname, $ltikey, $ltisec, $lticontext);
    header("location: lti_keys_list.php");
    exit;
} else {
    ?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
コード例 #6
0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
require_once "../../../config.php";
require "../user_library.php";
require "management_library.php";
if (is_user_admin()) {
    if (!isset($mysqli)) {
        $mysqli = new mysqli($xerte_toolkits_site->database_host, $xerte_toolkits_site->database_username, $xerte_toolkits_site->database_password, $xerte_toolkits_site->database_name);
        if ($mysqli->error) {
            try {
                throw new Exception("0MySQL error {$mysqli->error} <br> Query:<br> {$query}", $mysqli->errno);
            } catch (Exception $e) {
                echo "Error No: " . $e->getCode() . " - " . $e->getMessage() . "<br />";
                echo nl2br($e->getTraceAsString());
            }
        }
    }
    if (!isset($lti)) {
        require_once '../../../LTI/ims-lti/UoN_LTI.php';
        $lti = new UoN_LTI($mysqli);
    }
    $lti->delete_lti_key($_REQUEST['lti_keys_id']);
    include 'site.php';
} else {
    management_fail();
}
コード例 #7
0
ファイル: do_delete_LTIkeys.php プロジェクト: vinod-co/centa
// You should have received a copy of the GNU General Public License
// along with Rogō.  If not, see <http://www.gnu.org/licenses/>.
/**
 *
 * Delete an LTI key - SysAdmin only.
 *
 * @author Simon Wilkinson
 * @version 1.0
 * @copyright Copyright (c) 2014 The University of Nottingham
 * @package
 */
require '../include/sysadmin_auth.inc';
require_once '../include/errors.inc';
require_once '../LTI/ims-lti/UoN_LTI.php';
$LTIkeysid = check_var('LTIkeysID', 'POST', true, false, true);
$lti = new UoN_LTI();
$lti->init_lti0($mysqli);
if (!$lti->lti_key_exists($LTIkeysid)) {
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
}
$lti->delete_lti_key($LTIkeysid);
?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="content-type" content="text/html;charset=<?php 
echo $configObject->get('cfg_page_charset');
?>
" />
コード例 #8
0
        login_prompt($errors, '../');
    }
}
$mysqli = new mysqli($xerte_toolkits_site->database_host, $xerte_toolkits_site->database_username, $xerte_toolkits_site->database_password, $xerte_toolkits_site->database_name);
if ($mysqli->error) {
    try {
        throw new Exception("0MySQL error {$mysqli->error} <br> Query:<br> {$query}", $mysqli->errno);
    } catch (Exception $e) {
        echo "Error No: " . $e->getCode() . " - " . $e->getMessage() . "<br />";
        echo nl2br($e->getTraceAsString());
    }
}
if (strlen($xerte_toolkits_site->database_table_prefix) > 0) {
    $lti = new UoN_LTI($mysqli, array('table_prefix' => $xerte_toolkits_site->database_table_prefix));
} else {
    $lti = new UoN_LTI($mysqli);
}
require_once '../' . $xerte_toolkits_site->php_library_path . "login_library.php";
if (session_id() == '') {
    session_start();
}
$lti->init_lti();
$errors = array();
if (!$lti->valid) {
    echo 'ERROR INVALID LTI<br>';
    echo $lti->message;
    echo '<br>';
    exit;
}
//LTI launch valid
//lookup the lti user association
コード例 #9
0
 echo "<div class=\"template\" id=\"ltikeys\"><p>" . MANAGEMENT_SITE_LTI_KEYS . " <button type=\"button\" class=\"xerte_button\" id=\"ltikeys_btn\"onclick=\"javascript:templates_display('ltikeys')\">" . MANAGEMENT_VIEW . "</button></p></div><div class=\"template_details\" id=\"ltikeys_child\">";
 echo "<div id=\"ltikeys\">";
 if (!isset($mysqli)) {
     $mysqli = new mysqli($xerte_toolkits_site->database_host, $xerte_toolkits_site->database_username, $xerte_toolkits_site->database_password, $xerte_toolkits_site->database_name);
     if ($mysqli->error) {
         try {
             throw new Exception("0MySQL error {$mysqli->error} <br> Query:<br> {$query}", $mysqli->errno);
         } catch (Exception $e) {
             echo "Error No: " . $e->getCode() . " - " . $e->getMessage() . "<br />";
             echo nl2br($e->getTraceAsString());
         }
     }
 }
 if (!isset($lti)) {
     require_once '../../../LTI/ims-lti/UoN_LTI.php';
     $lti = new UoN_LTI($mysqli);
 }
 $dataret = $lti->get_lti_keys();
 $dataret['NEW'] = array('lti_keys_id' => 'NEW', 'lti_keys_key' => '', 'lti_keys_secret' => '', 'lti_keys_name' => LTI_KEYS_NEW, 'lti_keys_context_id' => '', 'lti_keys_deleted' => '', 'lti_keys_updated_on' => '');
 foreach ($dataret as $lti_key_id => $row) {
     //array('lti_keys_id'=>$lti_keys_id, 'lti_keys_key'=>$lti_keys_key, 'lti_keys_secret'=>$lti_keys_secret, 'lti_keys_name'=>$lti_keys_name, 'lti_keys_context_id'=>$lti_keys_context_id, 'lti_keys_deleted'=>$lti_keys_deleted, 'lti_keys_updated_on'=>$lti_keys_updated_on);
     $click = LTI_TOGGLE;
     $click2 = "&nbsp;&nbsp;<a href=\"javascript:delete_LTI_key('" . $row['lti_keys_id'] . "')\">" . LTI_KEYS_DELETE . "</a>";
     if ($row['lti_keys_id'] == 'NEW') {
         $click = LTI_KEYS_ADD;
         $click2 = '';
     }
     echo "<div class=\"template\" id=\"" . $row['lti_keys_id'] . "\" savevalue=\"" . $row['lti_keys_id'] . "\"><p>" . $row['lti_keys_name'] . " <a href=\"javascript:templates_display('" . $row['lti_keys_id'] . "')\">" . $click . "</a>{$click2}</p></div><div class=\"template_details\" id=\"" . $row['lti_keys_id'] . "_child\">";
     echo "<p>" . LTI_KEYS_NAME . "<form><textarea id=\"lti_keys_name" . $row['lti_keys_id'] . "\">" . $row['lti_keys_name'] . "</textarea></form></p>";
     echo "<p>" . LTI_KEYS_KEY . "<form><textarea id=\"lti_keys_key" . $row['lti_keys_id'] . "\">" . $row['lti_keys_key'] . "</textarea></form></p>";
     echo "<p>" . LTI_KEYS_SECRET . "<form><textarea id=\"lti_keys_secret" . $row['lti_keys_id'] . "\">" . $row['lti_keys_secret'] . "</textarea></form></p>";
コード例 #10
0
ファイル: LTItest.php プロジェクト: vinod-co/centa
<?php

// This file is part of Rogō
//
// Rogō is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Rogō is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rogō.  If not, see <http://www.gnu.org/licenses/>.
require_once 'ims-lti\\UoN_LTI.php';
$root = str_replace('/include', '/', str_replace('\\', '/', dirname(__FILE__)));
$root = $root . '/../';
require_once $root . 'include/load_config.php';
require_once $cfg_web_root . 'classes/dbutils.class.php';
$mysqli = DBUtils::get_mysqli_link($cfg_db_host, $cfg_db_username, $cfg_db_passwd, $cfg_db_database, $cfg_db_charset, $notice, $dbclass);
$lti = new UoN_LTI($mysqli);
$lti->init_lti0($mysqli);
$lti->init_lti(true, false);
print "<pre>";
print_r($lti);
var_dump($lti);
echo $lti->dump();
print "</pre>";
コード例 #11
0
ファイル: edit_LTIkeys.php プロジェクト: vinod-co/centa
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rogō.  If not, see <http://www.gnu.org/licenses/>.
/**
 *
 * @author Simon Atack
 * @version 1.0
 * @copyright Copyright (c) 2014 The University of Nottingham
 * @package
 */
require '../include/sysadmin_auth.inc';
require_once '../include/errors.inc';
require_once 'ims-lti/UoN_LTI.php';
require_once '../classes/logger.class.php';
$lti = new UoN_LTI($mysqli);
$lti->init_lti0($mysqli);
$LTIkeysid = check_var('LTIkeysid', 'GET', true, false, true);
if (!$lti->lti_key_exists($LTIkeysid)) {
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
}
$result = $mysqli->prepare("SELECT id, oauth_consumer_key, secret, name, context_id FROM lti_keys WHERE id = ?");
$result->bind_param('i', $LTIkeysid);
$result->execute();
$result->bind_result($ltis['id'], $ltis['oauth_consumer_key'], $ltis['secret'], $ltis['name'], $ltis['context_id']);
$result->fetch();
$result->close();
if (isset($_POST['submit'])) {
    $ltiname = trim($_POST['ltiname']);
    $ltikey = trim($_POST['ltikey']);