changed git call from https to git readonly
[atutor.git] / mods / elluminate / elluminate.php
1 <?php\r
2 /*\r
3 This is the ATutor Elluminate module page. It allows an admin user\r
4 to set or edit  the URL for the Elluminate installation for ATutor, and define an optional guest password.\r
5 \r
6 */\r
7 define('AT_INCLUDE_PATH', '../../include/');\r
8 require (AT_INCLUDE_PATH.'vitals.inc.php');\r
9 admin_authenticate(AT_ADMIN_PRIV_ELLUMINATE);\r
10 \r
11 if (isset($_POST['submit'])) {\r
12         $_POST['uri'] = trim($_POST['uri']);\r
13 \r
14         if (!$_POST['uri']){\r
15                 $msg->addError('ELLUMINATEURL_ADD_EMPTY');\r
16         }\r
17                         \r
18         if (!$msg->containsErrors()) {\r
19                 $_POST['uri'] = $addslashes($_POST['uri']);\r
20                 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('elluminate', '$_POST[uri]')";\r
21                 mysql_query($sql, $db);\r
22                 $_POST['pw'] = $addslashes($_POST['pw']);\r
23                 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('elluminate_pw', '$_POST[pw]')";\r
24                 mysql_query($sql, $db);\r
25                 $msg->addFeedback('ELLUMINATEURL_ADD_SAVED');\r
26 \r
27                 header('Location: '.$_SERVER['PHP_SELF']);\r
28                 exit;\r
29         }\r
30 }\r
31 \r
32 require (AT_INCLUDE_PATH.'header.inc.php');\r
33 \r
34 ?>\r
35 \r
36 <?php if ($_config['elluminate']): ?>\r
37         <div class="input-form">\r
38                 <div class="row">\r
39                         <p><?php echo _AT('elluminate_text'); ?></p>\r
40                 </div>\r
41                 <div class="row buttons">\r
42                         <form action="<?php echo $_config['elluminate']; ?>" method="get">\r
43                                 <input type="submit" value="<?php echo _AT('elluminate_open'); ?>" onclick="window.open('<?php echo $_config['elluminate']; ?>','mywindow','width=800,height=600,scrollbars=yes, resizable=yes', 'false');true;" />\r
44                                 <input type="hidden" name="username" value="admin">\r
45                                 <input type="hidden" name="password" value="<?php echo $_config['elluminate_pw']; ?>">\r
46                         </form>\r
47                 </div>\r
48         </div>\r
49 <?php else: ?>\r
50         <div class="input-form">\r
51                 <div class="row">\r
52                         <p><?php echo _AT('elluminate_missing_url');  ?></p>\r
53                 </div>\r
54         </div>\r
55 <?php endif; ?>\r
56 \r
57 <form action="<?php  $_SERVER['PHP_SELF']; ?>" method="post">\r
58         <div class="input-form">\r
59                 <div class="row">\r
60                         <p><label for="uri"><?php echo _AT('elluminate_location'); ?></label></p>\r
61         \r
62                         <input type="text" name="uri" value="<?php echo $_config['elluminate']; ?>" id="uri" size="80" style="min-width: 95%;" />\r
63                 </div>\r
64                 <div class="row">\r
65                         <p><label for="pw"><?php echo _AT('elluminate_pw'); ?></label></p>\r
66         \r
67                         <input type="text" name="pw" value="<?php echo $_config['elluminate_pw']; ?>" id="pw" size="20" style="min-width: 55%;" />\r
68                 </div>\r
69                 <div class="row buttons">\r
70                         <input type="submit" name="submit" value="<?php echo _AT('save'); ?>"  />\r
71                 </div>\r
72         </div>\r
73 </form>\r
74 \r
75 <?php  require (AT_INCLUDE_PATH.'footer.inc.php'); ?>