OSDN Git Service

Added Group menu.
[idb/iDB.git.git] / admin.php
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.
5
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.
10
11     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
12     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
13
14     $FileInfo: admin.php - Last Update: 12/19/2009 SVN 429 - Author: cooldude2k $
15 */
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 ?>
23
24 <title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
25 </head>
26 <body>
27 <?php
28 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
29 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
30 $_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
31 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
32 $_SESSION['ViewingFile'] = $exfile['index']; }
33 $_SESSION['PreViewingTitle'] = "Viewing";
34 $_SESSION['ViewingTitle'] = "Board index";
35 if(!isset($_GET['subact'])) { $_GET['subact'] = null; }
36 if(!isset($_POST['subact'])) { $_POST['subact'] = null; }
37 if(!isset($_GET['menu'])) { $_GET['menu'] = null; }
38 $AdminMenu = null;
39 require($SettDir['inc'].'navbar.php');
40 if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
41 redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
42 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
43 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
44 if($_GET['act']==null) {
45         $_GET['act']="view"; }
46 if($_GET['act']=="view"&&$GroupInfo['ViewDBInfo']!="yes") {
47         $_GET['act']="view"; }
48 if($_GET['act']=="vercheck"&&$GroupInfo['ViewDBInfo']=="yes") {
49         if($Settings['vercheck']!=1&&$Settings['vercheck']!=2) {
50         $Settings['vercheck'] = 1; }
51         if($Settings['vercheck']===1) {
52         header("Location: ".$VerCheckURL."&name=".urlencode($iDBVerName)); }
53         if($Settings['vercheck']===2) {
54         header("Location: ".$VerCheckURL."&bid=".$Settings['bid']."&vercheck=newtype"); } }
55 if($_GET['act']=="view")
56 { $AdminMenu = "menu";
57 if($_GET['menu']==null) {
58    $AdminMenu = "main"; }
59 require($SettDir['admin'].'main.php'); }
60 if($_GET['act']=="settings"||
61         $_GET['act']=="sql"||
62         $_GET['act']=="info"||
63         $_GET['act']=="optimize"||
64         $_GET['act']=="delsessions")
65 { $AdminMenu = "main";
66 require($SettDir['admin'].'main.php'); }
67 if($_GET['act']=="addforum"||
68         $_GET['act']=="editforum"||
69         $_GET['act']=="deleteforum"||
70         $_GET['act']=="retopics"||
71         $_GET['act']=="rereplies"||
72         $_GET['act']=="fixrnames"||
73         $_GET['act']=="fixtnames"||
74         $_GET['act']=="fpermissions")
75 { $AdminMenu = "forums";
76 require($SettDir['admin'].'forums.php'); }
77 if($_GET['act']=="addcategory"||
78         $_GET['act']=="editcategory"||
79         $_GET['act']=="deletecategory"||
80         $_GET['act']=="cpermissions")
81 { $AdminMenu = "categories";
82 require($SettDir['admin'].'categories.php'); }
83 if($_GET['act']=="validate"||
84         $_GET['act']=="editmember"||
85         $_GET['act']=="deletemember")
86 { $AdminMenu = "members";
87 require($SettDir['admin'].'members.php'); }
88 if($_GET['act']=="addgroup"||
89         $_GET['act']=="editgroup"||
90         $_GET['act']=="deletegroup")
91 { $AdminMenu = "groups";
92 require($SettDir['admin'].'groups.php'); }
93 require($SettDir['inc'].'endpage.php'); 
94 if(!isset($admincptitle)) { $admincptitle = null; }
95 ?>
96 </body>
97 </html>
98 <?php
99 if($admincptitle==null) {
100 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Admin CP",$Settings['use_gzip'],$GZipEncode['Type']); }
101 if($admincptitle!=null) {
102 change_title($Settings['board_name'].$admincptitle,$Settings['use_gzip'],$GZipEncode['Type']); }
103 ?>