Gossamer Forum
Home : Products : DBMan : Customization :

Save Login Info MOD

Quote Reply
Save Login Info MOD
Hi,

Here's a MOD that will give the user the option to save their username and password as a cookie on their hard drive. Next time they go to your page, they won't have to enter all their login info, it will already be filled in, and they just hit enter. I also included with this MOD a little feature that will prompt the user if they entered data in only one field. So if they only enter their User ID and then hit enter, a popup screen will come up prompting that both fields must be filled in.

It's located here: http://www.koshervitamins.com/cookie.txt

[This message has been edited by JFrost (edited October 23, 1999).]
Quote Reply
Re: Save Login Info MOD In reply to
Excellent, Eli! I may just have a use for that in the very near future. Thank you! Smile


------------------
JPD





Quote Reply
Re: Save Login Info MOD In reply to
AWESOME!!!

I've been wanting to add this to my site for a long time now!!

Thanks a ton for the mod!!


------------------
Jason
Extreme mtb
http://extreme.nas.net
Quote Reply
Re: Save Login Info MOD In reply to
Thanks for the mod, Eli! I appreciate your work!

You should probably put this Mod in the Resource Center, so that it doesn't get lost in the Thread shuffle in this UBB (and also Alex is working on a new forum support software).

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Save Login Info MOD In reply to
DOH! I can't get it to work using the templates. I suppose that's one of the drawbacks of using the templated DBMan -- its hard to get any other mods to work on it.



------------------
Jason
Extreme mtb
http://extreme.nas.net
Quote Reply
Re: Save Login Info MOD In reply to
Here are a couple suggestions about using this mod with templates:

1) Create a global variable called print_get_variables in the dbm_templates.pl file, like the following:

Code:
print_get_variables => $print_get_variables,

2) Then in the appropriate template file: login_form.html file, place the Java script codes between the <head></head> tags (The sub_cookie routine).

3) Then replace the following codes:

Code:
<body bgcolor="#DDDDDD" text="#000000"|;
if ($print_get_cookies) { print qq~ OnLoad="GetCookies()"~; }
print qq|>|;
&cookie
print qq|

WITH THE FOLLOWING CODES:

Code:
<body bgcolor="#DDDDDD" text="#000000"
<%if print_get_cookies%>
OnLoad="GetCookies()
<%endif%>">

The rest of the codes should work.

Hope this helps.

Regards,


------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Save Login Info MOD In reply to
Is there anything that would need to be changed in this mod if you are logging into your dbman database from an html page outside of dbman?



------------------
donm
My theory on evolution is that Darwin was adopted.--Steven Wright

Quote Reply
Re: Save Login Info MOD In reply to
Hmmm...
I changed
&cookie
to
&cookie;

but I still get "Error on Page" java script message while using IE.

The html code looks identical to what you have here. Anyone suggestions? Did anyone get this to work yet?
Quote Reply
Re: Save Login Info MOD In reply to
Hi,

I found out what the problem was. When you post some things in this Message Board, it will replace them. For example. If I was to type &nbsp ; without the space after the p, I would get an actual space, and not not the text. So that's what happened here. Instead, this time I put it as a text file and posted it on a server. All you have to do is replace the sub cookie { with the new one.

Here is the location. http://www.koshervitamins.com/cookie.txt

Let me know if this works out for you now.

Eli
Quote Reply
Re: Save Login Info MOD In reply to
Oh yeah baby! Got it working after I looked at the source code for your .txt page. For some reason IE 5.0 thinks it's an html page.

Thanks!


[This message has been edited by Katana Man (edited October 18, 1999).]
Quote Reply
Re: Save Login Info MOD In reply to
Try again, James. It was there when I checked it just now.


------------------
JPD





Quote Reply
Re: Save Login Info MOD In reply to
hehe Doh!
It works great for IE, but Netscape seems to ignore whether the remember checkbox is checked or not.

I'm baffled. I tried it on 2 PC's. IE works as it should, yet Netscape 4.61 remembers the log in info no matter what I try. Even more confusing, I can delete my cookies.txt and it still shows the login info. Scratching my head. I must be doing something wrong.
Quote Reply
Re: Save Login Info MOD In reply to
Hi,

In order for it to work in Netscape, I believe you have to close it and then re-open it. If you just hit back it'll still be there. I'm mentioning this because in the begining I was also confused when it didn't work, then I figured it out.

Thanks
Eli
Quote Reply
Re: Save Login Info MOD In reply to
The Mod works great! However, I have a question. I'm currently using an "OnLoad" inside my body tag, that makes the login field focused. When I use it with the focus, it doesn't work. Any way to fix this? Here's the code I tried below:

<body bgcolor="#DDDDDD" text="#000000" onLoad="document.form1.userid.focus()"|; if ($print_get_cookies) { print q
q~ OnLoad="GetCookies()"~; } print qq|>|; &cookie; print qq|

Thanks,
Frank
Quote Reply
Re: Save Login Info MOD In reply to
I've talked to another person who gets the same error. Something is wrong with the java code. Any Ideas?
Quote Reply
Re: Save Login Info MOD In reply to
I had this mod working just fine, and then I add Jp's secure email lookup mod and and now I am stuck trying to get this to work again! Please help me.....

In her mod, JP has a onload statement in this line already. I can't edit it out, and if i keep it in the mod does not work correctly... (it loads up the wrong name and wrong password)

What am I to do???

1. Can I run getcookies() from a statement that is not Onload?

2. Does anyone have it working with jp's email mod?

Code:
<body bgcolor="#DDDDDD" text="#000000"|;
if ($print_get_cookies) { print qq~ OnLoad="GetCookies()"~; }
print qq|>|;
&cookie;
print qq|


here is what I have.........




Code:


##########################################################
## Authentication ##
##########################################################
sub html_login_form {
# --------------------------------------------------------
# The login screen.

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Login.</title>
</head>
<body bgcolor="#DDDDDD" text="#000000" onLoad="document.form1.userid.focus()">
<form action="$db_script_url" method="post" name="form1">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=0 CELLSPACING=0 width=700 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Login</b>
</td></tr>
<tr><td>
<p><center><$font_title>
<b>Log On</b></font></center><br>
<$font>Heritage Antique Maps <br><br> For Private Use Only.
<p>
<table border=0>
<tr><td><Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399><b>User ID:</b></FONT></td>
<td><input type="TEXT" name="userid"></td></tr>
<tr><td><Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399><b>Password:</b></FONT></td>
<td><input type="PASSWORD" name="pw"></td></tr>
</table>
<p align=center><center><input type="SUBMIT" name="login" value="Logon"> <INPUT TYPE="SUBMIT" NAME="logoff" VALUE="Cancel"></center></p>
</td></tr>
</table>
</center>
</form>
</body>
</html>
|;
}


[This message has been edited by maps (edited October 27, 1999).]

[This message has been edited by maps (edited October 27, 1999).]
Quote Reply
Re: Save Login Info MOD In reply to
I had this mod working just fine, and then I add Jp's secure email lookup mod and and now I am stuck trying to get this to work again! Please help me.....

In her mod, JP has a onload statement in this line already. I can't edit it out, and if i keep it in the mod does not work correctly... (it loads up the wrong name and wrong password)

What am I to do???

1. Can I run getcookies() from a statement that is not Onload?

2. Does anyone have it working with jp's email mod?

Code:
<body bgcolor="#DDDDDD" text="#000000"|;
if ($print_get_cookies) { print qq~ OnLoad="GetCookies()"~; }
print qq|>|;
&cookie;
print qq|
Quote Reply
Re: Save Login Info MOD In reply to
Maps -

All the following line -

<body bgcolor="#DDDDDD" text="#000000" onLoad="document.form1.userid.focus()">

in JP's mod does is place the users cursor inside the first form box found in the HTML.

You should be able to replace it with the onLoad="GetCookies()" call in the remember Login Mod.

Make sure it's "onLoad" not "OnLoad".

------------------
donm
All those who believe in psychokinesis, please raise my hand.




[This message has been edited by donm (edited October 27, 1999).]

[This message has been edited by donm (edited October 27, 1999).]
Quote Reply
Re: Save Login Info MOD In reply to
If I replace the line, nothing good happens...

The mod "works" but it loads the wrong users information. Is there a way to go around that?

maps
Quote Reply
Re: Save Login Info MOD In reply to
Try this replace the following line in sub_html_login_form

<body bgcolor="#DDDDDD" text="#000000" onLoad="document.form1.userid.focus()">

with -

<body bgcolor="#DDDDDD" text="#000000"|;
if ($print_get_cookies) {
print qq~ onLoad="GetCookies()"~;
}
print qq|>|;
&cookie;
print qq|

Hope this helps





------------------
donm
All those who believe in psychokinesis, please raise my hand.




[This message has been edited by donm (edited October 27, 1999).]
Quote Reply
Re: Save Login Info MOD In reply to
Well, it works... Kind of...

It takes the Admin/Admin and puts it into the form correctly... There is a problem though, I was not using the admin/admin login in...

It only "remembers" that one, and it also always bring it up, even if the check box is not selected.

Any thoughts?
Code:


##########################################################
## Authentication ##
##########################################################
sub html_login_form {
# --------------------------------------------------------
# The login screen.

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Login.</title>
</head>

<body bgcolor="#DDDDDD" text="#000000"|;
if ($print_get_cookies) {
print qq~ onLoad="GetCookies()"~;
}
print qq|>|;
&cookie;
print qq|
Quote Reply
Re: Save Login Info MOD In reply to
I got it!!!!

Thanks for all of your help!

maps