Important security update, please update to Osclass 3.7.4
At Osclass we have changed our Privacy Policy and Terms of Use in order to adapt them to the new General Data Protection Regulation (GDPR). We want you to know what user data we store, what we need them for, and who we share them with in each specific case. Furthermore, we are making it even easier for you to exercise your right to manage your own data.
Our goal is that you enjoy the best possible experience with our website. As the GDPR comes into force, legislation requires us that you grant us permission—both to us and our partners—to store cookies in your browser. Remember you can find more information about what we do with your data by clicking here.
I accept Osclass SL’s Terms of Use and Cookies Policy and grant them permission to manage my data.
require_once osc_lib_path() . 'osclass/UserActions.php'; $uActions = new UserActions( false ); $logged = $uActions->bootstrap_login( $fbUser['fk_i_user_id'] ); switch( $logged ) { case 0: osc_add_flash_error_message( __( 'The username doesn\'t exist', 'facebook' ) ); break; case 1: osc_add_flash_error_message( __( 'The user has not been validated yet', 'facebook' ) ); break; case 2: osc_add_flash_error_message( __( 'The user has been suspended', 'facebook' ) ); break; } return self::$facebook; } } if( !isset(self::$user_profile['email']) ) { osc_add_flash_error_message( __('Some error occured trying to connect with Facebook.', 'facebook') ); header( 'Location: ' . self::$logoutUrl ); exit(); } $manager = User::newInstance(); $oscUser = $manager->findByEmail( self::$user_profile['email'] ); // exists on our DB, we merge both accounts if( count($oscUser) > 0 ) { require_once osc_lib_path() . 'osclass/UserActions.php'; $uActions = new UserActions( false ); $manager->dao->from( $this->getTableName() ); $manager->dao->set( 'fk_i_user_id', $oscUser['pk_i_id'] ); $manager->dao->set( 'i_facebook_uid', self::$user_profile['id'] ); $manager->dao->insert(); osc_add_flash_ok_message( __( "You already have an user with this e-mail address. We've merged your accounts", 'facebook' ) ); // activate user in case is not activated $manager->update( array('b_active' => '1') ,array('pk_i_id' => $oscUser['pk_i_id']) ); $logged = $uActions->bootstrap_login( $oscUser['pk_i_id'] ); } else { // Auto-register him $this->register_user( self::$user_profile ); header('Location:'.osc_user_profile_url() ); osc_add_flash_ok_message('Please update your profile in order for the member to recognize you much better'); } // redirect to log in header( 'Location: ' . osc_base_url() ); exit; } catch (FacebookApiException $e) { self::$user = null; } return self::$facebook; }
// Auto-register him $this->register_user( self::$user_profile ); header('Location:'.osc_user_profile_url() ); osc_add_flash_ok_message('Please update your profile in order for the member to recognize you much better'); }