Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.92 KB | None | 0 0
  1. At the head of your page
  2.  
  3.  
  4.  
  5. define('IN_PHPBB', true);
  6. define('PHPBB_ROOT_PATH', './phpBB3/');
  7.  
  8. $phpbb_root_path = 'phpBB3/';
  9.  
  10. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  11. include($phpbb_root_path . 'common.' . $phpEx);
  12. include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
  13.  
  14. // Start session management
  15. $user->session_begin();
  16. $auth->acl($user->data);
  17.  
  18.  
  19.  
  20.  
  21. The actual Login/Logout box:
  22.  
  23.  
  24.  
  25.            /* Start Logout*/
  26.                      if ($user->data['is_registered']){
  27.                      echo("<form method='post' action='".$phpbb_root_path."ucp.php?mode=logout&sid=".$user->data['session_id']."'>");
  28.                      echo("<input type='submit' name='logout' value='Logout'>");
  29.          echo("<input type='hidden' name='redirect' value='../index.php'>");
  30.                      echo("<br /></form>");
  31.                      }
  32.                     /*End Logout*/
  33.  
  34.                      /*Start Login Box*/
  35.                      if (!$user->data['is_registered']){
  36.                                 echo("form method='post' action='".$phpbb_root_path."ucp.php?mode=login'>");
  37.                                 echo(" Username:");
  38.                                 echo("<br />");
  39.                                 echo(" <input type='text' name='username' size='15' value=''>");
  40.                                 echo("<br /><br />");
  41.                                 echo(" Password:");
  42.                                 echo("<br />");
  43.                                 echo(" <input type='password' name='password' size='15' value=''>");
  44.                                 echo("<br /><br />");
  45.                                 echo("<input type='submit' name='login' value='Login'>");
  46.                                 echo("<input type='hidden' name='redirect' value='../".$_SERVER['PHP_SELF']."'>");
  47.                                 echo("<br /></form>");
  48.                        }
  49.                       /*End Login Box*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement