/[drupal]/contributions/modules/drupalvb/drupalvb.module
ViewVC logotype

Diff of /contributions/modules/drupalvb/drupalvb.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.34, Sun Feb 1 02:00:25 2009 UTC revision 1.35, Sun Aug 2 01:21:43 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: drupalvb.module,v 1.33 2008/10/18 17:09:35 sun Exp $  // $Id: drupalvb.module,v 1.34 2009/02/01 02:00:25 sun Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 472  function drupalvb_user_delete($account) Line 472  function drupalvb_user_delete($account)
472  function drupalvb_login() {  function drupalvb_login() {
473    global $user;    global $user;
474    
475    if ($_REQUEST['name']) {    if ($_POST['name']) {
476        $form_state = array('values' => $_POST);
477      if ($user->uid) {      if ($user->uid) {
478        // If the user is already logged in to Drupal, we ensure the same for        // If the user is already logged in to Drupal, we ensure the same for
479        // vBulletin.        // vBulletin.
480        if (drupalvb_auth($_REQUEST['name'], trim($_REQUEST['pass']))) {        if (drupalvb_login_validate(array(), $form_state)) {
481          drupal_goto(!empty($_REQUEST['destination']) ? $_REQUEST['destination'] : 'user/'. $user->uid);          drupal_goto(!empty($_REQUEST['destination']) ? $_REQUEST['destination'] : 'user/'. $user->uid);
482        }        }
483        else {        else {
# Line 488  function drupalvb_login() { Line 489  function drupalvb_login() {
489      }      }
490      else {      else {
491        // Otherwise perform the full login procedure.        // Otherwise perform the full login procedure.
492        user_login_validate($_REQUEST['form_id'], $_REQUEST);        foreach (user_login_default_validators() as $validator) {
493            $validator(array(), $form_state);
494          }
495        if (!form_get_errors()) {        if (!form_get_errors()) {
496          $redirect = user_login_submit($_REQUEST['form_id'], $_REQUEST);          user_login_submit(array(), $form_state);
497            $redirect = (isset($form_state['redirect']) ? $form_state['redirect'] : '');
498          drupal_goto(!empty($_REQUEST['destination']) ? $_REQUEST['destination'] : $redirect);          drupal_goto(!empty($_REQUEST['destination']) ? $_REQUEST['destination'] : $redirect);
499        }        }
500        else {        else {
# Line 1027  function drupalvb_lookup_drupal_user($us Line 1031  function drupalvb_lookup_drupal_user($us
1031      // Register this user in Drupal using a temporary password, since we don't      // Register this user in Drupal using a temporary password, since we don't
1032      // know the real one. It will be updated when the user logs in to Drupal      // know the real one. It will be updated when the user logs in to Drupal
1033      // for the first time using its vBulletin credentials.      // for the first time using its vBulletin credentials.
1034      // @see drupalvb_auth()      // @see drupalvb_login_validate()
1035      $userinfo = array(      $userinfo = array(
1036        'name' => $vbuser['username'],        'name' => $vbuser['username'],
1037        'pass' => user_password(),        'pass' => user_password(),

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.2