Advertising
- Something
- Wednesday, June 27th, 2012 at 8:00:24am MDT
- function checkauth($page){
- if(!isset($_SESSION))
- {
- session_start();
- }
- $access = FALSE;
- if(isset($_SESSION['AUTHED'])){
- if($_SESSION['AUTHED'])
- {
- if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] < 600)) { //10 minutes = limit for session variables
- $access = TRUE;
- $_SESSION['LAST_ACTIVITY'] = time();
- }
- else{
- flusha(); //no user activity for more than 10 minutes, we destroy his session logging him out and we also destroy his unsaved answers
- session_destroy();
- session_unset();
- return 1;
- }
- }
- }
- if($access==FALSE){
- if($page=='survey'){
- $_SESSION['msg']='Only registered users can access this page.</br>Please <a href="'.REDIRECT_TO_REG.'">register</a> or
- <a href="'.REDIRECT_TO_LOGIN.'">login</a> to take the survey.</br>';
- }
- }
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.