コード例 #1
0
ファイル: profile-edit.php プロジェクト: nxtclass/NXTClass
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
function bb_template_scripts()
{
    if (bb_is_topic() && bb_is_user_logged_in()) {
        wp_enqueue_script('topic');
    } elseif (bb_is_profile() && bb_is_user_logged_in()) {
        global $self;
        if ($self == 'profile-edit.php') {
            wp_enqueue_script('profile-edit');
        }
    }
}
コード例 #3
0
function is_bb_profile()
{
    bb_log_deprecated('function', __FUNCTION__, 'bb_is_profile');
    return bb_is_profile();
}
コード例 #4
0
ファイル: header.php プロジェクト: danielcoats/schoolpress
bb_option('name');
?>
</a></h1>
			<?php 
if (bb_get_option('description')) {
    ?>
<p class="description"><?php 
    bb_option('description');
    ?>
</p><?php 
}
?>

<?php 
if (!in_array(bb_get_location(), array('login-page', 'register-page'))) {
    login_form();
}
?>

			<div class="search">
<?php 
search_form();
?>
			</div>
		</div>
		<div id="main">

<?php 
if (bb_is_profile()) {
    profile_menu();
}