Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: Facebook Login Plugin  (Read 34200 times)

0 Members and 1 Guest are viewing this topic.

omnitool

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 7
Facebook Login Plugin
« on: July 11, 2010, 08:34:04 pm »

This plugin throws a "connect with Facebook" button underneath the login button in the sidebar. You can still login the normal way, but if you choose to login via facebook, it will automatically:
1) Register the user (if he hasn't logged in before) using his firstname.lastname.DOB as his username, Facebook Id as his password, and email as his email (if the user has opted out of making his email public, facebook will use a proxy email in stead).
2) Log that user in (guaranteed working email addy from FB means no need for verification)
3)put your FBpicture up beneath the logout button.

Here's a good tutorial on setting up a FB application which you will need to do to use this plugin. Its meant for a wordpress plugin, so instead of throwing the keys in a WP page, just you'll want to put that in the plugin in the appropriate fields. (I just made an array in codebase.php, maybe theres a better coppermine way to do things, but I'm a coppernewb;) )
http://www.youtube.com/watch?v=nFCIlfnwZQg

Here's some Facebook Documentation: http://developers.facebook.com/docs/authentication/
Here's what helped me wrap my head around the FB login process: http://github.com/facebook/php-sdk


Things I'd like to do:
1) Change login to fancy-pants javacript login.
2) Once you FBlogin, all the checking the FBsession stuff happens after Coppermine Authentication, so I had to make it refresh. later on, there was a change to the site that made this endlessly loop. That needs to be done cleaner.
3) I couldn't figure out how to find the 'logout button' in the $menu array, o I just used $menu[11]. If you rearranged your menu, be sure and change this or better yet make it so its automatic.

A note about the quality: This is my first coppermine plugin. If its a little hacked, its because I'd never heard about coppermine until a few days before I created this, and my boss gave me a very short deadline. I ended up getting it to "just work" for what we needed with not too much thought of scalability for other users.

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Facebook Login Plugin
« Reply #1 on: July 12, 2010, 08:00:25 am »

It's a pity that you haven't based your second generation plugin on the version that I originally had attached to your first draft version that you had to withdraw for personal reasons: the plugin that I had attached already used to contain several fixes and (most important of all) i18n. Some editing and work had already gone into the version I attached. Your second attempt is a step back. I had to perform a diff to get the delta between your initail version and the one I attached and apply the changes to your new version. Please be carefull as well with your version numbering scheme: your old copy had the version number 0.9, the one I attached in reply had 1.0. The new version you initially posted in this thread would have been v1.1, that's why my the version I have attached to my posting here is v1.2
As I consider the idea of the plugin promising I will add an actual config section to it, as it is my firm believe that actual, true plugins should not require the end user to modify any of the files.
With this being said, thanks again for your contribution.
I can see an issue though for end users: why are there two login buttons? In an ideal world, this wouldn't be a plugin, but a bridge file contribution.

Joachim

P.S. You might as well want to take a look at http://documentation.coppermine-gallery.net/en/dev_plugins.htm#plugin_writing_naming_conventions_archives
« Last Edit: July 12, 2010, 08:23:37 am by Joachim Müller »
Logged

omnitool

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 7
Re: Facebook Login Plugin
« Reply #2 on: July 13, 2010, 12:14:51 am »

It's a pity that you haven't based your second generation plugin on the version that I originally had attached to your first draft version that you had to withdraw for personal reasons: the plugin that I had attached already used to contain several fixes and (most important of all) i18n. Some editing and work had already gone into the version I attached. Your second attempt is a step back. I had to perform a diff to get the delta between your initail version and the one I attached and apply the changes to your new version.

By the time I had read your post, I tried to download your version. but it had moved to something called the CB board, which I didn't have permission to view. For some reason in this forum, you cant edit your own posts, you can't remove your own uploads, and for some reason you can't send messages to people, even if they message you. because of that I was unable to tell anybody what was going on.

Quote
Please be carefull as well with your version numbering scheme: your old copy had the version number 0.9, the one I attached in reply had 1.0. The new version you initially posted in this thread would have been v1.1, that's why my the version I have attached to my posting here is v1.2

The old post was deleted. I was told to not reference the old post and go on as if it never existed. that's what I did. personally, I don't think this plugin is quite ready to be >=1.0 which is why I versioned it 0.9.  I assumed anybody who was going to update my plugin would follow standard versioning conventions and update it to 0.9.1, 0.9.2, etc... until it was finally stable. You might want to look at http://en.wikipedia.org/wiki/Software_versioning#Version_1.0_as_a_milestone


Quote
As I consider the idea of the plugin promising I will add an actual config section to it, as it is my firm believe that actual, true plugins should not require the end user to modify any of the files.
agreed. Thats what I said in my post. I just don't know how to use this because I've never worked with coppermine.
Quote
With this being said, thanks again for your contribution.
I can see an issue though for end users: why are there two login buttons?

the top login button is to login the old way. The new 'Connect with facebook' button is to connect through facebook. If it were possible to do what ,say, youtube does and have a single username/password login box, I'd say go for it, but I'm pretty sure FB wants you to use their proprietary login box thats on their page. I say that because I've never seen a static facebook login box. but maybe I'm wrong.

Quote
In an ideal world, this wouldn't be a plugin, but a bridge file contribution.


I don't know what that is. I've learned symfony, drupal, joomla, and wordpress, and never come accross a bridge file. Of course I'm self taught, so theres a lot I dont know that exists.

I'm not going to be maintaining this 'plugin' because we found a better solution and moved away from coppermine. I'm just offering it here if somebody else with coppermine experience wants to turn it into a plugin the coppermine way.
« Last Edit: July 13, 2010, 01:01:16 am by onthepike »
Logged

omnitool

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 7
Re: Facebook Login Plugin
« Reply #3 on: July 13, 2010, 12:15:32 am »

and, of course, I can't edit my own post. :-\
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Facebook Login Plugin
« Reply #4 on: July 13, 2010, 08:30:44 am »

The ability for regular users to edit their postings has deliberately been removed because of frequent abuse in the past.
As contributor you should be moved to the appropriate board group and get the permission to edit your posts.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Facebook Login Plugin
« Reply #5 on: July 13, 2010, 05:29:56 pm »

and, of course, I can't edit my own post. :-\
You're not meant to, that's why. Postings remain unchanged preferably.

By the time I had read your post, I tried to download your version. but it had moved to something called the CB board, which I didn't have permission to view.
My version used to be attached to the posting in which I told you about the remnant private data inside your first public release, so this sound a bit implausible. Anyway, as I said, I have re-added the changes. Please base future contributions on the file I have attached.

For some reason in this forum, you cant edit your own posts, you can't remove your own uploads, and for some reason you can't send messages to people, even if they message you. because of that I was unable to tell anybody what was going on.
As André suggested, that's on purpose. We organize this forum differently: we believe in posting publicly, that's why there are no PMs allowed for regular users.

personally, I don't think this plugin is quite ready to be >=1.0 which is why I versioned it 0.9.
I understand that version numbering scheme and I have seen it before of course. End users never care about such things, they never ask themselves what a version number zero dot something means. That's why I consider this numbering scheme overkill.
I assumed anybody who was going to update my plugin would follow standard versioning conventions and update it to 0.9.1, 0.9.2, etc... until it was finally stable. You might want to look at http://en.wikipedia.org/wiki/Software_versioning#Version_1.0_as_a_milestone
I'm aware that there are various version numbering schemes. For Coppermine plugins we agreed to start counting at 1.0. If you think that your plugin isn't mature enough, you're welcome to illustrate that by saying so in the description or install text, that's our prefered method to make end users aware of the fact that we consider versions as not-stable-yet.

I just don't know how to use this because I've never worked with coppermine.
Only recently I have finished coming up with additional documentation on adding config options, see http://forum.coppermine-gallery.net/index.php/topic,65526.msg327967.html#msg327967

and never come accross a bridge file. Of course I'm self taught, so theres a lot I dont know that exists.
Try http://documentation.coppermine-gallery.net/en/bridging.htm#integrating_bridge_file_creating_start as a start

I'm not going to be maintaining this 'plugin' because we found a better solution and moved away from coppermine. I'm just offering it here if somebody else with coppermine experience wants to turn it into a plugin the coppermine way.
OK, thanks again for your contrib. What license does your plugin come with? Is it GNU GPLed? Are we allowed to add it to the subversion repository?

As contributor you should be moved to the appropriate board group and get the permission to edit your posts.
You have been promoted to contributor status.
Logged

taucher_0815

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 134
Re: Facebook Login Plugin
« Reply #6 on: August 11, 2010, 11:38:23 am »

I am getting an Error during installation of the plugin...

Quote
Parse error: syntax error, unexpected '{' in /var/www/*some more text here*/coppermine/plugins/fb_oauth/codebase.php on line 69

Any idea on how to get around?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Facebook Login Plugin
« Reply #7 on: August 11, 2010, 11:47:57 am »

Which version do you use?
Logged

taucher_0815

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 134
Re: Facebook Login Plugin
« Reply #8 on: August 11, 2010, 11:51:37 am »

Jochen's version: cpg1.5.x_plugin_fb-oauth_v1.2.zip.zip
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Facebook Login Plugin
« Reply #9 on: August 11, 2010, 12:05:52 pm »

Works for me as expected. Check if none of your files are corrupted/incomplete.
Logged

taucher_0815

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 134
Re: Facebook Login Plugin
« Reply #10 on: August 11, 2010, 12:09:01 pm »

uploaded several times. also the initial file from the Thread-Opener. Same Error.

May it be the PHP-Version? running on "PHP Version 4.4.9-0.dotdeb.1"
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Facebook Login Plugin
« Reply #11 on: August 11, 2010, 12:17:11 pm »

May it be the PHP-Version? running on "PHP Version 4.4.9-0.dotdeb.1"
Exceptions don't exist in PHP4:
Parse error: syntax error, unexpected '{' in /var/www/*some more text here*/coppermine/plugins/fb_oauth/codebase.php on line 69
Code: [Select]
$me = null;
// Session based API call.
if (!empty($session)) {
  try {
    $uid = $facebook->getUser();
    $me = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    error_log($e);
  }
}
Logged

taucher_0815

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 134
Re: Facebook Login Plugin
« Reply #12 on: August 11, 2010, 12:22:52 pm »

after switching to PHP Version 5.2.13-0.dotdeb.1

Parse error: syntax error, unexpected '}' in /var/www/*some more text here*/coppermine/plugins/fb_oauth/codebase.php on line 99
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Facebook Login Plugin
« Reply #13 on: August 11, 2010, 12:27:56 pm »

Parse error: syntax error, unexpected '}' in /var/www/*some more text here*/coppermine/plugins/fb_oauth/codebase.php on line 99

I cannot find a '}' on line 99:
Code: (codebase.php, line 99) [Select]
$JS['includes'][] = 'plugins/fb_oauth/include/fbconnect.js';
I don't know what you're doing, sorry.
Logged

taucher_0815

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 134
Re: Facebook Login Plugin
« Reply #14 on: August 12, 2010, 05:48:36 pm »

strange... re-re-re-downloaded the zip, copied to the server inserted the requiered data and installed the plugin.

But now I do not see the FB-Connect-Button.

Using the unmodified "curve"-theme. Also copied the language file to german.php.

even a call to http://www.sk-foto.info/?lang=english does not bring this up

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Facebook Login Plugin
« Reply #15 on: August 12, 2010, 06:15:52 pm »

Works with e.g. the water_drop theme: http://www.sk-foto.info/?theme=water_drop
Logged

taucher_0815

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 134
Re: Facebook Login Plugin
« Reply #16 on: August 12, 2010, 06:21:09 pm »

any idea on how to bring this to curve?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Facebook Login Plugin
« Reply #17 on: August 12, 2010, 06:33:42 pm »

You have to adjust the way how the button is added to the menu:
Code: [Select]
$new_button = array();
$new_button[0][0] = $buttonTtl;
$new_button[0][1] = $lang_plugin_fb_oauth['login_title'];
$new_button[0][2] = $buttonLnk;
$new_button[0][3] = 'fb_oauth';
$new_button[0][4] = $template_sys_menu_spacer;
$new_button[0][5] = 'rel="nofollow"';

array_splice($menu, count($menu)-1, 0, $new_button);

I cannot give you a working code snipped as I decided it's finishing time for today :P
Logged

purplefreak3

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
Re: Facebook Login Plugin
« Reply #18 on: August 14, 2010, 09:03:42 am »

Hello I am trying to use this plugin but I use the Curve theme, looked around on how to add it but havn't had much luck. Possible any more details on how to bring this plugin to Curve them?

Gallery
http://www.beautifuljodelle.com/gallery-user-created
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Facebook Login Plugin
« Reply #19 on: August 14, 2010, 10:23:04 am »

Please read one post above... ::)
Logged
Pages: [1] 2   Go Up
 

Page created in 0.026 seconds with 21 queries.