Skip to content

Commit

Permalink
[sfFacebookConnectPlugin] Tabs to spaces, removed Windows line return…
Browse files Browse the repository at this point in the history
…s, removed trailing spaces
  • Loading branch information
laurentb committed Sep 4, 2009
1 parent c0cb7f9 commit a0dedba
Show file tree
Hide file tree
Showing 24 changed files with 420 additions and 421 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2008 Fabrice Bernhard
Copyright (c) 2009 Fabrice Bernhard

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
88 changes: 44 additions & 44 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ sfFacebookConnectPlugin
The sfFacebookConnect plugin :

* helps easily setup a Facebook Connect authentification on a symfony project using sfGuardUser
* is also a good wrapper to create a Facebook application using symfony

* is also a good wrapper to create a Facebook application using symfony

Installation
------------


* Install the plugin
$ svn co http://svn.symfony-project.com/plugins/sfFacebookConnectPlugin/trunk sfFacebookConnectPlugin

$ svn co http://svn.symfony-project.com/plugins/sfFacebookConnectPlugin/trunk sfFacebookConnectPlugin


* Create your application on Facebook
Expand All @@ -23,55 +23,55 @@ Installation

* Configure your app.yml file with all the correct settings

# default values
all:
facebook:
api_key: xxx
api_secret: xxx
api_id: xxx
callback_url: http://www.yourserver.com
app_url: http://apps.facebook.com/your-app
sf_guard_plugin:
profile_class: sfGuardUserProfile
profile_field_name: user_id
profile_facebook_uid_name: facebook_uid
profile_email_name: email
profile_email_hash_name: email_hash
facebook_connect:
user_permissions: []
# default values
all:
facebook:
api_key: xxx
api_secret: xxx
api_id: xxx
callback_url: http://www.yourserver.com
app_url: http://apps.facebook.com/your-app

sf_guard_plugin:
profile_class: sfGuardUserProfile
profile_field_name: user_id
profile_facebook_uid_name: facebook_uid
profile_email_name: email
profile_email_hash_name: email_hash

facebook_connect:
user_permissions: []


* Modify your sfGaurdUserProfile schema to add the 3 new columns needed

# Doctrine schema sample
sfGuardUserProfile:
tableName: sf_guard_user_profile
columns:
user_id: integer(4)
first_name: varchar(20)
last_name: varchar(20)
facebook_uid: integer(4)
email: varchar(255)
email_hash: varchar(255)
relations:
sfGuardUser:
type: one
foreignType: one
class: sfGuardUser
local: user_id
foreign: id
onDelete: cascade
sfGuardUserProfile:
tableName: sf_guard_user_profile
columns:
user_id: integer(4)
first_name: varchar(20)
last_name: varchar(20)
facebook_uid: integer(4)
email: varchar(255)
email_hash: varchar(255)
relations:
sfGuardUser:
type: one
foreignType: one
class: sfGuardUser
local: user_id
foreign: id
onDelete: cascade


* Enable the auth module in your `settings.yml`: sfFacebookConnectAuth

[php]
all:
.settings:
enabled_modules: [default, sfFacebookConnectAuth]

* Optional: enable the sample module in your `settings.yml`: sfFacebookConnectDemo

[php]
Expand All @@ -85,4 +85,4 @@ Installation

* Publish the plugin assets

$ php symfony plugin:publish-assets
$ php symfony plugin:publish-assets
41 changes: 20 additions & 21 deletions config/app.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# default values
all:
facebook:
api_key: xxx
api_secret: xxx
api_id: xxx
callback_url: http://www.yourserver.com
app_url: http://apps.facebook.com/your-app

sf_guard_plugin:
profile_class: sfGuardUserProfile
profile_field_name: user_id
profile_facebook_uid_name: facebook_uid
profile_email_name: email
profile_email_hash_name: email_hash

facebook_connect:
load_routing: true
user_permissions: []


# default values
all:
facebook:
api_key: xxx
api_secret: xxx
api_id: xxx
callback_url: http://www.yourserver.com
app_url: http://apps.facebook.com/your-app

sf_guard_plugin:
profile_class: sfGuardUserProfile
profile_field_name: user_id
profile_facebook_uid_name: facebook_uid
profile_email_name: email
profile_email_hash_name: email_hash

facebook_connect:
load_routing: true
user_permissions: []

6 changes: 3 additions & 3 deletions data/tasks/sfFacebookConnectRegisterUsersTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function run_facebook_register_users($task, $args)
define('SF_ROOT_DIR', sfConfig::get('sf_root_dir'));
define('SF_APP', $app);
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');

sfContext::getInstance();
$sfGuardUsers = sfFacebookConnect::getNonRegisteredUsers();
echo count($sfGuardUsers)." non registered users in your database\n";
Expand All @@ -25,6 +25,6 @@ function run_facebook_register_users($task, $args)
$num_registered += sfFacebookConnect::registerUsers($chunk);
echo $num_registered." registered.\n";
}


}
10 changes: 5 additions & 5 deletions data/tasks/sfFacebookRegisterFeedTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function run_facebook_register_feed($task, $args)
define('SF_ROOT_DIR', sfConfig::get('sf_root_dir'));
define('SF_APP', $app);
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');

$one_line_story_templates = array();
$one_line_story_templates[] = '{*actor*} va voir le match {*match*} au bar {*bar*} {*date*} !';
$short_story_templates = array();
Expand All @@ -37,12 +37,12 @@ function run_facebook_register_feed($task, $args)
$short_story_templates,
null,
$action_links
);
);


}
/*
*
*
$one_line_story_templates = array();
$one_line_story_templates[] = '{*actor*} va voir le match {*match*} au bar {*bar*} {*date*} !';
$short_story_templates = array();
Expand Down
4 changes: 2 additions & 2 deletions lib/facebook-platform/php/jsonwrapper/JSON/JSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ function decode($str)
// element in an associative array,
// for now
$parts = array();

if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
// "name":value pair
$key = $this->decode($parts[1]);
Expand Down Expand Up @@ -802,5 +802,5 @@ function Services_JSON_Error($message = 'unknown error', $code = null,
}

}

?>
20 changes: 10 additions & 10 deletions lib/helper/sfFacebookConnectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


/**
*
*
* @param string $on_load_js
* @author fabriceb
* @since May 27, 2009 fabriceb
Expand All @@ -16,7 +16,7 @@ function include_bottom_facebook_connect_script($on_load_js = '')
?>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/<?php echo sfFacebook::getLocale() ?>" type="text/javascript"></script>
<script src="/sfFacebookConnectPlugin/js/sfFacebookConnect.js" type="text/javascript"></script>

<script type="text/javascript">
//<![CDATA[
var sf_fb = null;
Expand All @@ -28,11 +28,11 @@ function include_bottom_facebook_connect_script($on_load_js = '')
//]]>
</script>
<?php
sfFacebook::setJsLoaded();
sfFacebook::setJsLoaded();
}

/**
*
*
* @author fabriceb
* @since May 27, 2009 fabriceb
*/
Expand All @@ -45,7 +45,7 @@ function include_facebook_connect_script()
?>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/<?php echo sfFacebook::getLocale() ?>" type="text/javascript"></script>
<script src="/sfFacebookConnectPlugin/js/sfFacebookConnect.js" type="text/javascript"></script>

<script type="text/javascript">
//<![CDATA[
if (typeof sf_fb == 'undefined')
Expand All @@ -60,7 +60,7 @@ function include_facebook_connect_script()


/**
*
*
* @param string $forward a url to forward to
* @return string
* @author fabriceb
Expand All @@ -74,14 +74,14 @@ function facebook_connect_button($forward = '', $callback = '', $options = array
'bg' => 'light'
);
$options = array_merge($default_options, $options);

$js_arguments = array("'".rawurlencode($forward)."'");
if ($callback != '')
{
array_push($js_arguments,$callback);
}
$html =

$html =
'
<a href="#" onclick="sf_fb.requireSession('.implode(',',$js_arguments).');return false;">'.
image_tag(
Expand All @@ -92,6 +92,6 @@ function facebook_connect_button($forward = '', $callback = '', $options = array
)
).
'</a>';

return $html;
}
10 changes: 5 additions & 5 deletions lib/routing/sfFacebookConnectRouting.class.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Routing event listener
*
*
* It's usefull to deal with restrictive routing configuration (with no `:module/:action` route enabled)
*
*
* @author tparisot
* @package sfFacebookConnectPlugin
* @subpackage routing
Expand All @@ -12,7 +12,7 @@ class sfFacebookConnectRoutingHelper
{
/**
* Load routes
*
*
* @static
* @author tparisot
* @param sfEvent $event
Expand All @@ -25,15 +25,15 @@ public static function listenToLoadConfigurationEvent(sfEvent $event)
* Signin
*/
$routing->prependRoute('sf_facebook_connect_signin', new sfRoute('/fb-connect/signin', array(
'module' => 'sfFacebookConnectAuth',
'module' => 'sfFacebookConnectAuth',
'action' => 'signin',
)));

/*
* Ajax Signin
*/
$routing->prependRoute('sf_facebook_connect_ajax_signin', new sfRoute('/fb-connect/ajax-signin', array(
'module' => 'sfFacebookConnectAuth',
'module' => 'sfFacebookConnectAuth',
'action' => 'ajaxSignin',
)));
}
Expand Down
Loading

0 comments on commit a0dedba

Please sign in to comment.