2 /****************************************************************/
\r
4 /****************************************************************/
\r
5 /* Copyright (c) 2002-2010 */
\r
6 /* Inclusive Design Institute */
\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
14 define('AT_INCLUDE_PATH', '../../../../include/');
\r
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
16 admin_authenticate(AT_ADMIN_PRIV_ADMIN);
\r
18 function getValidURI($uri)
\r
20 if (substr($uri, 0, 7) != 'http://' && substr($uri, 0, 8) != 'https://') {
\r
23 // add ending slash if uri does not contain
\r
24 if (substr($uri, -1) != '/') {
\r
28 $connection = @file_get_contents($uri.'index.php');
\r
37 if($_POST['submit']){
\r
38 $_POST['transformable_uri'] = trim($_POST['transformable_uri']);
\r
39 $_POST['transformable_web_service_id'] = trim($_POST['transformable_web_service_id']);
\r
40 $_POST['transformable_oauth_expire'] = intval($_POST['transformable_oauth_expire']);
\r
42 if ($_POST['transformable_uri'] == ''){
\r
43 $msg->addError('TRANSFORMABLE_URI_EMPTY');
\r
46 $_POST['transformable_uri'] = getValidURI($_POST['transformable_uri']);
\r
48 if (!$_POST['transformable_uri']){
\r
49 $msg->addError('TRANSFORMABLE_URI_INVALID');
\r
52 if (!$_POST['transformable_web_service_id']){
\r
53 $msg->addError('TRANSFORMABLE_ID_EMPTY');
\r
56 if (!$msg->containsErrors()) {
\r
57 $_POST['transformable_uri'] = $addslashes($_POST['transformable_uri']);
\r
58 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('transformable_uri', '".$_POST['transformable_uri']."')";
\r
59 mysql_query($sql, $db);
\r
61 $_POST['transformable_web_service_id'] = $addslashes($_POST['transformable_web_service_id']);
\r
62 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('transformable_web_service_id', '".$_POST['transformable_web_service_id']."')";
\r
63 mysql_query($sql, $db);
\r
65 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('transformable_oauth_expire', '".$_POST['transformable_oauth_expire']."')";
\r
66 mysql_query($sql, $db);
\r
68 $msg->addFeedback('TRANSFORMABLE_CONFIG_SAVED');
\r
70 header('Location: '.$_SERVER['PHP_SELF']);
\r
75 $onload = "document.form.transformable_uri.focus();";
\r
76 require (AT_INCLUDE_PATH.'header.inc.php');
\r
78 <div class="input-form">
\r
80 <p><?php echo _AT('tile_setup_txt'); ?></p>
\r
83 <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" name="form">
\r
84 <div class="input-form">
\r
86 <p><label for="uri"><?php echo _AT('transformable_uri'); ?></label></p>
\r
87 <input type="text" name="transformable_uri" value="<?php echo $_config['transformable_uri']; ?>" id="uri" size="80" style="min-width: 95%;" />
\r
89 <p><label for="key"><?php echo _AT('web_service_id'); ?></label></p>
\r
90 <input type="text" name="transformable_web_service_id" value="<?php echo $_config['transformable_web_service_id']; ?>" id="key" size="80" style="min-width: 95%;" />
\r
92 <p><label for="key"><?php echo _AT('oauth_expire'); ?></label></p>
\r
93 <input type="text" name="transformable_oauth_expire" value="<?php echo $_config['transformable_oauth_expire']; ?>" id="key" size="20" /> <?php echo _AT('seconds'); ?><br />
\r
94 <small>· <?php echo _AT('oauth_expire_note'); ?><br />
\r
97 <div class="row buttons">
\r
98 <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" />
\r
103 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>