Install UserSpice

mysql connet to the DB: 
	ALTER TABLE `users` ADD `valid_from` DATETIME;
	ALTER TABLE `users` ADD `valid_to` DATETIME;
	update users set valid_from = '2010-01-01 00:00:00';
	update users set valid_to = '2100-01-01 00:00:00';

Now there are just Admin and User Users, so I set them as ever-valid, to keep tables consistent.


in UserSpice Admin panel, add a new permissions level with the exact name 
	VALIDITY_TIME

extrac / copy my version of files in usersc:
	admin_users.php
	admin_user.php
	user_settings.php

extract / copy my version of file in users/helpers (in usersc or in usersc/helpers does not work)
	us_helpers.php

copy did_not_have_permission.php as new file did_not_have_time_permission.php
cp usersc/scripts/did_not_have_permission.php usersc/scripts/did_not_have_time_permission.php


go in usersc/ and do an sudo ln -s ../users/init.php ./init.php


Now, create a protected test page (I use the c1.php), add it to the DB, and add the VALIDITY_TIME permission, and the User permission.

Last step: create a new user (test_user). Set the From date and the To date.

Only if "From < NOW < To" is true the User can acces the page.


 

