Пример #1
0
function SearchContactsByEmail($username, $password, $emailaddress)
{
    if (authentication($username, $password)) {
        require_once 'modules/Contacts/Contacts.php';
        $seed_contact = new Contacts();
        $output_list = array();
        $response = $seed_contact->get_searchbyemailid($username, $emailaddress);
        $contactList = $response['list'];
        // create a return array of names and email addresses.
        foreach ($contactList as $contact) {
            $output_list[] = array("id" => decode_html($contact[contactid]), "firstname" => decode_html($contact[firstname]), "lastname" => decode_html($contact[lastname]), "emailaddress" => decode_html($contact[email]), "accountname" => decode_html($contact[accountname]));
        }
        //to remove an erroneous compiler warning
        $seed_contact = $seed_contact;
        return $output_list;
    }
}
Пример #2
0
function SearchContactsByEmail($username, $session, $emailaddress)
{
    if (!validateSession($username, $session)) {
        return null;
    }
    require_once 'modules/Contacts/Contacts.php';
    require_once 'modules/Leads/Leads.php';
    require_once 'modules/Accounts/Accounts.php';
    $seed_contact = new Contacts();
    $output_list = array();
    //To avoid Blind SQL injection we are validating the Email address.
    if (filter_var($emailaddress, FILTER_VALIDATE_EMAIL) == false) {
        return null;
    }
    $response = $seed_contact->get_searchbyemailid($username, $emailaddress);
    $contactList = $response['list'];
    // create a return array of names and email addresses.
    foreach ($contactList as $contact) {
        $output_list[] = array("id" => $contact[contactid], "firstname" => decode_html($contact[firstname]), "lastname" => decode_html($contact[lastname]), "accountname" => decode_html($contact[accountname]), "emailaddress" => decode_html($contact[email]), "category" => "Contact");
    }
    // crm-now added Lead functionality
    $seed_lead = new Leads();
    $response2 = $seed_lead->get_searchbyemailid($username, $emailaddress);
    $leadList = $response2['list'];
    foreach ($leadList as $lead) {
        $output_list[] = array("id" => $lead[leadid], "firstname" => decode_html($lead[firstname]), "lastname" => decode_html($lead[lastname]), "accountname" => decode_html($lead[company]), "emailaddress" => decode_html($lead[email]), "category" => "Lead");
    }
    // crm-now added Accounts functionality
    $acc_lead = new Accounts();
    $response3 = $acc_lead->get_searchbyemailid($username, $emailaddress);
    $accList = $response3['list'];
    foreach ($accList as $acc) {
        $output_list[] = array("id" => $acc['accountid'], "firstname" => decode_html($acc['account_no']), "lastname" => decode_html($acc['accountname']), "accountname" => '', "emailaddress" => decode_html($acc['email1']), "category" => "Account");
    }
    // end crm-now
    //to remove an erroneous compiler warning
    $seed_contact = $seed_contact;
    $seed_lead = $seed_lead;
    $acc_lead = $acc_lead;
    return $output_list;
}
Пример #3
0
function SearchContactsByEmail($username, $session, $emailaddress)
{
    if (!validateSession($username, $session)) {
        return null;
    }
    require_once 'modules/Contacts/Contacts.php';
    $seed_contact = new Contacts();
    $output_list = array();
    //To avoid Blind SQL injection we are validating the Email address.
    if (filter_var($emailaddress, FILTER_VALIDATE_EMAIL) == false) {
        return null;
    }
    $response = $seed_contact->get_searchbyemailid($username, $emailaddress);
    $contactList = $response['list'];
    // create a return array of names and email addresses.
    foreach ($contactList as $contact) {
        $output_list[] = array("id" => $contact[contactid], "firstname" => decode_html($contact[firstname]), "lastname" => decode_html($contact[lastname]), "accountname" => decode_html($contact[accountname]), "emailaddress" => decode_html($contact[email]));
    }
    //to remove an erroneous compiler warning
    $seed_contact = $seed_contact;
    return $output_list;
}