Esempio n. 1
0
function center()
{
    // fatal session produced on failed login, and will display error message.
    if (isset($_SESSION[_SITE . 'fatal'])) {
        echo $_SESSION[_SITE . 'fatal'];
        unset($_SESSION[_SITE . 'fatal']);
    } else {
        global $categorySEF, $subcatSEF, $articleSEF;
        switch (true) {
            case isset($_GET['category']):
                $action = $categorySEF;
                break;
            case isset($_GET['action']):
                $action = $categorySEF == '404' ? $categorySEF : clean(cleanXSS($_GET['action']));
                break;
        }
        switch (true) {
            case isset($_POST['search_query']):
                search();
                return;
                break;
            case isset($_POST['comment']):
                comment('comment_posted');
                return;
                break;
            case isset($_POST['contactform']):
                contact();
                return;
                break;
            case isset($_POST['Loginform']):
                administration();
                return;
                break;
            case isset($_POST['submit_text']):
                processing();
                return;
                break;
        }
        if (_ADMIN) {
            switch ($action) {
                case 'administration':
                    administration();
                    return;
                    break;
                case 'snews_settings':
                    settings();
                    return;
                    break;
                case 'snews_categories':
                    admin_categories();
                    return;
                    break;
                case 'admin_category':
                    form_categories();
                    return;
                    break;
                case 'admin_subcategory':
                    form_categories('sub');
                    return;
                    break;
                case 'groupings':
                    admin_groupings();
                    return;
                    break;
                case 'admin_groupings':
                    form_groupings();
                    return;
                    break;
                case 'snews_articles':
                    admin_articles('article_view');
                    return;
                    break;
                case 'extra_contents':
                    admin_articles('extra_view');
                    return;
                    break;
                case 'snews_pages':
                    admin_articles('page_view');
                    return;
                    break;
                case 'admin_article':
                    form_articles('');
                    return;
                    break;
                case 'article_new':
                    form_articles('article_new');
                    return;
                    break;
                case 'extra_new':
                    form_articles('extra_new');
                    return;
                    break;
                case 'page_new':
                    form_articles('page_new');
                    return;
                    break;
                case 'editcomment':
                    edit_comment();
                    return;
                    break;
                case 'snews_files':
                    files();
                    return;
                    break;
                case 'process':
                    processing();
                    return;
                    break;
                case 'logout':
                    session_destroy();
                    echo '<meta http-equiv="refresh" content="2; url=' . _SITE . '">';
                    echo '<h2>' . l('log_out') . '</h2>';
                    return;
                    break;
            }
        }
        switch ($action) {
            case 'archive':
                archive();
                break;
            case 'sitemap':
                sitemap();
                break;
            case 'contact':
                contact();
                break;
            case 'login':
                login();
                break;
            case '404':
                echo l('error_404');
                break;
            default:
                articles();
                break;
        }
    }
}
Esempio n. 2
0
File: admin.php Progetto: philum/cms
function adminarts()
{
    //if($_GET["publish"])publish_art($_GET["publish"],$_GET["art"],'qda');
    $qr = array("id", "suj", "frm", "day", "name", "re");
    $qrt = array("id" => "ID", "suj" => "Title (edit)", "frm" => "Category", "day" => "Date", "name" => "Author", "re" => "Published");
    $r = make_artlist($qr);
    if ($r) {
        $r = admin_articles($r);
    }
    $nbjj = $_GET["dig"] ? $_GET["dig"] : $_SESSION["nbj"];
    $nbjj = $nbjj ? $nbjj : 9999;
    if (rstr(3)) {
        $ret .= dig_it($nbjj, 'admin');
    }
    $ret .= make_tables_pages($r, $qrt);
    return $ret;
}