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?
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
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&change_version=invision&keep_theme=2'" 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)