Location: PHPKode > projects > MembersGear > membersgear/member/user_logout.php
<?php       
   require_once "../config/config.php";
   require_once INCLUDE_DIR."/users_class.php"; 
   require_once INCLUDE_DIR."/users_signup_class.php";
   require_once INCLUDE_DIR."/product_class.php"; 
   $user=new users_class();
   
   $users_signup_class =new users_signup_class();
   $productobj=new product_class();
   
   if(isset( $_SESSION[SESSION_PREFIX.'UserID']))
   {
        if($users_signup_class->phpbbStatuscheck())
        {
            $phpBBProduct=phpBB_get_product_id();
            $proId=$productobj->checkForActiveSubscription($_SESSION[SESSION_PREFIX.'UserID'],$phpBBProduct);
            if($phpBBProduct==$proId)
            {
              phpBB_logout();
              mysql_select_db(MEMBERSGEAR_DB_NAME);
             }
              
        }
        
        if($users_signup_class->wordpressStatuscheck()){  
        
                $wordpressReqquiredFile= wordpress_physical_path();
                        
                if(file_exists($wordpressReqquiredFile)){

                        require_once($wordpressReqquiredFile); 
                        assign_sessions(); 
                        wordpress_remove_cookies(); 
                        $user->userLogout();
                           
                        $pos=strpos($_SERVER['QUERY_STRING'],'WpRedirectBack');
                        if($pos===false)
                               $_SERVER['HTTP_REFERER']=''; 
                         else{
                               $redirectStr=substr($_SERVER['QUERY_STRING'],($pos+15));
                                //$_SERVER['REQUEST_URI']=$redirectStr;
                                $loginbackUrl=WEB_URL."/user_login.php?externalurl=".urlencode($redirectStr);
                                Redirect($loginbackUrl,true); 
                               
                             }   
                         
     
                }
                   
          }

   } 
   $user->userLogout();    
  /*Added By asmita For dynamic Rotate Page*/  
  if(IS_ROTATING_LOGOUT_PAGES_ENABLED=='true') {
      $rotateurl= RandomFile(PHYSICAL_DIR."/member/rotating_logout_pages", array('html','htm','php'));  
      if($rotateurl!=false)
      {
        $rotateurl=str_replace(PHYSICAL_DIR,'',$rotateurl);
        $rotateurl= WEB_URL.$rotateurl;

        Redirect($rotateurl,true);
        
      }
  }
  else
   {
     $url= WEB_URL."/user_login.php";
     Redirect($url,true);die;
   }
?>
Return current item: MembersGear