Ejemplo n.º 1
0
 public function output()
 {
     global $vbulletin, $db, $show, $VB_API_REQUESTS;
     // check if facebook and session is enabled
     if (!is_facebookenabled()) {
         return $this->error('feature_not_enabled');
     }
     require_once DIR . '/includes/functions_login.php';
     if (verify_facebook_app_authentication()) {
         // create new session
         process_new_login('fbauto', false, '');
         // do redirect
         do_login_redirect();
     } else {
         return $this->error('badlogin_facebook');
     }
 }
Ejemplo n.º 2
0
            // log this error if attempting to access the control panel
            require_once DIR . '/includes/functions_log_error.php';
            log_vbulletin_error($vbulletin->GPC['vb_login_username'], 'security');
        }
        $vbulletin->userinfo = $original_userinfo;
        if ($vbulletin->options['usestrikesystem']) {
            eval(standard_error(fetch_error('badlogin_strikes', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'], $strikes)));
        } else {
            eval(standard_error(fetch_error('badlogin', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'])));
        }
    }
    exec_unstrike_user($vbulletin->GPC['vb_login_username']);
    // create new session
    process_new_login($vbulletin->GPC['logintype'], $vbulletin->GPC['cookieuser'], $vbulletin->GPC['cssprefs']);
    // do redirect
    do_login_redirect();
} else {
    if ($_GET['do'] == 'login') {
        // add consistency with previous behavior
        exec_header_redirect($vbulletin->options['forumhome'] . '.php');
    }
}
// ############################### start lost password ###############################
if ($_REQUEST['do'] == 'lostpw') {
    $vbulletin->input->clean_gpc('r', 'email', TYPE_NOHTML);
    $email = $vbulletin->GPC['email'];
    if ($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']) {
        $navbits = construct_navbits(array('' => $vbphrase['lost_password_recovery_form']));
        eval('$navbar = "' . fetch_template('navbar') . '";');
    } else {
        $navbar = '';
Ejemplo n.º 3
0
	/**
	* Check if facebook is enabled, and perform appropriate action based on
	* 	authentication state (fb and vb) of the user
	*/
	public function load_facebook()
	{
		global $vbulletin, $show;

		// check if facebook and session is enabled
		if (is_facebookenabled())
		{
			// is user is logged into facebook?
			if ($show['facebookuser'] = vB_Facebook::instance()->userIsLoggedIn())
			{
				// is user logged into vB?
				if (!empty($vbulletin->userinfo['userid']))
				{
					// if vb user is not associated with the current facebook account (or no facebook account at all),
					// redirect to the register association page, if doing facebook redirect
					if ($vbulletin->userinfo['fbuserid'] != vB_Facebook::instance()->getLoggedInFbUserId())
					{
						if (do_facebook_redirect())
						{
							exec_header_redirect('register.php' . $vbulletin->session->vars['sessionurl_q']);
						}

						// if not doing facebook redirect and not on the reg page,
						// pretend the user is not logged into facebook at all so user can browse
						else if (THIS_SCRIPT != 'register')
						{
							$show['facebookuser'] = false;
						}
					}
				}

				// user is not logged into vb, but logged into facebook
				else
				{
					// check if there is an associated vb account, if so attempt to log that user in
					if (vB_Facebook::instance()->getVbUseridFromFbUserid())
					{
						// make sure user is trying to login
						if (do_facebook_redirect())
						{
							// need to load the style here to display
							// the login welcome message properly
							$this->load_style();

							require_once(DIR . '/includes/functions_login.php');
							if (verify_facebook_authentication())
							{
								// create new session
								process_new_login('fbauto', false, '');

								// do redirect
								do_login_redirect();
							}
						}
						// if user is not trying to login with FB connect,
						// pretend like the user is not logged in to FB
						else if (THIS_SCRIPT != 'register')
						{
							$show['facebookuser'] = false;
						}
					}

					// otherwise, fb account is not associated with any vb user
					else
					{
						// redirect to the registration page to create a vb account
						if (do_facebook_redirect())
						{
							exec_header_redirect('register.php' . $vbulletin->session->vars['sessionurl_q']);
						}

						// if not doing redirect and not trying to register,
						// pretend user is not logged into facebook so they can still browse the site
						else if (THIS_SCRIPT != 'register')
						{
							$show['facebookuser'] = false;
						}
					}
				}
			}
		}
	}
Ejemplo n.º 4
0
 /**
  * Check if facebook is enabled, and perform appropriate action based on
  * 	authentication state (fb and vb) of the user
  */
 public function load_facebook()
 {
     global $vbulletin, $show;
     $vbulletin->input->clean_array_gpc('r', array('dofbredirect' => TYPE_BOOL));
     $dofbredirect = ($vbulletin->GPC_exists['dofbredirect'] and $vbulletin->GPC['dofbredirect'] == 1);
     // check if facebook and session is enabled
     if (is_facebookenabled()) {
         // is user is logged into facebook?
         if ($show['facebookuser'] = vB_Facebook::instance()->userIsLoggedIn()) {
             // is user logged into vB?
             if (!empty($vbulletin->userinfo['userid'])) {
                 // if vb user is not associated with the current facebook account (or no facebook account at all),
                 // redirect to the register association page, if doing facebook redirect
                 if ($vbulletin->userinfo['fbuserid'] != vB_Facebook::instance()->getLoggedInFbUserId()) {
                     if (do_facebook_redirect()) {
                         exec_header_redirect('register.php' . $vbulletin->session->vars['sessionurl_q']);
                     } else {
                         if (THIS_SCRIPT != 'register') {
                             $show['facebookuser'] = false;
                             if ($dofbredirect) {
                                 standard_error(fetch_error('facebook_connect_fail'));
                             }
                         }
                     }
                 }
             } else {
                 // check if there is an associated vb account, if so attempt to log that user in
                 if (vB_Facebook::instance()->getVbUseridFromFbUserid()) {
                     // make sure user is trying to login
                     if (do_facebook_redirect()) {
                         // need to load the style here to display
                         // the login welcome message properly
                         $this->load_style();
                         require_once DIR . '/includes/functions_login.php';
                         if (verify_facebook_authentication()) {
                             // create new session
                             process_new_login('fbauto', false, '');
                             // do redirect
                             do_login_redirect();
                         }
                     } else {
                         if (THIS_SCRIPT != 'register') {
                             $show['facebookuser'] = false;
                             if ($dofbredirect) {
                                 standard_error(fetch_error('facebook_connect_fail'));
                             }
                         }
                     }
                 } else {
                     // redirect to the registration page to create a vb account
                     if (do_facebook_redirect()) {
                         exec_header_redirect('register.php' . $vbulletin->session->vars['sessionurl_q']);
                     } else {
                         if (THIS_SCRIPT != 'register') {
                             $show['facebookuser'] = false;
                             if ($dofbredirect) {
                                 standard_error(fetch_error('facebook_connect_fail'));
                             }
                         }
                     }
                 }
             }
         }
     }
 }