2 if(!defined('sugarEntry'))define('sugarEntry', true);
3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
39 // the types/methods defined in this file are deprecated -- please see SoapSugarUsers.php, SoapPortalUsers.php, SoapStudio.php, etc.
41 $server->wsdl->addComplexType(
48 'email_address' => array('name'=>'email_address','type'=>'xsd:string'),
49 'name1' => array('name'=>'name1','type'=>'xsd:string'),
50 'name2' => array('name'=>'name2','type'=>'xsd:string'),
51 'association' => array('name'=>'association','type'=>'xsd:string'),
52 'id' => array('name'=>'id','type'=>'xsd:string'),
53 'msi_id' => array('name'=>'id','type'=>'xsd:string'),
54 'type' => array('name'=>'type','type'=>'xsd:string'),
58 $server->wsdl->addComplexType(
59 'contact_detail_array',
66 array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:contact_detail[]')
71 $server->wsdl->addComplexType(
78 'email_address' => array('name'=>'email_address','type'=>'xsd:string'),
79 'user_name' => array('name'=>'user_name', 'type'=>'xsd:string'),
80 'first_name' => array('name'=>'first_name','type'=>'xsd:string'),
81 'last_name' => array('name'=>'last_name','type'=>'xsd:string'),
82 'department' => array('name'=>'department','type'=>'xsd:string'),
83 'id' => array('name'=>'id','type'=>'xsd:string'),
84 'title' => array('name'=>'title','type'=>'xsd:string'),
88 $server->wsdl->addComplexType(
96 array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:user_detail[]')
104 array('user_name'=>'xsd:string','password'=>'xsd:string'),
105 array('return'=>'xsd:string'),
110 array('user_name'=>'xsd:string'),
111 array('return'=>'xsd:string'),
116 array('user_name'=>'xsd:string','password'=>'xsd:string', 'email_address'=>'xsd:string'),
117 array('return'=>'tns:contact_detail_array'),
121 'get_contact_relationships',
122 array('user_name'=>'xsd:string','password'=>'xsd:string', 'id'=>'xsd:string'),
123 array('return'=>'tns:contact_detail_array'),
128 array('user_name'=>'xsd:string','password'=>'xsd:string'),
129 array('return'=>'tns:user_detail_array'),
134 array('user_name'=>'xsd:string','password'=>'xsd:string', 'name'=>'xsd:string'),
135 array('return'=>'tns:contact_detail_array'),
140 array('user_name'=>'xsd:string','password'=>'xsd:string','parent_id'=>'xsd:string', 'contact_ids'=>'xsd:string', 'date_sent'=>'xsd:date', 'email_subject'=>'xsd:string', 'email_body'=>'xsd:string'),
141 array('return'=>'xsd:string'),
146 array('user_name'=>'xsd:string','password'=>'xsd:string', 'first_name'=>'xsd:string', 'last_name'=>'xsd:string', 'email_address'=>'xsd:string'),
147 array('return'=>'xsd:string'),
151 array('user_name'=>'xsd:string','password'=>'xsd:string', 'first_name'=>'xsd:string', 'last_name'=>'xsd:string', 'email_address'=>'xsd:string'),
152 array('return'=>'xsd:string'),
156 array('user_name'=>'xsd:string','password'=>'xsd:string', 'name'=>'xsd:string', 'phone'=>'xsd:string', 'website'=>'xsd:string'),
157 array('return'=>'xsd:string'),
161 'create_opportunity',
162 array('user_name'=>'xsd:string','password'=>'xsd:string', 'name'=>'xsd:string', 'amount'=>'xsd:string'),
163 array('return'=>'xsd:string'),
168 array('user_name'=>'xsd:string','password'=>'xsd:string', 'name'=>'xsd:string'),
169 array('return'=>'xsd:string'),
172 * Create a new session. This method is required before calling any other functions.
174 * @param string $user_name -- the user name for the session
175 * @param string $password -- MD5 of user password
176 * @return "Success" if the session is created
177 * @return "Failed" if the session creation failed.
179 function create_session($user_name, $password)
181 if(validate_user($user_name, $password))
190 * End a session. This method will end the SOAP session.
192 * @param string $user_name -- the user name for the session
193 * @return "Success" if the session is destroyed
194 * @return "Failed" if the session destruction failed.
196 function end_session($user_name)
198 // get around optimizer warning
199 $user_name = $user_name;
204 * Validate the user session based on user name and password hash.
206 * @param string $user_name -- The user name to create a session for
207 * @param string $password -- The MD5 sum of the user's password
208 * @return true -- If the session is created
209 * @return false -- If the session is not created
211 function validate_user($user_name, $password){
212 global $server, $current_user, $sugar_config, $system_config;
214 $user->user_name = $user_name;
215 $system_config = new Administration();
216 $system_config->retrieveSettings('system');
217 $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate'));
218 // Check to see if the user name and password are consistent.
219 if($user->authenticate_user($password)){
220 // we also need to set the current_user.
221 $user->retrieve($user->id);
222 $current_user = $user;
225 }else if(function_exists('mcrypt_cbc')){
226 $password = decrypt_string($password);
227 if($authController->login($user_name, $password) && isset($_SESSION['authenticated_user_id'])){
228 $user->retrieve($_SESSION['authenticated_user_id']);
229 $current_user = $user;
234 $GLOBALS['log']->fatal("SECURITY: failed attempted login for $user_name using SOAP api");
235 $server->setError("Invalid username and/or password");
242 * Internal: When building a response to the plug-in for Microsoft Outlook, find
243 * all contacts that match the email address that was provided.
245 * @param array by ref $output_list -- The list of matching beans. New contacts that match
246 * the email address are appended to the $output_list
247 * @param string $email_address -- an email address to search for
248 * @param Contact $seed_contact -- A template SugarBean. This is a blank Contact
249 * @param ID $msi_id -- Index Count
251 function add_contacts_matching_email_address(&$output_list, $email_address, &$seed_contact, &$msi_id)
253 // escape the email address
254 $safe_email_address = addslashes($email_address);
255 global $current_user;
257 // Verify that the user has permission to see Contact list views
258 if(!$seed_contact->ACLAccess('ListView'))
263 $contactList = $seed_contact->emailAddress->getBeansByEmailAddress($safe_email_address);
264 // create a return array of names and email addresses.
265 foreach($contactList as $contact)
267 if (!is_a($contact, 'Contact')) continue;
269 $output_list[] = Array("name1" => $contact->first_name,
270 "name2" => $contact->last_name,
271 "association" => $contact->account_name,
273 "id" => $contact->id,
275 "email_address" => $contact->email1);
277 $accounts = $contact->get_linked_beans('accounts','Account');
278 foreach($accounts as $account)
280 $output_list[] = get_account_array($account, $msi_id);
283 $opps = $contact->get_linked_beans('opportunities','Opportunity');
284 foreach($opps as $opp)
286 $output_list[] = get_opportunity_array($opp, $msi_id);
289 $cases = $contact->get_linked_beans('cases','aCase');
290 foreach($cases as $case)
292 $output_list[] = get_case_array($case, $msi_id);
295 $bugs = $contact->get_linked_beans('bugs','Bug');
296 foreach($bugs as $bug)
298 $output_list[] = get_bean_array($bug, $msi_id, 'Bug');
301 $projects = $contact->get_linked_beans('project','Project');
302 foreach($projects as $project)
304 $output_list[] = get_bean_array($project, $msi_id, 'Project');
307 $msi_id = $msi_id + 1;
311 * Internal: Add Leads that match the specified email address to the result array
313 * @param Array $output_list -- List of matching detail records
314 * @param String $email_address -- Email address
315 * @param Bean $seed_lead -- Seed Lead Bean
316 * @param int $msi_id -- output array offset.
318 function add_leads_matching_email_address(&$output_list, $email_address, &$seed_lead, &$msi_id)
320 $safe_email_address = $GLOBALS['db']->quote($email_address);
321 if(!$seed_lead->ACLAccess('ListView')){
325 $leadList = $seed_lead->emailAddress->getBeansByEmailAddress($safe_email_address);
327 // create a return array of names and email addresses.
328 foreach($leadList as $lead)
330 if (!is_a($lead, 'Lead')) continue;
332 $output_list[] = Array("name1" => $lead->first_name,
333 "name2" => $lead->last_name,
334 "association" => $lead->account_name,
338 "email_address" => $lead->email1);
340 $msi_id = $msi_id + 1;
344 * Return a list of modules related to the specifed contact record
346 * This function does not require a session be created first.
348 * @param string $user_name -- User name to authenticate with
349 * @param string $password -- MD5 of the user password
350 * @param string $id -- the id of the record
351 * @return contact detail array along with associated objects.
353 function get_contact_relationships($user_name, $password, $id)
355 if(!validate_user($user_name, $password)){
359 $seed_contact = new Contact();
360 // Verify that the user has permission to see Contact list views
361 if(!$seed_contact->ACLAccess('ListView'))
367 $seed_contact->retrieve($id);
369 $output_list[] = Array("name1" => $seed_contact->first_name,
370 "name2" => $seed_contact->last_name,
371 "association" => $seed_contact->account_name,
373 "id" => $seed_contact->id,
375 "email_address" => $seed_contact->email1);
377 $accounts = $seed_contact->get_linked_beans('accounts','Account');
378 foreach($accounts as $account)
380 $output_list[] = get_account_array($account, $msi_id);
383 $opps = $seed_contact->get_linked_beans('opportunities','Opportunity');
384 foreach($opps as $opp)
386 $output_list[] = get_opportunity_array($opp, $msi_id);
389 $cases = $seed_contact->get_linked_beans('cases','aCase');
390 foreach($cases as $case)
392 $output_list[] = get_case_array($case, $msi_id);
395 $bugs = $seed_contact->get_linked_beans('bugs','Bug');
396 foreach($bugs as $bug)
398 $output_list[] = get_bean_array($bug, $msi_id, 'Bug');
401 $projects = $seed_contact->get_linked_beans('project','Project');
402 foreach($projects as $project)
404 $output_list[] = get_bean_array($project, $msi_id, 'Project');
409 // Define a global current user
410 $current_user = null;
413 * Return a list of contact and lead detail records based on a single email
414 * address or a list of email addresses separated by '; '.
416 * This function does not require a session be created first.
418 * @param string $user_name -- User name to authenticate with
419 * @param string $password -- MD5 of the user password
420 * @param string $email_address -- Single email address or '; ' separated list of email addresses (e.x "test@example.com; test2@example.com"
421 * @return contact detail array along with associated objects.
423 function contact_by_email($user_name, $password, $email_address)
425 if(!validate_user($user_name, $password)){
429 $seed_contact = new Contact();
430 $seed_lead = new Lead();
431 $output_list = Array();
432 $email_address_list = explode("; ", $email_address);
434 // remove duplicate email addresses
435 $non_duplicate_email_address_list = Array();
436 foreach( $email_address_list as $single_address)
438 // Check to see if the current address is a match of an existing address
439 $found_match = false;
440 foreach( $non_duplicate_email_address_list as $non_dupe_single)
442 if(strtolower($single_address) == $non_dupe_single)
449 if($found_match == false)
451 $non_duplicate_email_address_list[] = strtolower($single_address);
455 // now copy over the non-duplicated list as the original list.
456 $email_address_list =$non_duplicate_email_address_list;
461 foreach( $email_address_list as $single_address)
463 // verify that contacts can be listed
464 if($seed_contact->ACLAccess('ListView')){
465 add_contacts_matching_email_address($output_list, $single_address, $seed_contact, $msi_id);
467 // verify that leads can be listed
468 if($seed_lead->ACLAccess('ListView')){
469 add_leads_matching_email_address($output_list, $single_address, $seed_lead, $msi_id);
477 * Internal: convert a bean into an array
479 * @param Bean $bean -- The bean to convert
480 * @param int $msi_id -- Russult array index
481 * @return An associated array containing the detail fields.
483 function get_contact_array($contact, $msi_id = '0'){
484 $contact->emailAddress->handleLegacyRetrieve($contact);
485 return Array("name1" => $contact->first_name,
486 "name2" => $contact->last_name,
487 "association" => $contact->account_name,
489 "id" => $contact->id,
491 "email_address" => $contact->email1);
496 * Internal: Convert a user into an array
498 * @param User $user -- The user to convert
499 * @return An associated array containing the detail fields.
501 function get_user_list_array($user) {
502 return Array('email_address' => $user->email1,
503 'user_name' => $user->user_name,
504 'first_name' => $user->first_name,
505 'last_name' => $user->last_name,
506 'department' => $user->department,
508 'title' => $user->title);
512 * Get a full user list.
514 * This function does not require a session be created first.
516 * @param string $user -- user name for validation
517 * @param password $password -- MD5 hash of the user password for validation
518 * @return User Array -- An array of user detail records
520 function user_list($user, $password) {
521 if(!validate_user($user, $password)){
525 $seed_user = new User();
526 $output_list = Array();
527 if(!$seed_user->ACLAccess('ListView')){
530 $userList = $seed_user->get_full_list();
533 foreach($userList as $user) {
534 $output_list[] = get_user_list_array($user);
541 * Internal: Search for contacts based on the specified name and where clause.
542 * Currently only the name is used.
544 * @param string $name -- Name to search for.
545 * @param string $where -- Where clause defaults to ''
546 * @param int $msi_id -- Response array index
547 * @return array -- Resturns a list of contacts that have the provided name.
549 function contact_by_search($name, $where = '', $msi_id = '0')
551 $seed_contact = new Contact();
553 $where = $seed_contact->build_generic_where_clause($name);
555 if(!$seed_contact->ACLAccess('ListView')){
558 $response = $seed_contact->get_list("last_name, first_name", $where, 0);
559 $contactList = $response['list'];
561 $output_list = Array();
563 // create a return array of names and email addresses.
564 foreach($contactList as $contact)
566 $output_list[] = get_contact_array($contact, $msi_id);
571 * Internal: convert a bean into an array
573 * @param Bean $bean -- The bean to convert
574 * @param int $msi_id -- Russult array index
575 * @return An associated array containing the detail fields.
577 function get_lead_array($lead, $msi_id = '0'){
578 $lead->emailAddress->handleLegacyRetrieve($lead);
579 return Array("name1" => $lead->first_name,
580 "name2" => $lead->last_name,
581 "association" => $lead->account_name,
585 "email_address" => $lead->email1);
588 function lead_by_search($name, $where = '', $msi_id = '0')
590 $seed_lead = new Lead();
592 $where = $seed_lead->build_generic_where_clause($name);
594 if(!$seed_lead->ACLAccess('ListView')){
597 $response = $seed_lead->get_list("last_name, first_name", $where, 0);
598 $lead_list = $response['list'];
600 $output_list = Array();
602 // create a return array of names and email addresses.
603 foreach($lead_list as $lead)
605 $output_list[] = get_lead_array($lead, $msi_id);
610 * Internal: convert a bean into an array
612 * @param Bean $bean -- The bean to convert
613 * @param int $msi_id -- Russult array index
614 * @return An associated array containing the detail fields.
616 function get_account_array($account, $msi_id){
617 return Array("name1" => '',
618 "name2" => $account->name,
619 "association" => $account->billing_address_city,
621 "id" => $account->id,
623 "email_address" => $account->email1);
626 function account_by_search($name, $where = '', $msi_id = '0')
628 $seed_account = new Account();
629 if(!$seed_account->ACLAccess('ListView')){
633 $where = $seed_account->build_generic_where_clause($name);
635 $response = $seed_account->get_list("name", $where, 0);
636 $accountList = $response['list'];
638 $output_list = Array();
640 // create a return array of names and email addresses.
641 foreach($accountList as $account)
643 $output_list[] = get_account_array($account, $msi_id);
649 * Internal: convert a bean into an array
651 * @param Bean $bean -- The bean to convert
652 * @param int $msi_id -- Russult array index
653 * @return An associated array containing the detail fields.
655 function get_opportunity_array($value, $msi_id = '0'){
656 return Array("name1" => '',
657 "name2" => $value->name,
658 "association" => $value->account_name,
659 "type" => 'Opportunity',
662 "email_address" => '');
666 function opportunity_by_search($name, $where = '', $msi_id = '0')
668 $seed = new Opportunity();
669 if(!$seed->ACLAccess('ListView')){
673 $where = $seed->build_generic_where_clause($name);
675 $response = $seed->get_list("name", $where, 0);
676 $list = $response['list'];
678 $output_list = Array();
680 // create a return array of names and email addresses.
681 foreach($list as $value)
683 $output_list[] = get_opportunity_array($value, $msi_id);
689 * Internal: convert a bean into an array
691 * @param Bean $bean -- The bean to convert
692 * @param int $msi_id -- Russult array index
693 * @return An associated array containing the detail fields.
695 function get_bean_array($value, $msi_id, $type){
696 return Array("name1" => '',
697 "name2" => $value->get_summary_text(),
702 "email_address" => '');
706 * Internal: convert a bean into an array
708 * @param Bean $bean -- The bean to convert
709 * @param int $msi_id -- Russult array index
710 * @return An associated array containing the detail fields.
712 function get_case_array($value, $msi_id){
713 return Array("name1" => '',
714 "name2" => $value->get_summary_text(),
715 "association" => $value->account_name,
719 "email_address" => '');
723 function bug_by_search($name, $where = '', $msi_id='0')
726 if(!$seed->ACLAccess('ListView')){
730 $where = $seed->build_generic_where_clause($name);
732 $response = $seed->get_list("name", $where, 0);
733 $list = $response['list'];
735 $output_list = Array();
737 // create a return array of names and email addresses.
738 foreach($list as $value)
740 $output_list[] = get_bean_array($value, $msi_id, 'Bug');
745 function case_by_search($name, $where = '', $msi_id='0')
748 if(!$seed->ACLAccess('ListView')){
752 $where = $seed->build_generic_where_clause($name);
754 $response = $seed->get_list("name", $where, 0);
755 $list = $response['list'];
757 $output_list = Array();
759 // create a return array of names and email addresses.
760 foreach($list as $value)
762 $output_list[] = get_case_array($value, $msi_id);
767 * Record and email message and associated it with the specified parent bean and contact ids.
769 * This function does not require a session be created first.
771 * @param string $user_name -- Name of the user to authenticate
772 * @param string $password -- MD5 hash of the user password for authentication
773 * @param id $parent_id -- [optional] The parent record to link the email to.
774 * @param unknown_type $contact_ids
775 * @param string $date_sent -- Date/time the email was sent in Visual Basic Date format. (e.g. '7/22/2004 9:36:31 AM')
776 * @param string $email_subject -- The subject of the email
777 * @param string $email_body -- The body of the email
778 * @return "Invalid username and/or password"
779 * @return -1 If the authenticated user does not have ACL access to save Email.
781 function track_email($user_name, $password,$parent_id, $contact_ids, $date_sent, $email_subject, $email_body)
783 if(!validate_user($user_name, $password)){
784 return "Invalid username and/or password";
786 global $current_user;
788 $GLOBALS['log']->info("In track email: username: $user_name contacts: $contact_ids date_sent: $date_sent");
790 // translate date sent from VB format 7/22/2004 9:36:31 AM
791 // to yyyy-mm-dd 9:36:31 AM
793 $date_sent = preg_replace("@([0-9]*)/([0-9]*)/([0-9]*)( .*$)@", "\\3-\\1-\\2\\4", $date_sent);
796 $seed_user = new User();
798 $user_id = $seed_user->retrieve_user_id($user_name);
799 $seed_user->retrieve($user_id);
800 $current_user = $seed_user;
803 $email = new Email();
804 if(!$email->ACLAccess('Save')){
807 $email->description = $email_body;
808 $email->name = $email_subject;
809 $email->user_id = $user_id;
810 $email->assigned_user_id = $user_id;
811 $email->assigned_user_name = $user_name;
812 $email->date_start = $date_sent;
814 // Save one copy of the email message
815 $parent_id_list = explode(";", $parent_id);
816 $parent_id = explode(':', $parent_id_list[0]);
818 // Having a parent object is optional. If it is set, then associate it.
819 if(isset($parent_id[0]) && isset($parent_id[1]))
821 $email->parent_type = $parent_id[0];
822 $email->parent_id = $parent_id[1];
826 // for each contact, add a link between the contact and the email message
827 $id_list = explode(";", $contact_ids);
829 foreach( $id_list as $id)
832 $email->set_emails_contact_invitee_relationship($email->id, $GLOBALS['db']->quote($id));
839 function create_contact($user_name,$password, $first_name, $last_name, $email_address)
841 if(!validate_user($user_name, $password)){
846 $seed_user = new User();
847 $user_id = $seed_user->retrieve_user_id($user_name);
848 $seed_user->retrieve($user_id);
851 $contact = new Contact();
852 if(!$contact->ACLAccess('Save')){
855 $contact->first_name = $first_name;
856 $contact->last_name = $last_name;
857 $contact->email1 = $email_address;
858 $contact->assigned_user_id = $user_id;
859 $contact->assigned_user_name = $user_name;
860 return $contact->save();
862 function create_lead($user_name,$password, $first_name, $last_name, $email_address)
864 if(!validate_user($user_name, $password)){
868 //todo make the activity body not be html encoded
871 $seed_user = new User();
872 $user_id = $seed_user->retrieve_user_id($user_name);
876 if(!$lead->ACLAccess('Save')){
879 $lead->first_name = $first_name;
880 $lead->last_name = $last_name;
881 $lead->email1 = $email_address;
882 $lead->assigned_user_id = $user_id;
883 $lead->assigned_user_name = $user_name;
884 return $lead->save();
886 function create_account($user_name,$password, $name, $phone, $website)
888 if(!validate_user($user_name, $password)){
892 //todo make the activity body not be html encoded
895 $seed_user = new User();
896 $user_id = $seed_user->retrieve_user_id($user_name);
897 $account = new Account();
898 if(!$account->ACLAccess('Save')){
901 $account->name = $name;
902 $account->phone_office = $phone;
903 $account->website = $website;
904 $account->assigned_user_id = $user_id;
905 $account->assigned_user_name = $user_name;
910 function create_case($user_name,$password, $name)
912 if(!validate_user($user_name, $password)){
916 //todo make the activity body not be html encoded
919 $seed_user = new User();
920 $user_id = $seed_user->retrieve_user_id($user_name);
922 if(!$case->ACLAccess('Save')){
925 $case->assigned_user_id = $user_id;
926 $case->assigned_user_name = $user_name;
928 return $case->save();
930 function create_opportunity($user_name,$password, $name, $amount)
932 if(!validate_user($user_name, $password)){
937 $seed_user = new User();
938 $user_id = $seed_user->retrieve_user_id($user_name);
939 $opp = new Opportunity();
940 if(!$opp->ACLAccess('Save')){
944 $opp->amount = $amount;
945 $opp->assigned_user_id = $user_id;
946 $opp->assigned_user_name = $user_name;
950 function search($user_name, $password,$name){
951 if(!validate_user($user_name, $password)){
954 $name_list = explode("; ", $name);
956 foreach( $name_list as $single_name)
958 $list = array_merge($list, contact_by_search($single_name));
959 $list = array_merge($list, lead_by_search($single_name));
960 $list = array_merge($list, account_by_search($single_name));
961 $list = array_merge($list, case_by_search($single_name));
962 $list = array_merge($list, opportunity_by_search($single_name));
963 $list = array_merge($list, bug_by_search($single_name));