Пример #1
0
<?php

require_once './bb-load.php';
// Redirect if we require SSL and it isn't
bb_ssl_redirect();
// Authenticate against the "logged_in" cookie
bb_auth('logged_in');
// Check that the current user can do this, if not kick them to the front page
if (!bb_current_user_can('edit_user', $user_id)) {
    $sendto = bb_get_uri(null, null, BB_URI_CONTEXT_HEADER);
    nxt_redirect($sendto);
    exit;
}
// Store the current user id
$bb_current_id = bb_get_current_user_info('id');
// I don't know how this would ever get triggered
if (!bb_is_profile()) {
    $sendto = get_profile_tab_link($bb_current_id, 'edit');
    nxt_redirect($sendto);
    exit;
}
// Set some low capabilities if the current user has none
if (!isset($user->capabilities)) {
    $user->capabilities = array('inactive' => true);
}
// Store the profile info keys
$profile_info_keys = bb_get_profile_info_keys('profile-edit');
// Store additional keys if the current user has access to them
if (bb_current_user_can('edit_users')) {
    $profile_admin_keys = bb_get_profile_admin_keys('profile-edit');
    $assignable_caps = bb_get_assignable_caps();
Пример #2
0
<?php

define('BB_IS_ADMIN', true);
require_once '../bb-load.php';
bb_ssl_redirect();
bb_auth();
if (bb_get_option('bb_db_version') > bb_get_option_from_db('bb_db_version')) {
    bb_safe_redirect('upgrade.php');
    die;
}
require_once BB_PATH . 'bb-admin/includes/functions.bb-admin.php';
$bb_admin_page = bb_find_filename($_SERVER['PHP_SELF']);
$_check_callback = false;
if ($bb_admin_page == 'admin-base.php') {
    $bb_admin_page = (string) @$_GET['plugin'];
    $_check_callback = true;
}
wp_enqueue_script('common');
bb_user_settings();
if (isset($_GET['foldmenu'])) {
    if ($_GET['foldmenu']) {
        bb_update_user_setting('fm', 'f');
    } else {
        bb_delete_user_setting('fm');
    }
    bb_safe_redirect(remove_query_arg('foldmenu', stripslashes($_SERVER['REQUEST_URI'])));
    die;
}
bb_admin_menu_generator();
bb_get_current_admin_menu();
if ($_check_callback) {