Home Private Messages Search
CPG Dragonfly™ CMS Dedicated Server & Bandwidth Sponsored by DedicatedNOW
Toggle Content
 
Forums ⇒ DragonflyCMS ⇒ Add-Ons & Blocks ⇒ OpenID for DragonFly


OpenID for DragonFly
Need help creating a block or add-on, or you have created or modified a block/add-on that works in Dragonfly CMS and it meets the CPG Security Requirements? Do you have feedback about a specific add-on? Here is the place to post. Read the announcements here first!.
Go to page 1, 2  Next
Post new topic    Reply to topic    Printer Friendly Page     Forum Index ⇒  Add-Ons & Blocks

View previous topic :: View next topic  
Author Message
Kendle
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Dec 16, 2004
Posts: 552

PostPosted: Thu Jul 15, 2010 12:54 pm
Post subject: OpenID for DragonFly

I've written a mod for DragonFly that allows you to login to a DragonFly website using OpenID.

This mod supports the following OpenID providers :-

A.O.L.
Blogger
Google
Live Journal
My OpenID
My Space
Word Press
Yahoo

(or at least I hope it does)

As I only have accounts myself at Google, MySpace and My OpenID those are the only ones I've been able to test it with so far. Yes, I could register on all those others but I was kinda hoping other people with accounts at those sites would like to help me out here Smile

This mod replaces the following core files :-

header.php
footer.php
blocks/block-User_Info.php
blocks/block-User_Info_Small.php
includes/cmsinit.inc
includes/class/cpg_member.php
language/english/your_account.php
modules/Your_Account/index.php
modules/Your_Account/register.php

so please, please, please ensure you keep copies of these files before replacing them with mine, so you can put them back if it all goes horribly wrong.

This package add a modal style dialog login box using the jQuery javascript framework extension for DragonFly (included in the package).

In the User Info blocks the Nickname / Password fields are replaced by a Login button, which upon clicking pops up the modal style login box.

Provide your website Username / Password as normal to login as normal. Alternatively provide an OpenID Username / Email and select an OpenID provider from the list.

For registered users the OpenID Username / Email must be the Username / Email they're registered on the website with.

For non-registered users upon returning to your site they'll be taken straight to the new user registration form with their Name / Email filled in (assuming the OpenID provider has been authorised to return this information) and the
Password (and confirm Password) fields hidden (a random password will be generated which the user doesn't need to know because they're using an OpenID account to authenticate themselves). This hopefully streamlines the new user registration process and doesn't require them to make up and remember another username and another password for your site.

It uses a PHP OpenID library called LightOpenID

gitorious.org/lightopenid

I'd consider this extremely beta at the moment, it needs testing and, assuming it works, tidying up (adding language defines and perhaps re-working the login forms maybe).

Feedback much appreciated.

edit: download the package from my website :-

www.cmsdreams.co.uk/in...s&id=9

(saves me having to keep updating the attachment here)

_________________
Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk

Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)


Last edited by Kendle on Mon Jul 26, 2010 9:56 am; edited 2 times in total
Back to top
View user's profile Visit poster's website
greenday2k
Forum Admin
Forum Admin

Offline Offline
Joined: Aug 11, 2005
Posts: 489
Location: CO
PostPosted: Thu Jul 15, 2010 5:38 pm
Post subject: Re: OpenID for DragonFly

I've checked your modified files, and the login procedure seems to be right (but nano djmaze should check it and give an accurate opinion about security).

If i understood, if the user is already registered (mail/user email check on users DB) on the site, the user will be logged in. but what will happend if the user isn't registered on the site? will be the code taking its email/username and redirect to the the signup page?

Changes made on modules/Your_Account/index.php are only on the login section?

_________________
www.greenday2k.net


greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
Kendle
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Dec 16, 2004
Posts: 552

PostPosted: Thu Jul 15, 2010 6:00 pm
Post subject: Re: OpenID for DragonFly

greenday2k wrote:
but what will happend if the user isn't registered on the site? will be the code taking its email/username and redirect to the the signup page?

No, I wanted to get the login bit nailed first, plus the LightOpenID class I'm using has a facility to get user details from the provider (assuming the provider agrees to provide them, which it doesn't have to) but it doesn't seem to work for Google. Google only validates the account or doesn't, it doesn't tell you anything about the user at all as far as I can make out.

greenday2k wrote:
Changes made on modules/Your_Account/index.php are only on the login section?

Yes, just the login form.

Like I say, I really want to prove the other providers work before possibly taking it to the next level and either re-directing to a (potentially partially filled in) registration form, or adding some javascript to provide a more customised login experience.

_________________
Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk

Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
Kendle
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Dec 16, 2004
Posts: 552

PostPosted: Mon Jul 19, 2010 2:05 pm
Post subject: Re: OpenID for DragonFly

A 2nd attempt at an OpenID login / registration system ...

This one replaces serveral core files, so use at your own risk and for heavens sake ensure you have copies of every file you replace.

Core files replaced :-

header.php
footer.php
blocks/block-User_Info.php
blocks/block-User_Info_Small.php
includes/cmsinit.inc
includes/class/cpg_member.php
language/english/your_account.php
modules/Your_Account/index.php
modules/Your_Account/register.php


Why so invasive? Well, it probably doesn't need to be but as it's impossible to intercept user login credentials without breaking into core files I figured I'd go a step further and add a modal dialog login box as well.

In the User Info blocks the Nickname / Password fields are replaced by a Login button, which upon clicking pops up a modal style login box, like so :-



Provide your website Username / Password as normal to login as normal. Alternatively provide an OpenID Username / Email and select an OpenID provider from the list.

For registered users the OpenID Username / Email must be the Username / Email they're registered on the website with.

For un-registered users upon returning to your site they'll be taken straight to the new user registration form with their Name / Email filled in (assuming the OpenID provider has been authorised to return this information) and the Password (and confirm Password) fields hidden (a random password will be generated which the user doesn't need to know because they're using an OpenID account to authenticate themselves). This hopefully streamlines the new user registration process and doesn't require them to make up and remember another username and another password for your site.

_________________
Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk

Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)


Last edited by Kendle on Tue Jul 20, 2010 2:02 pm; edited 1 time in total
Back to top
View user's profile Visit poster's website
earth
Heavy poster
Heavy poster

Offline Offline
Joined: Mar 01, 2006
Posts: 268

PostPosted: Mon Jul 19, 2010 6:02 pm
Post subject: Re: OpenID for DragonFly

thanks Kendle wtg

_________________
dfaddons.com

earth's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
OS/Apache/Mysql/php/9.2.X/
Back to top
View user's profile Visit poster's website Photo Gallery
Kendle
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Dec 16, 2004
Posts: 552

PostPosted: Tue Jul 20, 2010 2:02 pm
Post subject: Re: OpenID for DragonFly

Slightly updated package, doesn't do anything that the one posted previously does, however I've tidied up some code which I'm going to use in other things (hacks and modules).

_________________
Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk

Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)


Last edited by Kendle on Mon Jul 26, 2010 9:53 am; edited 1 time in total
Back to top
View user's profile Visit poster's website
greenday2k
Forum Admin
Forum Admin

Offline Offline
Joined: Aug 11, 2005
Posts: 489
Location: CO
PostPosted: Mon Jul 26, 2010 12:54 am
Post subject: Re: OpenID for DragonFly

Tried login with openid and genrated an ugly error.
Not sure if it was caused by using an unknown user,
tested blogger, google, myspace, live jopurnal, they're OK.

_________________
www.greenday2k.net


greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
Kendle
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Dec 16, 2004
Posts: 552

PostPosted: Mon Jul 26, 2010 9:00 am
Post subject: Re: OpenID for DragonFly

My OpenID works OK for me, I'll look into the Yahoo option.

edit: looks like Yahoo uses a secure page, so the URL is https://me.yahoo.com

I think you also need to specifically enable OpenID login for your Yahoo account, it doesn't work just by having a Yahoo account (I think).

In includes/classes/cpg_member.php look for this line :-

PHP:

case 'yahoo': $openid->identity = 'http://me.yahoo.com/'.$_POST['openid_identity']; break;

and change it to this :-

PHP:

case 'yahoo': $openid->identity = 'https://me.yahoo.com'; break;

(looks like you don't need the screenname either, just the Yahoo URL)

edit 2 : I've updated the package and put a link to the download page on my website in the opening post (so I only have to maintain it in one place).

_________________
Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk

Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
radoka
Newbie
Newbie

Offline Offline
Joined: Jan 25, 2010
Posts: 7
Location: Nyköping
PostPosted: Wed Jul 28, 2010 10:07 am
Post subject: Re: OpenID for DragonFly

Thanx alot for this addon! I use it on my site and find it very useful.


radoka's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
9.2.x
Back to top
View user's profile Visit poster's website
noair
Nice poster
Nice poster

Offline Offline
Joined: May 31, 2005
Posts: 90

PostPosted: Wed Jun 01, 2011 4:28 am
Post subject: Re: OpenID for DragonFly

I added this to the site and have problems with administering blocks. The java script that allows you to open and see what blocks are associated with the module will not work. At first I thought it was theme related so I tested it on the default theme and still had the issue. The problem code is in cmsinit.inc with the code below.

Code::

/****************************/
/*** start add CMSDreams ***/
/***************************/
$modcss = $modlib = array();
$modscript = $modfooter = '';
$framework = false;
define('JS_FRAMEWORK',true);
/***************************/
/*** end add CMSDreams   ***/
/***************************/


I saw in this post that Jquery conflicts with js_framwork but I do not see where jquery code is in cmsinit.inc. Thus, I can't say this is the issue. See link below. Has anyone else experienced this issue with OpenID hack and do you have a fix? Any help or a nudge in the right direction will be greatly appreciated.

Thanks

dragonflycms.org/Forum...framework/


noair's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
linux,apache,5.0.92,5.2.9,9.2.3.2
Back to top
View user's profile Visit poster's website
Kendle
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Dec 16, 2004
Posts: 552

PostPosted: Wed Jun 01, 2011 6:35 pm
Post subject: Re: OpenID for DragonFly

jQuery conflicts with javascript used in the admin section, so it won't work on any admin pages.

For the OpenID thing jQuery is loaded via header.php, there are some amendments in there as well.

_________________
Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk

Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
noair
Nice poster
Nice poster

Offline Offline
Joined: May 31, 2005
Posts: 90

PostPosted: Thu Jun 02, 2011 1:45 am
Post subject: Re: OpenID for DragonFly

Thanks Kendle that got me where I needed to be. Okay campers here is my hack that works so far. This requires further hacking of core files so if you are not comfortable with that then don't do it. Cool

This hack is not pretty but it works.

I went into includes/admin/blocks.php and changed line 89 from

Code::
require('header.php'); to require('header2.php'); 


I then took the header.php with out the openID code and named it header2.php and put it in root along with the modded openid header.php.

That's it you should be able to administer blocks. Yes I know its not pretty but again it works.


noair's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
linux,apache,5.0.92,5.2.9,9.2.3.2
Back to top
View user's profile Visit poster's website
greenday2k
Forum Admin
Forum Admin

Offline Offline
Joined: Aug 11, 2005
Posts: 489
Location: CO
PostPosted: Thu Jun 02, 2011 4:54 am
Post subject: Re: OpenID for DragonFly

or add to the openid section on header.php

if (!defined('ADMIN_PAGES')){
open id changes
}

I'm not using the OpenID addon, but i use jquery on my site, and its loaded even on admin pages, but after the dragonfly JS files.

_________________
www.greenday2k.net


greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
noair
Nice poster
Nice poster

Offline Offline
Joined: May 31, 2005
Posts: 90

PostPosted: Thu Jun 02, 2011 12:43 pm
Post subject: Re: OpenID for DragonFly

greenday2k wrote:
or add to the openid section on header.php

if (!defined('ADMIN_PAGES')){
open id changes
}

I'm not using the OpenID addon, but i use jquery on my site, and its loaded even on admin pages, but after the dragonfly JS files.

How would I do that in the code? Once I get this locked down a little better. I want to fix my openid hack with the account plus module.


noair's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
linux,apache,5.0.92,5.2.9,9.2.3.2
Back to top
View user's profile Visit poster's website
layingback
Forum Admin
Forum Admin

Offline Offline
Joined: Apr 19, 2004
Posts: 1040

PostPosted: Thu Jun 02, 2011 1:10 pm
Post subject: Re: OpenID for DragonFly

Compare the 2 versions of header.php, and then put the suggested if statement around (each of) the new code. Then the OpenID/jQuery stuff will only get executed when ADMIN_PAGES is not initialised, ie. outside of Admin.

If the changes aren't localised then your previous solution may be the lesser of the 2 evils.

_________________
Pro_News: The complete module for Dragonfly - now available as version 3.3

layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6 - 3.6 / 1.3.42 - 2.2.12 / 5.0.92 - 5.1.37 - 5.1.54 / 4.4.49 - 5.2.17 - 5.3 / 9.2.1
Back to top
View user's profile Visit poster's website Photo Gallery
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index ⇒  Add-Ons & Blocks
Page 1 of 2
All times are GMT
Go to page 1, 2  Next



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Fixed .ico Expires header.
· Removed domain name from cookies so subdomains wont access them anymore.
· CSS and JS, case insensitives.
· CSS and JS, send correct HTTP 1.1 headers and fixed issues where themes and...
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.

pročitaj još...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy