You are here

function pmperson_migrate_email_missmatch_count in Drupal PM (Project Management) 7.3

Same name and namespace in other branches
  1. 8 pmperson/includes/pmperson.migrate.inc \pmperson_migrate_email_missmatch_count()
  2. 7.2 pmperson/includes/pmperson.migrate.inc \pmperson_migrate_email_missmatch_count()

Gets count of email conflicts between pmperson nad drupal user.

1 call to pmperson_migrate_email_missmatch_count()
pmperson_migrate_update_could_be_performed in pmperson/includes/pmperson.migrate.inc
Checks for conflicts that would affect the running of update.php.

File

pmperson/includes/pmperson.migrate.inc, line 120
Migration functions for the PM Person module.

Code

function pmperson_migrate_email_missmatch_count() {
  $results = db_query(" SELECT pm.nid FROM {pmperson} as pm\n                        LEFT JOIN {users} as u\n                        ON pm.user_uid = u.uid\n                        WHERE pm.email <> u.mail AND u.mail <> ''");
  $count = $results
    ->rowCount();
  $results = db_query(" SELECT pm.nid FROM {pmperson} as pm\n                        LEFT JOIN {users} as u\n                        ON pm.user_uid <> u.uid\n                        WHERE pm.email = u.mail AND pm.user_uid = '0'");
  $count += $results
    ->rowCount();
  return $count;
}