title: phpbb check that user is logged in on custom php page
body: <p>I'm running a private phpbb 3.0.12 forum and linking to a page called videochat.php which has a flash page connected to a rtmfp server. I would like to ensure that the person visiting videochat.php is logged in and registered (any access level besides guest) else it redirects them to www.domain.com. If the Member is registered I would like a variable called $videochatusername set. Thanks!</p>
  
  <p>videochat.php is (linked from the forum to this page) ->    domain.com/forum/videochat.php
  forum root dir -> domain.com/forum/</p>
  
  <pre><code>&lt;?php
  define('IN_PHPBB', true);
  $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '/forum';
  $phpEx = substr(strrchr(__FILE__, '.'), 1);
  include($phpbb_root_path . 'common.' . $phpEx);
  include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
  include($phpbb_root_path . 'includes/functions_user.'.$phpEx);
  
  // Start session management
  $user-&gt;session_begin();
  $auth-&gt;acl($user-&gt;data);
  
  if ($user-&gt;data['user_id'] == ANONYMOUS)
  {
  echo('NOT LOGGEDIN');
  }
  else{
  include($phpbb_root_path.'config.'.$phpEx);
  
  // test echo
  echo $user-&gt;data['username'];
  
  ?&gt;
  </code></pre>