Small update to installer. :o
[iDB.git] / admin.php
blob34d7fa1319ff470ab92dee483314a7b9fecb1440
1 <?php
2 /*
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2010 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
14 $FileInfo: admin.php - Last Update: 09/24/2010 SVN 562 - Author: cooldude2k $
16 if(ini_get("register_globals")) {
17 require_once('inc/misc/killglobals.php'); }
18 require('preindex.php');
19 $usefileext = $Settings['file_ext'];
20 if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
21 $filewpath = $exfile['admin'].$usefileext.$_SERVER['PATH_INFO'];
22 if($GroupInfo['ViewDBInfo']=="yes") {
23 if($_GET['act']=="settings"||$_GET['act']=="sql") {
26 <?php if($Settings['vercheck']===1) { ?>
27 <script type="text/javascript" src="<?php echo $VerCheckURL."&amp;name=".urlencode($iDBVerName)."&amp;redirect=js"; ?>"></script>
28 <?php } if($Settings['vercheck']===2) { ?>
29 <script type="text/javascript" src="<?php echo $VerCheckURL."&amp;bid=".$Settings['bid']."&amp;vercheck=newtype&amp;redirect=js"; ?>"></script>
30 <?php } } } ?>
32 <title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
33 </head>
34 <body>
35 <?php
36 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
37 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
38 $_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
39 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
40 $_SESSION['ViewingFile'] = $exfile['index']; }
41 $_SESSION['PreViewingTitle'] = "Viewing";
42 $_SESSION['ViewingTitle'] = "Board index";
43 if(!isset($_GET['subact'])) { $_GET['subact'] = null; }
44 if(!isset($_POST['subact'])) { $_POST['subact'] = null; }
45 if(!isset($_GET['menu'])) { $_GET['menu'] = null; }
46 $AdminMenu = null;
47 require($SettDir['inc'].'navbar.php');
48 if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
49 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
50 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
51 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
52 if($_GET['act']==null) {
53 $_GET['act']="view"; }
54 if($_GET['act']=="view"&&$GroupInfo['ViewDBInfo']!="yes") {
55 $_GET['act']="view"; }
56 if($_GET['act']=="vercheck"&&$GroupInfo['ViewDBInfo']=="yes") {
57 if($Settings['vercheck']!=1&&$Settings['vercheck']!=2) {
58 $Settings['vercheck'] = 1; }
59 if($Settings['vercheck']===1) {
60 $addredirect = null;
61 if(isset($_GET['redirect'])) { $addredirect = "&redirect=".urlencode($_GET['redirect']); }
62 header("Location: ".$VerCheckURL."&name=".urlencode($iDBVerName).$addredirect); }
63 if($Settings['vercheck']===2) {
64 $addredirect = null;
65 if(isset($_GET['redirect'])) { $addredirect = "&redirect=".urlencode($_GET['redirect']); }
66 header("Location: ".$VerCheckURL."&bid=".$Settings['bid']."&vercheck=newtype".$addredirect); } }
67 if($_GET['act']=="view")
68 { $AdminMenu = "menu";
69 if($_GET['menu']==null) {
70 $AdminMenu = "main"; }
71 require($SettDir['admin'].'main.php'); }
72 if($_GET['act']=="settings"||
73 $_GET['act']=="sql"||
74 $_GET['act']=="info"||
75 $_GET['act']=="gettheme"||
76 $_GET['act']=="optimize"||
77 $_GET['act']=="themelist"||
78 $_GET['act']=="delsessions"||
79 $_GET['act']=="resyncthemes"||
80 $_GET['act']=="enablesthemes")
81 { $AdminMenu = "main";
82 require($SettDir['admin'].'main.php'); }
83 if($_GET['act']=="addforum"||
84 $_GET['act']=="editforum"||
85 $_GET['act']=="deleteforum"||
86 $_GET['act']=="retopics"||
87 $_GET['act']=="rereplies"||
88 $_GET['act']=="fixrnames"||
89 $_GET['act']=="fixtnames"||
90 $_GET['act']=="fpermissions")
91 { $AdminMenu = "forums";
92 require($SettDir['admin'].'forums.php'); }
93 if($_GET['act']=="addcategory"||
94 $_GET['act']=="editcategory"||
95 $_GET['act']=="deletecategory"||
96 $_GET['act']=="cpermissions")
97 { $AdminMenu = "categories";
98 require($SettDir['admin'].'categories.php'); }
99 if($_GET['act']=="validate"||
100 $_GET['act']=="editmember"||
101 $_GET['act']=="deletemember")
102 { $AdminMenu = "members";
103 require($SettDir['admin'].'members.php'); }
104 if($_GET['act']=="addgroup"||
105 $_GET['act']=="editgroup"||
106 $_GET['act']=="deletegroup")
107 { $AdminMenu = "groups";
108 require($SettDir['admin'].'groups.php'); }
109 require($SettDir['inc'].'endpage.php');
110 if(!isset($admincptitle)) { $admincptitle = null; }
112 </body>
113 </html>
114 <?php
115 if($admincptitle==null) {
116 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Admin CP",$Settings['use_gzip'],$GZipEncode['Type']); }
117 if($admincptitle!=null) {
118 change_title($Settings['board_name'].$admincptitle,$Settings['use_gzip'],$GZipEncode['Type']); }