diff options
| author | spiderr <spider@viovio.com> | 2013-07-03 16:09:39 -0400 |
|---|---|---|
| committer | spiderr <spider@viovio.com> | 2013-07-03 16:09:39 -0400 |
| commit | 3bf9d931a1f2b2043f8f7cb54a57f52212dbafef (patch) | |
| tree | c107ba304f9207af6f5c3ce67266a73cce4ca37b /register.php | |
| parent | 6561146395a09ef94339bf6cd5916f0c63f6b666 (diff) | |
| download | users-3bf9d931a1f2b2043f8f7cb54a57f52212dbafef.tar.gz users-3bf9d931a1f2b2043f8f7cb54a57f52212dbafef.tar.bz2 users-3bf9d931a1f2b2043f8f7cb54a57f52212dbafef.zip | |
add signin
Diffstat (limited to 'register.php')
| -rw-r--r-- | register.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/register.php b/register.php index 940a72d..92b62cc 100644 --- a/register.php +++ b/register.php @@ -26,13 +26,19 @@ require_once( KERNEL_PKG_PATH.'BitBase.php' ); include_once( KERNEL_PKG_PATH.'notification_lib.php' ); require_once( USERS_PKG_PATH.'classes/recaptchalib.php' ); -// Permission: needs p_register $gBitSystem->verifyFeature( 'users_allow_register' ); +// Everything below here is needed for registration + require_once( USERS_PKG_PATH.'BaseAuth.php' ); -if( isset( $_REQUEST['returnto'] ) ) { - $_SESSION['returnto'] = $_REQUEST['returnto']; +if( !empty( $_REQUEST['returnto'] ) ) { + $_SESSION['returnto'] = $_REQUEST['returnto']; +} elseif( !empty( $_SERVER['HTTP_REFERER'] ) && !strpos( $_SERVER['HTTP_REFERER'], 'login.php' ) && !strpos( $_SERVER['HTTP_REFERER'], 'register.php' ) ) { + $from = parse_url( $_SERVER['HTTP_REFERER'] ); + if( !empty( $from['path'] ) && $from['host'] == $_SERVER['SERVER_NAME'] ) { + $_SESSION['loginfrom'] = $from['path'].'?'.( !empty( $from['query'] ) ? $from['query'] : '' ); + } } if( $gBitUser->isRegistered() ) { @@ -167,5 +173,10 @@ foreach( $gBitSystem->mPackages as $package ) { } $gBitSmarty->assign_by_ref('packages',$packages ); +if( !empty( $_REQUEST['error'] ) ) { + $gBitSmarty->assign( 'error', $_REQUEST['error'] ); + $gBitSystem->setHttpStatus( HttpStatusCodes::HTTP_FORBIDDEN ); +} + $gBitSystem->display('bitpackage:users/register.tpl', 'Register' , array( 'display_mode' => 'display' )); ?> |
