Cleaned up code a bit, added version const
Showing
2 changed files
with
8 additions
and
23 deletions
| ... | @@ -186,9 +186,9 @@ function activate($key) { | ... | @@ -186,9 +186,9 @@ function activate($key) { |
| 186 | $user_site = get_site_option('dashboard_blog', $current_site->blog_id); | 186 | $user_site = get_site_option('dashboard_blog', $current_site->blog_id); |
| 187 | add_user_to_blog(($user_site ?: 1), $id, get_site_option('default_user_role', 'subscriber')); | 187 | add_user_to_blog(($user_site ?: 1), $id, get_site_option('default_user_role', 'subscriber')); |
| 188 | 188 | ||
| 189 | // If use these, fix variables, they're wrong | 189 | // If use these, fix variables, they're wrong |
| 190 | // add_new_user_to_blog( $id, $user_email, $meta ); | 190 | //add_new_user_to_blog( $id, $user_email, $meta ); |
| 191 | // do_action(ACTION_ACTIVATE, $id, $password, $meta); | 191 | //do_action(ACTION_ACTIVATE, $id, $password, $meta); |
| 192 | 192 | ||
| 193 | return (int)$id; | 193 | return (int)$id; |
| 194 | } | 194 | } | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | * Note: If there is an inconsistent error | 3 | * http://wiki.gotenzing.com/groups/tenzing/wiki/aa35a/FB_Connect_in_WP.html |
| 4 | * it's due to how I changed the FB load | 4 | * |
| 5 | * process, may need to change how JS is loaded | ||
| 6 | * Proabably move FB.init and FB.Event.subscribe | ||
| 7 | * to my init method | ||
| 8 | * | ||
| 9 | * This needs to go in the <html tag | 5 | * This needs to go in the <html tag |
| 10 | * xmlns:fb="http://www.facebook.com/2008/fbml" | 6 | * xmlns:fb="http://www.facebook.com/2008/fbml" |
| 11 | * | 7 | * If you want to use FBML AND pass W3C validation |
| 12 | * http://wpdev.tenzinghost.com | ||
| 13 | * API Key: 83f54e078b9aa0e303bba959dc0a566f | ||
| 14 | * App Secret: e542aca35ab698121fa5917211013a41 | ||
| 15 | * App ID: 105917066126941 | ||
| 16 | * | ||
| 17 | * http://wp.cb | ||
| 18 | * API Key: 3bcccfd8c28c52197141266d9e417649 | ||
| 19 | * App Secret: 9bfcd828bc6ccef12336dea57df93ecb | ||
| 20 | * App ID: 138943536118944 | ||
| 21 | * | 8 | * |
| 22 | * Graph API Reference: | 9 | * Graph API Reference: |
| 23 | * http://developers.facebook.com/docs/reference/api/user | 10 | * http://developers.facebook.com/docs/reference/api/user |
| ... | @@ -30,14 +17,12 @@ use Tz\WordPress\Tools\Auth; | ... | @@ -30,14 +17,12 @@ use Tz\WordPress\Tools\Auth; |
| 30 | 17 | ||
| 31 | use FB; | 18 | use FB; |
| 32 | 19 | ||
| 33 | use Exception; | 20 | use Exception, InvalidArgumentException; |
| 34 | 21 | ||
| 35 | use InvalidArgumentException; | 22 | const VERSION = 0.2; |
| 36 | 23 | ||
| 37 | const OPTION_NAME = 'tz_auth_fb'; | 24 | const OPTION_NAME = 'tz_auth_fb'; |
| 38 | 25 | ||
| 39 | //setcookie('wpfb_logout', '', time() - 3600, '/'); | ||
| 40 | |||
| 41 | call_user_func(function() { | 26 | call_user_func(function() { |
| 42 | Vars::$options = new Tools\WP_Option(OPTION_NAME, Array('button_title' => 'Login', 'ext_perms' => Array('email' => 1))); | 27 | Vars::$options = new Tools\WP_Option(OPTION_NAME, Array('button_title' => 'Login', 'ext_perms' => Array('email' => 1))); |
| 43 | 28 | ... | ... |
-
Please register or sign in to post a comment