forked from sergejey/majordomo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
78 lines (65 loc) · 1.95 KB
/
admin.php
File metadata and controls
78 lines (65 loc) · 1.95 KB
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
<?php
/**
* This file is part of MajorDoMo system. More details at http://smartliving.ru/
*
* @package MajorDoMo
* @author Serge Dzheigalo <jey@tut.by>
* @version 1.3
*/
include_once("./config.php");
include_once("./lib/loader.php");
include_once(DIR_MODULES."panel.class.php");
$session=new session("prj");
$db = new mysql(DB_HOST, '', DB_USER, DB_PASSWORD, DB_NAME); // connecting to database
include_once("./load_settings.php");
include_once(DIR_MODULES."control_modules/control_modules.class.php");
$cl=new control_modules();
$app = new panel();
if ($md!=$app->name)
{
$app->restoreParams();
}
else
{
$app->getParams();
}
$result = $app->run();
// BEGIN: filter output
if ($filterblock!='')
{
preg_match('/<!-- begin_data \['.$filterblock.'\] -->(.*?)<!-- end_data \['.$filterblock.'\] -->/is', $result, $match);
$result=$match[1];
}
// END: filter output
// BEGIN: language constants
if (preg_match_all('/&\#060\#LANG_(.+?)\#&\#062/is', $result, $matches))
{
$total=count($matches[0]);
for($i=0;$i<$total;$i++)
{
if (preg_match('/value=["\']'.preg_quote($matches[0][$i]).'["\']/is', $result))
{
continue;
}
if (defined('LANG_'.$matches[1][$i]))
{
$result=str_replace($matches[0][$i], constant('LANG_'.$matches[1][$i]), $result);
}
else
{
//echo "<b><font color='red'>Warning: <i>".'LANG_'.$matches[1][$i]."</i> not defined, please check dictionary file</font></b><br>";
echo "'".$matches[1][$i]."'=>'',<br>";
}
}
}
// END: language constants
if (!headers_sent())
{
header ("HTTP/1.0: 200 OK\n");
header ('Content-Type: text/html; charset=utf-8');
}
$result=str_replace("nf.php", "admin.php", $result);
echo $result;
$session->save();
$db->Disconnect(); // closing database connection
?>