forked from jbogdani/BraDyCMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
executable file
·121 lines (109 loc) · 3.11 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
* @author Julian Bogdani <[email protected]>
* @copyright BraDyUS. Communicating Cultural Heritage, http://bradypus.net 2007-2013
* @license MIT, See LICENSE file
* @since Dec 1, 2012
*/
try
{
$root = './';
require_once $root . 'lib/globals.inc';
$admin = new admin_ctrl();
}
catch (Exception $e)
{
error_log($e->getTraceAsString());
$stop_error = $e->getMessage() ;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>bdus.CMS</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="./css/admin.css" rel="stylesheet" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body<?php if (!$_SESSION['user_confirmed']) { echo ' class="login" '; }?>>
<?php
if ($stop_error)
{
if ($admin)
{
$admin->showError($stop_error);
}
else
{
echo '<div class="container">'
. '<div class="alert alert-danger text-center">Something went wrong! '
. $stop_error
. '</div>'
. '</div>';
}
}
else if (defined('CREATE_SITE'))
{
$admin->showCreateInstallForm();
}
else if (!$_SESSION['user_confirmed'])
{
$admin->showLoginForm();
}
else
{
$admin->showBody();
}
?>
<script src="controller.php?obj=tr&method=lang2json¶m[]=true"></script>
<script src="./js/jquery-2.1.1.min.js"></script>
<script src="./js/jquery.nestable.js"></script>
<script src="./js/bootstrap-3.2.0.min.js"></script>
<script src="./js/jquery.dataTables.js"></script>
<script src="./js/dataTable-bootstrap.js"></script>
<script src="./js/admin.js"></script>
<script src="./js/pnotify.custom.min.js"></script>
<script src="./js/bootstrap-datepicker.js"></script>
<script src="./js/select2.min.js"></script>
<script src="./tiny_mce/tiny_mce.js"></script>
<script src="./js/fileuploader.js"></script>
<script src="./js/prettify.js"></script>
<?php if (!$_SESSION['user_confirmed']): ?>
<script>
$('#signin').on('submit', function(){
$('#logerror').hide();
$.post('controller.php?obj=log_ctrl&method=in', $(this).serialize(), function(data){
if (data.status === 'success'){
window.location.href = './admin';
return false;
} else {
$('#logerror .text').html(data.text);
$('#logerror').show();
$('#login-button').button('reset');
}
}, 'json');
});
</script>
<?php
endif;
if (defined('CREATE_SITE')):
?>
<script>
$('#newsite').on('submit', function(){
$.post('./controller.php?obj=addsite_ctrl&method=build', $(this).serialize(), function(data){
if (data.status === 'success'){
$('#register').fadeOut();
$('#message').fadeIn();
} else {
admin.message(data.text, data.status, false, true);
}
}, 'json');
})
</script>
<?php endif; ?>
</body>
</html>