Plugin Directory

Changeset 538201


Ignore:
Timestamp:
04/30/2012 03:33:35 PM (14 years ago)
Author:
VanillaForums
Message:

Added current roles to the SSO manifest. Added the vf_get_user filter to allow other plugins to modify SSO.

Location:
vanilla-forums/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • vanilla-forums/trunk/functions.php

    r535240 r538201  
    33 * Utility & hook functions.
    44 */
     5
     6function vf_check_request() {
     7   if (isset($_GET['VFRequest'])) {
     8      require dirname(__FILE__).'/sso.php';
     9   }
     10}
    511
    612
     
    300306   
    301307   if (!function_exists('get_currentuserinfo'))
    302       require (ABSPATH . WPINC . '/pluggable.php');
     308      require_once ABSPATH . WPINC . '/pluggable.php';
    303309   get_currentuserinfo();
    304        
     310   
    305311   $user = array();
    306312   if ($current_user->ID != '') {
     
    311317      $user['wp_nonce'] = wp_create_nonce('log-out');
    312318     
     319      // Do some fudgery to grab the photo url.
    313320      try {
    314321         $avatar = new SimpleXMLElement(get_avatar($current_user->ID));
     
    317324      } catch (Exception $Ex) {
    318325      }
    319    }
     326     
     327      // Add the user's roles to the SSO.
     328      if (isset($current_user->roles)) {
     329         $user['roles'] = implode(',', $current_user->roles);
     330      } else {
     331         $user['roles'] = null;
     332      }
     333//      $user['_user'] = $current_user;
     334   }   
     335   
     336   // Allow other plugins to modify the user.
     337   $user = apply_filters('vf_get_user', $user);
    320338   
    321339   return $user;
  • vanilla-forums/trunk/hooks.php

    r533673 r538201  
    3535// Add our js to update the comment count
    3636add_action('wp_footer', 'vf_comment_count_js');
     37add_action('wp_loaded', 'vf_check_request');
  • vanilla-forums/trunk/plugin.php

    r535240 r538201  
    44Plugin URI: http://vanillaforums.org/addons/
    55Description: Integrates Vanilla Forums with Wordpress: embedded blog comments, embedded forum, single sign on, and Wordpress widgets.
    6 Version: 1.1.8
     6Version: 1.1.9
    77Author: Mark O'Sullivan
    88Author URI: http://www.vanillaforums.org/
     
    46461.1.8
    4747- Fixed sso photourl.
     481.1.9
     49- Made the sso pluggable.
    4850
    4951Copyright 2010 Vanilla Forums Inc
     
    6365include_once(VF_PLUGIN_PATH.'/embed.php');
    6466include_once(VF_PLUGIN_PATH.'/widgets.php');
    65 include_once(VF_PLUGIN_PATH.'/sso.php');
     67//include_once(VF_PLUGIN_PATH.'/sso.php');
    6668include_once(VF_PLUGIN_PATH.'/hooks.php');
  • vanilla-forums/trunk/readme.txt

    r535240 r538201  
    44Requires at least: 3
    55Tested up to: 3.3.1
    6 Stable tag: 1.1.8
     6Stable tag: 1.1.9
    77
    88== Description ==
Note: See TracChangeset for help on using the changeset viewer.