The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Switch Accounts Widget

View previous topic View next topic Go down

Solved Switch Accounts Widget

Post by silverfoxangel on December 19th 2012, 6:51 pm

I'm not sure if this has been asked but here goes. I have a lot of members in my forum and often they have to switch between some of their accounts. The issue is that login out and login in takes a lot of time, especially when we're trying to write with members in different time zones and every second counts.

Now I've tried to make a switch account box that expedites the process. It all seems to work but when I click log in, instead of taking me back to my forum, it redirects me to: http://www.editboard.com/

This is the code for the widget I'm working with. Any ideas where I've gone wrong?

Code:
<script>
(function(){
    for(var idct=1;!document.getElementById('componentDiv'+idct);idct++)break;
    document.write('<div id="componentDiv'+idct+'"></div>')
    document.getElementById('componentDiv'+idct).onclick = function(event){
        var targ = event.srcElement||event.target;
        if(targ && targ.parentNode.getAttribute('gigid')){pb_openOverlay();}
    }
    function gig_loginEvent(eventObj){
        var minutes = 360;
        if (document.sideloginform.minutes.checked)minutes = -1;
        document.location="/index.cgi?action=login2&uid=" + eventObj.UID + "&signature=" + eventObj.UIDSignature + "×tamp=" + eventObj.signatureTimestamp + "&username=.&minutes="+minutes;
        pb_closeOverlay();
    }
    function gig_loginError(error){
        pb_closeOverlay();
    }
    function gig_loginClose(){
        alert();
        pb_closeOverlay();
    }
    gigya.services.socialize.addEventHandlers(conf,
    {
        onLogin : gig_loginEvent
        ,onClose : gig_loginClose
        ,onError : gig_loginError
    });
    var login_params0 =
    {
        useHTML : 'true'
        ,showTermsLink : 'false'
        ,height : 25
        ,width : 180
        ,containerID : 'componentDiv'+idct
        ,UIConfig : '<config><body><controls><snbuttons buttonsize="20"></snbuttons></controls></body></config>'
        ,hideGigyaLink : 'true'
        ,onClose : gig_loginClose
        ,onError : gig_loginError
    }
    if(!window.pb_openOverlay){window.pb_openOverlay = function(){}; window.pb_closeOverlay = function(){};}
    gigya.services.socialize.showLoginUI(conf,login_params0);
})()
</script>

<form action="/index.cgi" method="post" name="sideloginform" onsubmit="disable(this);if(location.href.indexOf('action=logout')==-1)this.redirect.value=location.href;">
<input type="hidden" value="/index.cgi" name="redirect">
<input type="hidden" name="action" value="login2">
<center><table width="100%" cellspacing="3" cellpadding="0" border="0">
<tr>
<td width="50%"><center><font size="1pt">Character:</font></center></td>
<td width="50%"><input type="text" name="username" size="18" tabindex="3001" maxlength="18" class="sidelogin user"></td>
</tr><tr>
<td width="50%"><center><font size="1pt">password:</font></center></td>
<td width="50%"><input type="password" name="password" size="18" tabindex="3002" class ="sidelogin password"></td>
</tr><tr title="stay logged in">
<td width="50%"><center><font size="1pt">stay on:</font></center></td>
<td width="50%"><input type="checkbox" id="minutesinput1" name="minutes" tabindex="3003"></td>
</tr><tr>
<td width="100%" align="center" colspan="2">
<input type="submit" value=" login " tabindex="3004" class="sidelogin submit">
<input type="button" style="display: none;" id="sidelogout" onclick="location.href='/index.cgi?action=logout'" value="Logout" class="sidelogin logout">
<img onload="document.getElementById('sidelogout').style.display=(pb_username=='Guest'?'none':'')" src="http://s3.images.proboards.com/blank.gif">
<center><font size="1pt"><a href="/index.cgi?action=register" class="sidelogin register">new</a></font> |
<font size="1pt"><a href="/index.cgi?action=forgotpassword" class="sidelogin forgot">forgot</a></font></center>
</td></tr>
</table></center>
</form><br />
<b></b>

Edit---

Found another code somewhere, but again doesn't work. I can put in a username and a password but when I click the "switch user" button it brings me to a blank page with a link that says "you can return to the index" but yet it doesn't change the accounts. I must add that I run an RPG forum so we have user with multiple accounts so being able to switch without having to log in and out would be a god send to them

Code:
<center><form style='display:inline' action="[my forum url]/act=Login&CODE=01&CookieDate=1" method="post"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td>Username: </td><td><input type="text" width="100" class="forminput" size="10" name="UserName" onFocus="this.value=''" value="" /></td></tr><tr><td>Password: </td><td><input type='password' width="100" class='forminput' size='10' name='PassWord' onFocus="this.value=''" value='' /></td></tr></table><input type='submit' class='forminput' value='Switch User' /> <br><br> </form></center>


Last edited by SLGray on January 15th 2013, 7:57 am; edited 2 times in total (Reason for editing : more relevant info)

silverfoxangel
New Member

Female Posts : 17
Reputation : 1
Language : english

Back to top Go down

Solved Re: Switch Accounts Widget

Post by silverfoxangel on December 21st 2012, 6:49 pm

Bump
(I might add we're using an invision forum)

silverfoxangel
New Member

Female Posts : 17
Reputation : 1
Language : english

Back to top Go down

Solved Re: Switch Accounts Widget

Post by silverfoxangel on December 24th 2012, 8:35 pm

Anyone? seriously?

silverfoxangel
New Member

Female Posts : 17
Reputation : 1
Language : english

Back to top Go down

Solved Re: Switch Accounts Widget

Post by silverfoxangel on January 5th 2013, 10:04 am

*bump* bueller.....bueller........bueller........

silverfoxangel
New Member

Female Posts : 17
Reputation : 1
Language : english

Back to top Go down

Solved Re: Switch Accounts Widget

Post by nextlevelgaming on January 5th 2013, 12:46 pm

ok first

Code:
<form style='display:inline' action="/login" method="post" name="form_login">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Username: </td>
<td><input type="text" width="100" class="forminput" size="10" name="username" onFocus="this.value=''" value="" /></td>
</tr>
<tr>
<td>Password: </td>
<td>
<input type='password' width="100" class='forminput' size='10' name='password' onFocus="this.value=''" value='' />
</td>
</tr>
</table>
<input type='submit' class='forminput' name="login" value='Switch User' />
 <br />
<br />
</form>

That there would be the correct code to use to login btw Now with what you are trying to do I'm not 100% positive it could be done with this. So yeah.

nextlevelgaming
Forumember

Male Posts : 989
Reputation : 38
Language : English|CSS|HTML5|javascript|
Location : New York

http://www.easybbtutorials.forumotion.com

Back to top Go down

Solved Re: Switch Accounts Widget

Post by silverfoxangel on January 15th 2013, 6:32 am

Apologies for the late reply, started college again and my time is non existent now.

@ nextlevelgaming

what I'm trying to do is make a box that allows users to switch from one of their accounts into another WITHOUT the need of loging out constantly. As an RPG forum I have members who have multiple accounts and sometimes they and my admins need to hop from character to character. It's not something SUPER vital, but it would just be nice to give my members a "Switch accounts" box. Basically when you switch accounts the code would log you out of your current account and log you into your desired account in one step (not two like loging out then login back in)

@Rideem: I'll use the code you showed, see if it works. I will let you know.
Edit: Rideem, your code works great! Thank you So much.

This can be set as solved or complete. Thank you so much.


Last edited by silverfoxangel on January 15th 2013, 6:39 am; edited 2 times in total (Reason for editing : testing done)

silverfoxangel
New Member

Female Posts : 17
Reputation : 1
Language : english

Back to top Go down

Solved Re: Switch Accounts Widget

Post by SLGray on January 15th 2013, 7:58 am

Topic Solved & Locked


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36641
Reputation : 2441
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum