| <?php |
| |
| |
| |
| |
| |
| |
| |
| if ( basename( $_SERVER['PHP_SELF'] ) <> 'index.php') |
| { |
| echo '<h3>Sorry, this page can\'t be served directly. '; |
| echo 'Try <a href="index.php">this instead</a>.</h3>'; |
| exit; |
| } |
| |
| |
| |
| foreach ( $_GET as $key => $value ) |
| { |
| if ( sanitize_url_var($key) ) |
| { |
| $url[$key] = $value; |
| } |
| } |
| |
| |
| |
| if ( isset( $url['page'] ) ) |
| { |
| switch ( $url['page'] ) |
| { |
| case 'entries': |
| |
| if ( isset($url['action'] ) ) |
| { |
| switch ( $url['action'] ) |
| { |
| case "add": |
| $page = 'p_entries_add.php'; |
| break; |
| |
| case "update": |
| $page = 'p_entries_update.php'; |
| break; |
| } |
| } |
| else |
| { |
| $page = 'p_entries.php'; |
| } |
| break; |
| |
| case 'pages': |
| |
| if ( is_user('administrator') ) |
| { |
| |
| if ( isset($url['action'] ) ) |
| { |
| switch ( $url['action'] ) |
| { |
| case 'add': |
| $page = 'p_pages_add.php'; |
| break; |
| |
| case 'update': |
| $page = 'p_pages_update.php'; |
| break; |
| } |
| } |
| else |
| { |
| $page = 'p_pages.php'; |
| } |
| } |
| break; |
| |
| case 'categories': |
| |
| if ( is_user('administrator') ) |
| { |
| |
| if ( isset($url['action'] ) ) |
| { |
| switch ( $url['action'] ) |
| { |
| case 'add': |
| $page = 'p_categories_add.php'; |
| break; |
| case 'update': |
| $page = 'p_categories_update.php'; |
| break; |
| case 'tree': |
| $page = 'p_categories_tree.php'; |
| break; |
| } |
| } |
| else |
| { |
| $page = 'p_categories.php'; |
| } |
| } |
| break; |
| |
| case 'comments': |
| |
| if ( is_user('administrator') ) |
| { |
| |
| if ( isset($url['action'] ) ) |
| { |
| switch ( $url['action'] ) |
| { |
| case 'add': |
| $page = 'p_comments_add.php'; |
| break; |
| case 'update': |
| $page = 'p_comments_update.php'; |
| break; |
| } |
| } |
| else |
| { |
| $page = 'p_comments.php'; |
| } |
| } |
| break; |
| |
| case 'links': |
| |
| if ( is_user('administrator') ) |
| { |
| |
| if ( isset($url['action'] ) ) |
| { |
| switch ( $url['action'] ) |
| { |
| case 'add': |
| $page = 'p_links_add.php'; |
| break; |
| } |
| } |
| else |
| { |
| $page = 'p_links.php'; |
| } |
| } |
| break; |
| |
| case 'users': |
| |
| if ( is_user('administrator') ) |
| { |
| |
| if ( isset($url['action'] ) ) |
| { |
| switch ( $url['action'] ) |
| { |
| case 'add': |
| $page = 'p_users_add.php'; |
| break; |
| } |
| } |
| else |
| { |
| $page = 'p_users.php'; |
| } |
| } |
| break; |
| |
| default: |
| $page = 'p_index.php'; |
| break; |
| } |
| } |
| else |
| { |
| $page = 'p_index.php'; |
| } |
| |
| |
| |
| if ( file_exists( ABSPATH . 'admin/' . $page ) ) |
| { |
| include (ABSPATH . 'admin/' . $page ); |
| } |
| ?> |