Esempio n. 1
0
function admin_content(&$a)
{
    if (!is_site_admin()) {
        return login(false);
    }
    /**
     * Side bar links
     */
    // array( url, name, extra css classes )
    $aside = array('site' => array($a->get_baseurl() . "/admin/site/", t("Site"), "site"), 'users' => array($a->get_baseurl() . "/admin/users/", t("Users"), "users"), 'plugins' => array($a->get_baseurl() . "/admin/plugins/", t("Plugins"), "plugins"), 'update' => array($a->get_baseurl() . "/admin/update/", t("Update"), "update"));
    /* get plugins admin page */
    $r = q("SELECT * FROM `addon` WHERE `plugin_admin`=1");
    $aside['plugins_admin'] = array();
    foreach ($r as $h) {
        $plugin = $h['name'];
        $aside['plugins_admin'][] = array($a->get_baseurl() . "/admin/plugins/" . $plugin, $plugin, "plugin");
        // temp plugins with admin
        $a->plugins_admin[] = $plugin;
    }
    $aside['logs'] = array($a->get_baseurl() . "/admin/logs/", t("Logs"), "logs");
    $t = get_markup_template("admin_aside.tpl");
    $a->page['aside'] = replace_macros($t, array('$admin' => $aside, '$h_pending' => t('User registrations waiting for confirmation'), '$admurl' => $a->get_baseurl() . "/admin/"));
    /**
     * Page content
     */
    $o = '';
    // urls
    if ($a->argc > 1) {
        switch ($a->argv[1]) {
            case 'site':
                $o = admin_page_site($a);
                break;
            case 'users':
                $o = admin_page_users($a);
                break;
            case 'plugins':
                $o = admin_page_plugins($a);
                break;
            case 'logs':
                $o = admin_page_logs($a);
                break;
            case 'update':
                $o = admin_page_remoteupdate($a);
                break;
            default:
                notice(t("Item not found."));
        }
    } else {
        $o = admin_page_summary($a);
    }
    return $o;
}
Esempio n. 2
0
/**
 * @param App $a
 * @return string
 */
function admin_content(&$a)
{
    if (!is_site_admin()) {
        return login(false);
    }
    if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
        return "";
    }
    // APC deactivated, since there are problems with PHP 5.5
    //if (function_exists("apc_delete")) {
    //	$toDelete = new APCIterator('user', APC_ITER_VALUE);
    //	apc_delete($toDelete);
    //}
    /**
     * Side bar links
     */
    // array( url, name, extra css classes )
    $aside = array('site' => array($a->get_baseurl(true) . "/admin/site/", t("Site"), "site"), 'users' => array($a->get_baseurl(true) . "/admin/users/", t("Users"), "users"), 'plugins' => array($a->get_baseurl(true) . "/admin/plugins/", t("Plugins"), "plugins"), 'themes' => array($a->get_baseurl(true) . "/admin/themes/", t("Themes"), "themes"), 'dbsync' => array($a->get_baseurl(true) . "/admin/dbsync/", t('DB updates'), "dbsync"));
    /* get plugins admin page */
    $r = q("SELECT name FROM `addon` WHERE `plugin_admin`=1");
    $aside['plugins_admin'] = array();
    foreach ($r as $h) {
        $plugin = $h['name'];
        $aside['plugins_admin'][] = array($a->get_baseurl(true) . "/admin/plugins/" . $plugin, $plugin, "plugin");
        // temp plugins with admin
        $a->plugins_admin[] = $plugin;
    }
    $aside['logs'] = array($a->get_baseurl(true) . "/admin/logs/", t("Logs"), "logs");
    $aside['diagnostics_probe'] = array($a->get_baseurl(true) . '/probe/', t('probe address'), 'probe');
    $aside['diagnostics_webfinger'] = array($a->get_baseurl(true) . '/webfinger/', t('check webfinger'), 'webfinger');
    $t = get_markup_template("admin_aside.tpl");
    $a->page['aside'] .= replace_macros($t, array('$admin' => $aside, '$admtxt' => t('Admin'), '$plugadmtxt' => t('Plugin Features'), '$logtxt' => t('Logs'), '$diagnosticstxt' => t('diagnostics'), '$h_pending' => t('User registrations waiting for confirmation'), '$admurl' => $a->get_baseurl(true) . "/admin/"));
    /**
     * Page content
     */
    $o = '';
    // urls
    if ($a->argc > 1) {
        switch ($a->argv[1]) {
            case 'site':
                $o = admin_page_site($a);
                break;
            case 'users':
                $o = admin_page_users($a);
                break;
            case 'plugins':
                $o = admin_page_plugins($a);
                break;
            case 'themes':
                $o = admin_page_themes($a);
                break;
            case 'logs':
                $o = admin_page_logs($a);
                break;
            case 'dbsync':
                $o = admin_page_dbsync($a);
                break;
            case 'update':
                $o = admin_page_remoteupdate($a);
                break;
            default:
                notice(t("Item not found."));
        }
    } else {
        $o = admin_page_summary($a);
    }
    if (is_ajax()) {
        echo $o;
        killme();
        return '';
    } else {
        return $o;
    }
}
Esempio n. 3
0
/**
 * @param App &$a
 * @return string
 */
function admin_content(&$a)
{
    logger('admin_content', LOGGER_DEBUG);
    if (!is_site_admin()) {
        return login(false);
    }
    /*
     * Side bar links
     */
    // array( url, name, extra css classes )
    $aside = array('site' => array($a->get_baseurl(true) . "/admin/site/", t("Site"), "site"), 'users' => array($a->get_baseurl(true) . "/admin/users/", t("Accounts"), "users"), 'channels' => array($a->get_baseurl(true) . "/admin/channels/", t("Channels"), "channels"), 'plugins' => array($a->get_baseurl(true) . "/admin/plugins/", t("Plugins"), "plugins"), 'themes' => array($a->get_baseurl(true) . "/admin/themes/", t("Themes"), "themes"), 'queue' => array(z_root() . '/admin/queue', t('Inspect queue'), 'queue'), 'profs' => array(z_root() . '/admin/profs', t('Profile Config'), 'profs'), 'dbsync' => array($a->get_baseurl(true) . "/admin/dbsync/", t('DB updates'), "dbsync"));
    /* get plugins admin page */
    $r = q("SELECT * FROM addon WHERE plugin_admin = 1");
    $aside['plugins_admin'] = array();
    foreach ($r as $h) {
        $plugin = $h['name'];
        $aside['plugins_admin'][] = array($a->get_baseurl(true) . '/admin/plugins/' . $plugin, $plugin, 'plugin');
        // temp plugins with admin
        $a->plugins_admin[] = $plugin;
    }
    $aside['logs'] = array($a->get_baseurl(true) . "/admin/logs/", t("Logs"), "logs");
    $t = get_markup_template("admin_aside.tpl");
    $a->page['aside'] .= replace_macros($t, array('$admin' => $aside, '$admtxt' => t('Admin'), '$plugadmtxt' => t('Plugin Features'), '$logtxt' => t('Logs'), '$h_pending' => t('User registrations waiting for confirmation'), '$admurl' => $a->get_baseurl(true) . "/admin/"));
    /*
     * Page content
     */
    $o = '';
    // urls
    if (argc() > 1) {
        switch (argv(1)) {
            case 'site':
                $o = admin_page_site($a);
                break;
            case 'users':
                $o = admin_page_users($a);
                break;
            case 'channels':
                $o = admin_page_channels($a);
                break;
            case 'plugins':
                $o = admin_page_plugins($a);
                break;
            case 'themes':
                $o = admin_page_themes($a);
                break;
            case 'hubloc':
                $o = admin_page_hubloc($a);
                break;
            case 'logs':
                $o = admin_page_logs($a);
                break;
            case 'dbsync':
                $o = admin_page_dbsync($a);
                break;
            case 'profs':
                $o = admin_page_profs($a);
                break;
            case 'queue':
                $o = admin_page_queue($a);
                break;
            default:
                notice(t('Item not found.'));
        }
    } else {
        $o = admin_page_summary($a);
    }
    if (is_ajax()) {
        echo $o;
        killme();
        return '';
    } else {
        return $o;
    }
}
Esempio n. 4
0
/**
 * @param App &$a
 * @return string
 */
function admin_content(&$a)
{
    logger('admin_content', LOGGER_DEBUG);
    if (!is_site_admin()) {
        return login(false);
    }
    /*
     * Page content
     */
    $o = '';
    // urls
    if (argc() > 1) {
        switch (argv(1)) {
            case 'site':
                $o = admin_page_site($a);
                break;
            case 'users':
                $o = admin_page_users($a);
                break;
            case 'channels':
                $o = admin_page_channels($a);
                break;
            case 'plugins':
                $o = admin_page_plugins($a);
                break;
            case 'themes':
                $o = admin_page_themes($a);
                break;
                //			case 'hubloc':
                //				$o = admin_page_hubloc($a);
                //				break;
            //			case 'hubloc':
            //				$o = admin_page_hubloc($a);
            //				break;
            case 'security':
                $o = admin_page_security($a);
                break;
            case 'features':
                $o = admin_page_features($a);
                break;
            case 'logs':
                $o = admin_page_logs($a);
                break;
            case 'dbsync':
                $o = admin_page_dbsync($a);
                break;
            case 'profs':
                $o = admin_page_profs($a);
                break;
            case 'queue':
                $o = admin_page_queue($a);
                break;
            default:
                notice(t('Item not found.'));
        }
    } else {
        $o = admin_page_summary($a);
    }
    if (is_ajax()) {
        echo $o;
        killme();
        return '';
    } else {
        return $o;
    }
}