forked from nightflyza/Ubilling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
executable file
·86 lines (81 loc) · 3.25 KB
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
////////////////////////////////////////////////////////////////////////////////
// Copyright (C) ReloadCMS Development Team //
// http://reloadcms.sf.net //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY, without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. //
// //
// This product released under GNU General Public License v2 //
////////////////////////////////////////////////////////////////////////////////
define('RCMS_ROOT_PATH', './');
include(RCMS_ROOT_PATH . 'common.php');
function rcms_loadAdminLib($lib){
require_once(ADMIN_PATH . 'libs/' . $lib . '.php');
}
//------------------------------------------------------------------------------------------------------//
// preparations...
$rights = &$system->rights;
$root = &$system->root;
if(!LOGGED_IN){
$message = __('Access denied');
$message .= '<br />
<form method="post" action="">
<input type="hidden" name="login_form" value="1" />
<table cellpadding="2" cellspacing="1" style="width: 100%;">
<tr>
<td class="row1">' . __('Username') . ':</td>
<td class="row1" style="width: 100%;"><input type="text" name="username" style="text-align: left; width: 95%;" /></td>
</tr>
<tr>
<td class="row1">' . __('Password') . ':</td>
<td class="row1" style="width: 100%;"><input type="password" name="password" style="text-align: left; width: 95%;" /></td>
</tr>
<tr>
<td class="row1" colspan="2">
<input type="checkbox" name="remember" id="remember" value="1" />
<label for="remember">' . __('Remember me') . '</label>
</td>
</tr>
<tr>
<td class="row2" colspan="2"><input type="submit" value="' . __('Log in') . '" /></td>
</tr>
</table>
</form>';
include(ADMIN_PATH . 'error.php');
} elseif (empty($rights) && !$root) {
$message = __('You are not administrator of this site');
include(ADMIN_PATH . 'error.php');
} else {
if(!empty($_GET['show'])) $show = $_GET['show']; else $show = '';
$categories = rcms_scandir(ADMIN_PATH . 'modules', '', 'dir');
$MODULES = array();
foreach ($categories as $category){
if(file_exists(ADMIN_PATH . 'modules/' . $category . '/module.php')){
include_once(ADMIN_PATH . 'modules/' . $category . '/module.php');
}
}
switch($show){
case 'nav':
include(ADMIN_PATH . 'navigation.php');
break;
case 'module':
$module = (!empty($_GET['id'])) ? basename($_GET['id']) : '.index';
$module = explode('.', $module, 2);
if(!is_file(ADMIN_PATH . 'modules/' . $module[0] . '/' . $module[1] . '.php')) {
$message = __('Module not found') . ': ' . $module[0] . '/' . $module[1];
include(ADMIN_PATH . 'error.php');
} elseif($module[1] != 'index' && empty($MODULES[$module[0]][1][$module[1]])) {
$message = __('Access denied') . ': ' . $module[0] . '/' . $module[1];
include(ADMIN_PATH . 'error.php');
} else {
include(ADMIN_PATH . 'module.php');
}
break;
default:
include(ADMIN_PATH . 'frameset.php');
break;
}
}
?>