PDA

View Full Version : an action to force username + password to expire


Jimbosar
10-11-2002, 02:12 AM
Hi guys,

I recently created some online courses and I require for my clients to register. I am using my host's script as far as the user registration form is concerned.

Here is my question: Is there any way to add a sript in the last page of the courses so when they exiting the courses (clicling on the "Exit" button for example) their usernames and passwors expire, become invalid.....so they have to re-register if they want to access the courses again. What I mean is that they won't be able to use the same username and password again without re-submitting the form I created for user registration.

I was thinking something like adding an action to a button in order to get the result I want....but how?

I hope I was clear enough. It is very important for me if there is a possibility to make this happen.

Thank you in advance:)

whammy
10-11-2002, 02:15 AM
What does your host's script do?

Jimbosar
10-11-2002, 02:48 AM
I think I confused you Whammy.
What I meant is that I have to use my host's script for adding users to my open groups.....
Otherwise the script behind the page is a simple one like this below:

<FORM METHOD=POST ACTION=http://home.btconnect.com/cgi-bin/endreg?ADD>
<font face="Arial">
<INPUT TYPE=HIDDEN NAME="LINKURL" VALUE="/NormanMarkOnline/COURSES/GAS&ELECTRICAL_SAFETY">
<INPUT TYPE=HIDDEN NAME="LINKNAME" VALUE="Click here to access the GAS & ELECTRICAL SAFETY course!">
<INPUT TYPE=HIDDEN NAME="URL" VALUE="NormanMarkOnline/COURSES/GAS&ELECTRICAL_SAFETY">
</font>
<hr>
<p align="center">
<font face="Arial"><br>
Type in your preferable <b>username</b>: <INPUT SIZE=8 NAME="User-name" VALUE=""><font color="#FF0000">
</font><font color="#0000FF">(e.g. john or john1965 etc.)</font><font color="#FF0000"><br>
</font><font color="#800000">(You can use letters and numbers up to 8 characters long).<br>
</font>
<br>
Type in your preferable <b>password</b>:
<INPUT TYPE=password SIZE=10 NAME="User-password">
<font color="#0000FF">(e.g. learner or learner31 etc.)<br>
</font><font color="#800000">(You can use letters and numbers up to 10 characters long).<br>
</font>
<br>
Re-type your <b>password</b>:
<INPUT TYPE=password SIZE=10 NAME="User-password-confirmation">
<font color="#0000FF">(e.g. learner or learner31 etc.)</font><br>
<font color="#800000">(Confirm your password).</font><br>
&nbsp;</font></p>
<hr>
<p align="center">
<font face="Arial">
<br>
<INPUT TYPE=submit VALUE="submit"><br>
&nbsp;</font></p>
</FORM>


Thanks for your quick reply

:p

whammy
10-11-2002, 02:51 AM
Actually that doesn't help, since you just gave me the HTML code for the registration form, and not the server-side code that actually does something... which again begs my question, "What does your host's script do?".

What I meant was... does the script write their information into a database? I would assume so, since it's a login script.

If that's the case, then you need to have some field in the database that's an identifier, for instance, a field named "Active" that is a bit field that's either true (1) or false(0) (and that may depend on what kind of database you're using).

If you want to "deactivate" them, just write a 0 to that field when someone exits the course... and they are no longer "Active".

Obviously you'd check for that before displaying any course information.

:confused:

Jimbosar
10-11-2002, 03:11 AM
I think you are right ....there is a database which has been created by my host.

All I can do is to go to my host's site and check the details about the users have been registered up to now.

I cannot see the database...or at least I don't know how do so.
There is a way?....can change that database? do I have to ask for their permission to do that or to tell me where is located etc.

If it mke sense to you what I am trying to say...please advice me what to do.
Cheers

whammy
10-11-2002, 03:13 AM
What I would do is email or call your host and see if there is any method of altering the data in their database... if not, you might want to find a host that allows you to create and maintain your own. :)

Jimbosar
10-11-2002, 03:36 AM
Thanks whammy.

I 'll check it out.

Bless:thumbsup:

scriptblur
10-11-2002, 09:22 AM
Hi there....

actually i got a quite similar problem like what Jimbosar is having...... that is i need to use expiry function in my asp file which cannot be done by using response.expires =-1....
what is wrong with it??? anything to do with the server or browser compatibility......

can anyone please help????:confused:

Alekz
10-11-2002, 10:23 AM
Hi,
Sometimes, there's no database... well there is but it just contains user names and passwords... For each logged in user there's some flag set as a session variable. If this is the case, the user can be logged out by <%Session.Abort%>.
You can check if this is the case quite easy... Log in, then don't tuch at Your browser for 30 minutes (I trhink that was the default session timeout)... let them be 60 minutes to be sure... then try to navigate the site... If You are redirected to the login page, <%Session.Abort%> should work as log off script.
If there's an "Active" field set in a database, as Whammy mentioned, and You can not directly access it, You could try to invalidate the session by cleaning up all cookies sent by the server - that's the usual way browser identifies itself when calling the server. This can be done like that:
<%
For Each cookie in Response.Cookies
Response.Cookie(cookie) = " "
Next
%>


Alex

glenngv
10-11-2002, 10:40 AM
it's session.abandon not session.abort
session timeout default = 20 mins not 30 mins

Alekz
10-11-2002, 10:49 AM
You are right, 10x :)
Seems that I start forgetting things... hmmm too bad...

Alex

Jimbosar
10-12-2002, 12:16 AM
Hi guys,

Thank you for all the responses.......
I am working on it....testing etc. I 'll let you know if I come up with something "new"..


Thanks again,

:)