Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
Thoughts on a dual-login
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 06/25/08 18:51 
DISCLAIMER :: I HAVE NOT TRIED THIS, IT IS ONLY AND IDEA I HAVE HAD

I've been thinking about this for a while, and I decided to finally put some thoughts-to-screen on a dual-login for Jamroom and third party apps. This is what I have in mind:


Code
<form method="post" action="login.php">
    username:<br />
    <input type="text" id="jm_user" name="jm_user" class="jform input" style="width:110px"><br />
    password:<br />
    <input type="password" id="jm_pass" name="jm_pass" class="jform input" style="width:110px">
    <input type="submit" value="login" class="jform button" style="width:60px" onclick="javascript:document.getElementById('o_user').value=document.getElementById('jm_user').value;document.getElementById('o_pass').value=document.getElementById('jm_pass').value;document.getElementById('o_form').submit();this.form.submit()>
    </form>

    <form method="post" id="o_form" action="http://www.yoursite.com/thirdpartyapp/login.php" target="o_login">
        <input type="hidden" id="o_user" name="username_fieldname">
        <input type="hidden" id="o_pass" name="password_fieldname">
    </form>

<iframe name="o_login" src="about:blank" frameborder="0" style="display: none; visibility: none;">


You would, of course, need to change the "name" attributes of the items in the second form to line up with your third party app, as well as the action url to point to the login.php script.

If you do try it, let me know what your results are!


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 06/26/08 04:02 
interesting idea.

if the browser poped up an 'remember password' box, would there be 2? or would one open inside the iframed box and be invisible...

looks like it would be worth exploring.


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 06/26/08 12:11 
My guess is that it would just pop up the one in its own new window? I dunno...


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 07/20/08 00:25 
Just curious to see if anyone has tried this yet? I'm always seeing questions about people looking for dual logins for bridged apps, so I thought this would a pretty hot topic!


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 07/20/08 03:05 
Not in a position to need anything other than jamroom right now.

I see others wanting to use it in conjunction with joomla 1.5 and stuff, but i haven't found the necessity yet. Jamroom seams capable enough to handle most stuff by its self.


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 07/20/08 10:06 
Kyle I have been wanting this for awhile! let me play with it a bit.

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 07/20/08 15:29 
I like this approach Kyle (if it can work), since it doesn't require you to program the cookie/session info in the backend (which in turn can be a lot of work as you have to reverse engineer the login system for the bridged app). There a re some potential "gotchas" here, but if you can get a chance and do some tests, it might be a nice work around.

Thanks!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 07/20/08 16:22 
I have been unable to get the JR login to work. I created a new directory and just copied the code into a *.php file.

Anyone else having issues?

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 07/20/08 16:49 
I'll let you guys know what I can figure out!


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 07/20/08 21:59 
I was able to get this to work on Dazed's site. The code I posted will need to be modified for each app it is being used with, as some require certain extra fields (for example, on Dazed's site, it took me forever to figure out that his forum required the "login" input element in order for it to be processed). I also am slightly modifying my code above to:


Code
<form method="post" action="{$JAMROOM_URL}/login.php" id="jm_form">
    username:<br>
    <input id="jm_user" name="jm_user" value="{$jm_user}" class="jform input" style="width: 110px;" type="text"><br>
    password:<br>
    <input id="jm_pass" name="jm_pass" value="{$jm_pass}" class="jform input" style="width: 110px;" type="password">
    <input value="login" type="button" class="jform button" style="width: 60px;" onclick="javascript:document.getElementById('o_user').value=document.getElementById('jm_user').value;document.getElementById('o_pass').value=document.getElementById('jm_pass').value;document.getElementById('o_form').submit();setTimeout('document.getElementById(\'jm_form\').submit()',1000);">
    </form>

    <form method="post" id="o_form" action="http://www.yoursite.com/thirdpartyapp/login.php" target="o_login">
        <input id="o_user" name="username" type="hidden" value="">
        <input id="o_pass" name="password" type="hidden" value="">
    </form>

<iframe name="o_login" id="o_login" src="about:blank" style="display: none;" frameborder="0"></iframe>


What that will do is set a 1 second delay between the time the form clicked and when it is actually "submitted". This is done to give the hidden iframe time to submit it's own form.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 07/21/08 03:31 
absolutely awesome!! we need a hand clapping emoticon! I have tested this on IE and Firefox and it works well.

The only thing I wonder about is a way to log the user out of the forum when they log out of JR.

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 07/21/08 17:29 
That I'm not sure about. I think you would have to do the same kind of think with the jamroom logout link.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 07/21/08 18:29 

smith.kyle:
That I'm not sure about. I think you would have to do the same kind of think with the jamroom logout link.


Thanks Kyle, I am not so much worried about that now but the "keep me logged in to JR" does not seem to be working any more. I kept the checkbox/code in place but it does not seem to be working. Any ideas?

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 07/21/08 18:40 
what does the code look like?


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 07/21/08 20:13 
<input type="checkbox" name="jm_cookie"><span class="login-txt">{jr_lang id="117" default="Remember me"}</span>

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

123456Next >
 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.