changed git call from https to git readonly
[atutor.git] / mods / mediawiki / index_admin.php
1 <?php\r
2 define('AT_INCLUDE_PATH', '../../include/');\r
3 require (AT_INCLUDE_PATH.'vitals.inc.php');\r
4 $_custom_css = $_base_path . 'mods/mediawiki/module.css'; // use a custom stylesheet\r
5 admin_authenticate(AT_ADMIN_PRIV_MEDIAWIKI);\r
6 \r
7 $_POST['mw-url'] = $addslashes($_POST['mw-url']);\r
8 \r
9 if($_POST['submit']){\r
10         foreach($_POST as $key=>$mw_config)\r
11         if($key != "submit"){\r
12         $sql="REPLACE INTO ".TABLE_PREFIX."config SET name='$key', value='".$mw_config."'";\r
13         if($result= mysql_query($sql, $db)){\r
14                 $msg->addFeedback("MW_CONFIG_SAVED");\r
15                 $_config['mw-url'] = $_POST['mw-url'];\r
16 \r
17         }else{\r
18                 $msg->addError("WP_CONFIG_FAIL");\r
19         }\r
20 \r
21         }\r
22 }\r
23 \r
24 require (AT_INCLUDE_PATH.'header.inc.php');\r
25 \r
26 ?>\r
27 \r
28 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">\r
29 <label for="mw-url"><?php echo _AT('mediawiki_login_url'); ?></label>\r
30 <input type="text" name="mw-url" id="mw-url" value="<?php if($_config['mw-url']){echo $_config['mw-url'];}else{ echo 'http://';} ?>" size="60" /><br />\r
31 \r
32 <input type="submit" name="submit" value="<?php echo _AT('mediawiki_save'); ?>">\r
33 </form>\r
34 \r
35 \r
36 <?php\r
37 if($_config['mw-url']){?>\r
38         <br /><br /><a href="<?php echo $_config['mw-url']; ?>index.php?title=Special:UserLogin&returnto=Special:UserLogin" target="toolframe"><?php echo _AT('mediawiki_login'); ?></a>\r
39         <iframe name="toolframe" src="<?php echo $_config['mw-url']; ?>" width="95%" height="450" id="frame_set">\r
40         <p><?php echo _AT('mediawiki_no_iframes',$_config['mw-url']); ?> ?></p>\r
41         </iframe>\r
42 <?php }else{ ?>\r
43         <p><?php echo _AT('mediawiki_do_setup'); ?> ?></p>\r
44 \r
45 <?php } ?>\r
46 \r
47 \r
48 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>