function db_get_user_id_from_email

6.x db.inc db_get_user_id_from_email($email, $type = "faculty")
2 calls to db_get_user_id_from_email()
engagements_imap_get_all_received_messages in modules/engagements/engagements.module
Connect to our imap server, download all received messages from students (or others). We will then delete them, so they don't get read twice.
engagements_mass_sms_perform_batch_operation in modules/engagements/engagements.module

File

includes/db.inc, line 556
This file contains mostly db shortcuts.

Code

function db_get_user_id_from_email($email, $type = "faculty") {

  $type_line = " is_faculty='1' ";
  if ($type == "student") {
    $type_line = " is_student='1' ";
  }

  // Force email to be lowercase
  $email = trim(strtolower($email));

  $user_id = db_result(db_query("SELECT user_id FROM users WHERE email = ? AND $type_line ", $email));

  if ($user_id) {
    return $user_id;
  }

  return FALSE;

}