<?php


// contents of function LogoffForm

/*

Copyright © 2001 Nick Gammon.

  This program is free software; you can redistribute it and/or modify 
  it under the terms of the GNU General Public License as published by 
  the Free Software Foundation; either version 2 of the License, 
  or (at your option) any later version. 

  This program is distributed in the hope that it will be useful, 
  but WITHOUT ANY WARRANTY; without even the implied warranty of 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
  See the GNU General Public License for more details. 

*/

  global $header, $foruminfo, $control, $THIS_PAGE, $FORUM_URL,
         $bbsection_id, $bbtopic_id, $bbsubject_id, $page;
  
  $bbuser_id = $foruminfo ['bbuser_id'];
  ?>
  
  <form METHOD="post" ACTION="<?php echo $THIS_PAGE;?>"> 
    <table border=0 width="100%">
    <tr valign=top>
      <td align=left>
        <font size=2><?php echo $header; ?></font>
      </td>
      <td align=right>
        <table border=0 >
        <tr>
          <td>
          <p align=right><font size=1>You are logged on as:<b>
          <?php echo htmlentities ($foruminfo ['username']); ?> </b></font></p></td>
        </tr>
        <tr align=right>
          <td colspan=2> 
            <font size=1> 
            <?php 
              if ($control ['home_url'])
                {
                hLink ("Home", $control ['home_url']); 
                echo "&nbsp;|&nbsp;\n";
                }
              hLink ("View profile", 
                           $FORUM_URL . "bbshowbio.php", 
                           "bbuser_id=$bbuser_id"); 
              echo "&nbsp;|&nbsp;\n";
              hLink ("Edit profile", $FORUM_URL . "bbuseredit.php", 
                           "action=amend&bbuser_id=$bbuser_id"); 
              echo "&nbsp;|&nbsp;\n";
              hLink ("Users", $FORUM_URL . "bbuserlist.php"); 
              echo "&nbsp;|&nbsp;\n";
              hLink ("Search", $FORUM_URL . "bbsearch.php"); 
              if ($control ['faq_url'])
                {
                echo "&nbsp;|&nbsp;";
                hLink ("FAQ", $control ['faq_url']); 
                }
            ?>
            </font>
          </td>
        </tr>
         <tr align=right>
          <td colspan=2> 
          <input Type=submit Value="Log off">
          <input type=hidden name=action value=logoff>
          <?php FormSession (); ?>
          </td>
        </tr>
        </table>
      </td>
    </tr>
    </table>
   <?php
  
  // preserve variables so we end up seeing the same form
  if ($bbsection_id)
    echo "<input type=hidden name=\"bbsection_id\" value=$bbsection_id>\n";
  if ($bbtopic_id)
    echo "<input type=hidden name=\"bbtopic_id\" value=$bbtopic_id>\n";
  if ($bbsubject_id)
    echo "<input type=hidden name=\"bbsubject_id\" value=$bbsubject_id>\n";
  if ($page)
    echo "<input type=hidden name=\"page\" value=$page>\n";
  echo "</form>\n";
 
?>
