-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.php
More file actions
49 lines (35 loc) · 748 Bytes
/
index.php
File metadata and controls
49 lines (35 loc) · 748 Bytes
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
<?php
/*
* Including wp-functions
*
*/
require_once(dirname(dirname(__FILE__)) . '/wp-blog-header.php');
/*
* Checking logued user
*
*/
if (!is_user_logged_in()) {
auth_redirect();
}
if(!current_user_can('publish_posts') or !current_user_can('edit_posts')){
die('You do not have sufficient permissions to access this page.');
}
/*
* Definition of admin path
*
*/
if (! defined("ABSPATH")) {
define("ABSPATH", dirname(dirname(__FILE__)) . "/");
}
define("ADMIN_PATH", ABSPATH . "dash/");
/*
* Runing application
*
*/
require_once ADMIN_PATH . "includes/wps-functions.php";
$page = $_GET['page'] ? $_GET['page'] : '';
if($page === '') {
wp_redirect($current_page . 'index.php?page=dashboard');
}
render($page);
?>