2 /****************************************************************/
\r
4 /****************************************************************/
\r
5 /* Copyright (c) 2002-2006 by Greg Gay & Joel Kronenberg */
\r
6 /* Adaptive Technology Resource Centre / University of Toronto */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or*/
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /****************************************************************/
\r
13 // $Id: merlot.php 6614 2006-09-27 19:32:29Z greg $
\r
16 define('AT_INCLUDE_PATH', '../../include/');
\r
17 require (AT_INCLUDE_PATH.'vitals.inc.php');
\r
18 admin_authenticate(AT_ADMIN_PRIV_MERLOT);
\r
21 if($_POST['submit']){
\r
22 $_POST['merlot_location'] = trim($_POST['merlot_location']);
\r
23 $_POST['merlot_key'] = trim($_POST['merlot_key']);
\r
25 if (!$_POST['merlot_location']){
\r
26 $msg->addError('MERLOTURL_ADD_EMPTY');
\r
29 if (!$_POST['merlot_key']){
\r
30 $msg->addError('MERLOTKEY_ADD_EMPTY');
\r
33 if (!$msg->containsErrors()) {
\r
34 $_POST['merlot_location'] = $addslashes($_POST['merlot_location']);
\r
35 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('merlot_location', '$_POST[merlot_location]')";
\r
36 mysql_query($sql, $db);
\r
38 $_POST['merlot_key'] = $addslashes($_POST['merlot_key']);
\r
39 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('merlot_key', '$_POST[merlot_key]')";
\r
40 mysql_query($sql, $db);
\r
42 $msg->addFeedback('MERLOT_CONFIG_SAVED');
\r
44 header('Location: '.$_SERVER['PHP_SELF']);
\r
48 require (AT_INCLUDE_PATH.'header.inc.php');
\r
50 <div class="input-form">
\r
52 <p><?php echo _AT('merlot_config'); ?></p>
\r
55 <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
\r
56 <div class="input-form">
\r
58 <p><label for="uri"><?php echo _AT('merlot_location'); ?></label></p>
\r
59 <input type="text" name="merlot_location" value="<?php echo $_config['merlot_location']; ?>" id="uri" size="80" style="min-width: 95%;" />
\r
61 <p><label for="key"><?php echo _AT('merlot_key'); ?></label></p>
\r
62 <input type="text" name="merlot_key" value="<?php echo $_config['merlot_key']; ?>" id="key" size="80" style="min-width: 95%;" />
\r
65 <div class="row buttons">
\r
66 <input type="submit" name="submit" value="<?php echo _AT('merlot_save'); ?>" />
\r
71 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>