users
[ class tree: users ] [ index: users ] [ all elements ]

Source for file login.php

Documentation is available at login.php

  1. <?php
  2. /**
  3.  * login
  4.  *
  5.  * @copyright (c) 2004-15 bitweaver.org
  6.  *
  7.  * @package users
  8.  * @subpackage functions
  9.  */
  10.  
  11. /**
  12.  * required setup
  13.  */
  14. include_once ("../kernel/setup_inc.php");
  15.  
  16. if( !empty( $_REQUEST['returnto'] ) ) {
  17.     $_SESSION['returnto'] = $_REQUEST['returnto'];
  18. } elseif( !empty( $_SERVER['HTTP_REFERER'] ) && !strpos( $_SERVER['HTTP_REFERER'], 'login.php' )  && !strpos( $_SERVER['HTTP_REFERER'], 'register.php' ) ) {
  19.     $from = parse_url( $_SERVER['HTTP_REFERER'] );
  20.     if( !empty( $from['path'] ) && $from['host'] == $_SERVER['SERVER_NAME'] ) {
  21.         $_SESSION['loginfrom'] = $from['path'].'?'.( !empty( $from['query'] ) ? $from['query'] : '' );
  22.     }
  23. }
  24.  
  25. if( $gBitUser->isRegistered() ) {
  26.     bit_redirect( $gBitSystem->getDefaultPage() );
  27. }
  28.  
  29. if( !empty( $_REQUEST['error'] ) ) {
  30.     $gBitSmarty->assign( 'error', $_REQUEST['error'] );
  31.     $gBitSystem->setHttpStatus( HttpStatusCodes::HTTP_UNAUTHORIZED );
  32. }
  33.  
  34. $gBitSmarty->assign( 'metaKeywords', 'Login, Sign in, Registration, Register, Create new account' );
  35. $gBitSystem->display( 'bitpackage:users/login.tpl', $gBitSystem->getConfig( 'site_title' ).' Login' , array( 'display_mode' => 'display' ));
  36. ?>

Documentation generated on Wed, 29 Jul 2015 13:57:03 +0000 by phpDocumentor 1.5.0-lsces