Blame Scripts/CentOS-Web/admin/content.php

1f953a
1f953a
/***
1f953a
 * Content Template
1f953a
 *
1f953a
 */
1f953a
1f953a
//-----------/* Show error if called directly */
1f953a
1f953a
    if ( basename( $_SERVER['PHP_SELF'] ) <> 'index.php')
1f953a
    {
1f953a
        echo '

Sorry, this page can\'t be served directly. ';

1f953a
        echo 'Try this instead.';
1f953a
        exit;
1f953a
    }
1f953a
1f953a
//-----------/* Sanitize URL variables */
1f953a
1f953a
    foreach ( $_GET as $key => $value )
1f953a
    {
1f953a
        if ( sanitize_url_var($key) )
1f953a
        {
1f953a
            $url[$key] = $value;
1f953a
        }
1f953a
    }
1f953a
1f953a
//----------/* Page Selector */
1f953a
1f953a
    if ( isset( $url['page'] ) ) 
1f953a
    {
1f953a
        switch ( $url['page'] )
1f953a
        {
1f953a
            case 'entries':
1f953a
                /* Build relation between "Entries" sublinks and its pages */
1f953a
                if ( isset($url['action'] ) ) 
1f953a
                {
1f953a
                    switch ( $url['action'] ) 
1f953a
                    {
1f953a
                        case "add":
1f953a
                            $page = 'p_entries_add.php';
1f953a
                            break;
1f953a
    
1f953a
                        case "update":
1f953a
                            $page = 'p_entries_update.php';
1f953a
                            break;
1f953a
                    }
1f953a
                }
1f953a
                else
1f953a
                {
1f953a
                    $page = 'p_entries.php';
1f953a
                }
1f953a
                break;
1f953a
        
1f953a
                case 'pages':
1f953a
                    // Just if user has admin rights.
1f953a
                    if ( is_user('administrator') )
1f953a
                    {
1f953a
                        /* Build relation between "Pages" sublinks and its pages */
1f953a
                        if ( isset($url['action'] ) ) 
1f953a
                        {
1f953a
                            switch ( $url['action'] ) 
1f953a
                            {
1f953a
                                case 'add':
1f953a
                                    $page = 'p_pages_add.php';
1f953a
                                        break;
1f953a
                                    
1f953a
                                case 'update':
1f953a
                                    $page = 'p_pages_update.php';
1f953a
                                    break;
1f953a
                            }
1f953a
                        }
1f953a
                        else
1f953a
                        {
1f953a
                            $page = 'p_pages.php';
1f953a
                        }
1f953a
                    }
1f953a
                    break;
1f953a
        
1f953a
                case 'categories':
1f953a
                    // Just if user has admin rights.
1f953a
                    if ( is_user('administrator') )
1f953a
                    {
1f953a
                        /* Build relation between "Categories" sublinks and its pages */
1f953a
                        if ( isset($url['action'] ) ) 
1f953a
                        {
1f953a
                            switch ( $url['action'] )
1f953a
                            {
1f953a
                                case 'add':
1f953a
                                    $page = 'p_categories_add.php';
1f953a
                                    break;
1f953a
                                case 'update':
1f953a
                                    $page = 'p_categories_update.php';
1f953a
                                    break;
1f953a
                                case 'tree':
1f953a
                                    $page = 'p_categories_tree.php';
1f953a
                                    break;
1f953a
                            }
1f953a
                        }
1f953a
                        else
1f953a
                        {
1f953a
                           $page = 'p_categories.php'; 
1f953a
                        }
1f953a
                    }
1f953a
                    break;
1f953a
1f953a
                case 'comments':
1f953a
                    // Just if user has admin rights.
1f953a
                    if ( is_user('administrator') )
1f953a
                    {
1f953a
                        /* Build relation between "Links" sublinks and its pages */
1f953a
                        if ( isset($url['action'] ) ) 
1f953a
                        {
1f953a
                            switch ( $url['action'] )
1f953a
                            {
1f953a
                                case 'add':
1f953a
                                    $page = 'p_comments_add.php';
1f953a
                                    break;
1f953a
                                case 'update':
1f953a
                                    $page = 'p_comments_update.php';
1f953a
                                    break;
1f953a
                            }
1f953a
                        }
1f953a
                        else
1f953a
                        {
1f953a
                            $page = 'p_comments.php'; 
1f953a
                        }
1f953a
                    }
1f953a
                    break;
1f953a
                
1f953a
                case 'links':
1f953a
                    // Just if user has admin rights.
1f953a
                    if ( is_user('administrator') )
1f953a
                    {
1f953a
                        /* Build relation between "Links" sublinks and its pages */
1f953a
                        if ( isset($url['action'] ) ) 
1f953a
                        {
1f953a
                            switch ( $url['action'] )
1f953a
                            {
1f953a
                                case 'add':
1f953a
                                    $page = 'p_links_add.php';
1f953a
                                    break;
1f953a
                            }
1f953a
                        }
1f953a
                        else
1f953a
                        {
1f953a
                            $page = 'p_links.php'; 
1f953a
                        }
1f953a
                    }
1f953a
                    break;
1f953a
        
1f953a
                case 'users':
1f953a
                    // Just if user has admin rights.
1f953a
                    if ( is_user('administrator') )
1f953a
                    {
1f953a
                        /* Build relation between "Links" sublinks and its pages */
1f953a
                        if ( isset($url['action'] ) ) 
1f953a
                        {
1f953a
                            switch ( $url['action'] )
1f953a
                            {
1f953a
                                case 'add':
1f953a
                                    $page = 'p_users_add.php';
1f953a
                                    break;
1f953a
                            }
1f953a
                        }
1f953a
                        else
1f953a
                        {
1f953a
                            $page = 'p_users.php';
1f953a
                        }
1f953a
                    }
1f953a
                    break;
1f953a
    
1f953a
                default:
1f953a
                    $page = 'p_index.php';
1f953a
                    break;
1f953a
            }
1f953a
        }
1f953a
        else
1f953a
        {
1f953a
            $page = 'p_index.php'; 
1f953a
        }
1f953a
1f953a
//--------/* Verify file before include it
1f953a
1f953a
    if ( file_exists( ABSPATH . 'admin/' . $page ) )
1f953a
    {
1f953a
        include (ABSPATH . 'admin/' . $page );
1f953a
    }
1f953a
?>