down arrowMenu

UNI Webtools: Resources for Web Developers

Paul Booker: Allowing a user to login only if they have an active infusionsoft CRM contact.

Posted on Saturday, November 22nd, 2014 by Anonymous
 
/**
  * Implements hook_user_login().
  */
function mymodule_infusionsoft_user_login(&$edit, $account) {
  
  global $tag;

  if (user_access('administer site configuration')) { 
    return TRUE;
  }
  
  $contact_active =  _mymodule_infusionsoft_contact_active($account->mail);

  if ($contact_active == FALSE) { 
    session_destroy();
    session_start();
    // Load the anonymous user
    $user = drupal_anonymous_user();
    drupal_set_message(variable_get('mymodule_infusionsoft_message', 'Infusionsoft account not created or has expired.'), 'warning');
   
    if (empty($tag)) drupal_goto('user/register'); 
    if ($tag == "expired") drupal_goto('account-expired');
    if ($tag == "blocked") drupal_goto('account-blocked');
  } else {			

Paul Booker: Allowing a user to login only if they have an active infusionsoft CRM contact.

Posted on Saturday, November 22nd, 2014 by Anonymous
 
/**
  * Implements hook_user_login().
  */
function mymodule_infusionsoft_user_login(&$edit, $account) {
  
  global $tag;

  if (user_access('administer site configuration')) { 
    return TRUE;
  }
  
  $contact_active =  _mymodule_infusionsoft_contact_active($account->mail);

  if ($contact_active == FALSE) { 
    session_destroy();
    session_start();
    // Load the anonymous user
    $user = drupal_anonymous_user();
    drupal_set_message(variable_get('mymodule_infusionsoft_message', 'Infusionsoft account not created or has expired.'), 'warning');
   
    if (empty($tag)) drupal_goto('user/register'); 
    if ($tag == "expired") drupal_goto('account-expired');
    if ($tag == "blocked") drupal_goto('account-blocked');
  } else {			

Paul Booker: Allowing a user to login only if they have an active infusionsoft CRM contact.

Posted on Saturday, November 22nd, 2014 by Anonymous
 
/**
  * Implements hook_user_login().
  */
function mymodule_infusionsoft_user_login(&$edit, $account) {
  
  global $tag;

  if (user_access('administer site configuration')) { 
    return TRUE;
  }
  
  $contact_active =  _mymodule_infusionsoft_contact_active($account->mail);

  if ($contact_active == FALSE) { 
    session_destroy();
    session_start();
    // Load the anonymous user
    $user = drupal_anonymous_user();
    drupal_set_message(variable_get('mymodule_infusionsoft_message', 'Infusionsoft account not created or has expired.'), 'warning');
   
    if (empty($tag)) drupal_goto('user/register'); 
    if ($tag == "expired") drupal_goto('account-expired');
    if ($tag == "blocked") drupal_goto('account-blocked');
  } else {			

Paul Booker: Allowing a user to login only if they have an active infusionsoft CRM contact.

Posted on Saturday, November 22nd, 2014 by Anonymous
 
/**
  * Implements hook_user_login().
  */
function mymodule_infusionsoft_user_login(&$edit, $account) {
  
  global $tag;

  if (user_access('administer site configuration')) { 
    return TRUE;
  }
  
  $contact_active =  _mymodule_infusionsoft_contact_active($account->mail);

  if ($contact_active == FALSE) { 
    session_destroy();
    session_start();
    // Load the anonymous user
    $user = drupal_anonymous_user();
    drupal_set_message(variable_get('mymodule_infusionsoft_message', 'Infusionsoft account not created or has expired.'), 'warning');
   
    if (empty($tag)) drupal_goto('user/register'); 
    if ($tag == "expired") drupal_goto('account-expired');
    if ($tag == "blocked") drupal_goto('account-blocked');
  } else {			

Paul Booker: Allowing a user to login only if they have an active infusionsoft CRM contact.

Posted on Saturday, November 22nd, 2014 by Anonymous
 
/**
  * Implements hook_user_login().
  */
function mymodule_infusionsoft_user_login(&$edit, $account) {
  
  global $tag;

  if (user_access('administer site configuration')) { 
    return TRUE;
  }
  
  $contact_active =  _mymodule_infusionsoft_contact_active($account->mail);

  if ($contact_active == FALSE) { 
    session_destroy();
    session_start();
    // Load the anonymous user
    $user = drupal_anonymous_user();
    drupal_set_message(variable_get('mymodule_infusionsoft_message', 'Infusionsoft account not created or has expired.'), 'warning');
   
    if (empty($tag)) drupal_goto('user/register'); 
    if ($tag == "expired") drupal_goto('account-expired');
    if ($tag == "blocked") drupal_goto('account-blocked');
  } else {			

Pages

Subscribe to UNI Webtools: Resources for Web Developers RSS