예제 #1
0
파일: admin.php 프로젝트: strk/friendica
/**
 * @param App $a
 */
function admin_post(&$a)
{
    if (!is_site_admin()) {
        return;
    }
    // do not allow a page manager to access the admin panel at all.
    if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
        return;
    }
    // urls
    if ($a->argc > 1) {
        switch ($a->argv[1]) {
            case 'site':
                admin_page_site_post($a);
                break;
            case 'users':
                admin_page_users_post($a);
                break;
            case 'plugins':
                if ($a->argc > 2 && is_file("addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php")) {
                    @(include_once "addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php");
                    if (function_exists($a->argv[2] . '_plugin_admin_post')) {
                        $func = $a->argv[2] . '_plugin_admin_post';
                        $func($a);
                    }
                }
                goaway($a->get_baseurl(true) . '/admin/plugins/' . $a->argv[2]);
                return;
                // NOTREACHED
                break;
            case 'themes':
                $theme = $a->argv[2];
                if (is_file("view/theme/{$theme}/config.php")) {
                    require_once "view/theme/{$theme}/config.php";
                    if (function_exists("theme_admin_post")) {
                        theme_admin_post($a);
                    }
                }
                info(t('Theme settings updated.'));
                if (is_ajax()) {
                    return;
                }
                goaway($a->get_baseurl(true) . '/admin/themes/' . $theme);
                return;
                break;
            case 'logs':
                admin_page_logs_post($a);
                break;
            case 'dbsync':
                admin_page_dbsync_post($a);
                break;
            case 'update':
                admin_page_remoteupdate_post($a);
                break;
        }
    }
    goaway($a->get_baseurl(true) . '/admin');
    return;
    // NOTREACHED
}
예제 #2
0
/**
 * @param App &$a
 */
function admin_post(&$a)
{
    logger('admin_post', LOGGER_DEBUG);
    if (!is_site_admin()) {
        return;
    }
    // urls
    if (argc() > 1) {
        switch (argv(1)) {
            case 'site':
                admin_page_site_post($a);
                break;
            case 'users':
                admin_page_users_post($a);
                break;
            case 'channels':
                admin_page_channels_post($a);
                break;
            case 'plugins':
                if (argc() > 2 && is_file("addon/" . argv(2) . "/" . argv(2) . ".php")) {
                    @(include_once "addon/" . argv(2) . "/" . argv(2) . ".php");
                    if (function_exists(argv(2) . '_plugin_admin_post')) {
                        $func = argv(2) . '_plugin_admin_post';
                        $func($a);
                    }
                }
                goaway($a->get_baseurl(true) . '/admin/plugins/' . argv(2));
                break;
            case 'themes':
                $theme = argv(2);
                if (is_file("view/theme/{$theme}/php/config.php")) {
                    require_once "view/theme/{$theme}/php/config.php";
                    // fixme add parent theme if derived
                    if (function_exists("theme_admin_post")) {
                        theme_admin_post($a);
                    }
                }
                info(t('Theme settings updated.'));
                if (is_ajax()) {
                    return;
                }
                goaway($a->get_baseurl(true) . '/admin/themes/' . $theme);
                break;
            case 'logs':
                admin_page_logs_post($a);
                break;
            case 'hubloc':
                admin_page_hubloc_post($a);
                break;
            case 'dbsync':
                admin_page_dbsync_post($a);
                break;
            case 'profs':
                admin_page_profs_post($a);
                break;
        }
    }
    goaway($a->get_baseurl(true) . '/admin');
}
예제 #3
0
파일: admin.php 프로젝트: ryivhnn/friendica
function admin_post(&$a)
{
    if (!is_site_admin()) {
        return;
    }
    // urls
    if ($a->argc > 1) {
        switch ($a->argv[1]) {
            case 'site':
                admin_page_site_post($a);
                break;
            case 'users':
                admin_page_users_post($a);
                break;
            case 'plugins':
                if ($a->argc > 2 && is_file("addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php")) {
                    @(include_once "addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php");
                    if (function_exists($a->argv[2] . '_plugin_admin_post')) {
                        $func = $a->argv[2] . '_plugin_admin_post';
                        $func($a);
                    }
                }
                goaway($a->get_baseurl() . '/admin/plugins/' . $a->argv[2]);
                return;
                // NOTREACHED
                break;
            case 'logs':
                admin_page_logs_post($a);
                break;
            case 'update':
                admin_page_remoteupdate_post($a);
                break;
        }
    }
    goaway($a->get_baseurl() . '/admin');
    return;
    // NOTREACHED
}