Forum .LRN Q&A: Stopping the Students login After expiration
I am working on dotlrn for student administration, i created some students, now my doubt is how i can restrict the user / student after the expiration date is completed.
I created a table with the start date and end date, if want to block the students to access their pages after the expiration of the end date.do i need to modify the user-login page which is under the acs-subsite/www/register/ in order to check the end date and doen't login them is this is the correct way of approach i want some guidance regarding this.
one approach would be to schedule a procedure to change the member_state (see acs-kernel/sql/community-core-create.sql) of the user to 'deleted' after the expiration date (preferably you would have the state 'expired' but there is currently no such state). You might have to also log out any users who are currently logged in.
The advantage of this approach is that you don't have to customize (fork from) the OpenACS or dotLRN code.
Where are you storing the expiration date?
I am storing the student details in a table by name user_valid having fields user_id, group_id, start_date, end_date.
From this http://our_url:portno/index we are getting the email and the password what the student has typed in login page. Once we are able to get these values before these are validated by the openacs subsite page(register/user-login) i putting a TCL file in which i am checking for the date validation .
If the student is valid i.e. if his end_date > currenttimestamp then these details were redirected to the openacs subsite page(register/user-login) other wise i am stopping him sending a new error page generated by myself.
In case if the user is not a student i am redirecting to the openacs subsite page (register/user-login).
I am handling little bit code of openACS. So this is what i have done. Plz tell me whether i can go in a very simple manner than this.
One more i also want to have extra two more fields for start_date and end_date details when a new user is created using Add User portlate of dotlrn how i can add them.
So plz help me out as soon as possible
it seems to me your solution will work. I'm not sure I understand your other question - you want to store the date when a user becomes a dotLRN user, is that it? In that case you could record that date in your table from the dotlrn::user_add proc.