Results 1 to 2 of 2

Thread: webtolead form - different user assignment

  1. #1
    sugarcrm.new is offline Junior Member
    Join Date
    Dec 2008
    Posts
    2

    Default webtolead form - different user assignment

    Hello,
    My customer sells different IT services. He wants to put the different ITservices as a dropdown
    in the lead capture form. Based on the drop down, the lead should be assigned to different user/groups.

    Thanks

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: webtolead form - different user assignment

    If you're asking if it's possible, yes it is. We do almost the exact same thing. We'll post which user to assign it from our corporate site with the following code:
    PHP Code:
        $postfields "user=$sugar_user"
                     
    ."&auth_user=leads_capture" /** [eggsurplus] general leads capture user for authenticating */
                     
    ."&first_name=".urlencode($icu_firstname)
                     .
    "&last_name=".urlencode($icu_lastname)
                     .
    "&email1=".urlencode($icu_email)
                     .
    "&title=".urlencode($icu_title)
                     .
    "&phone_work=".urlencode($icu_phone)
                     .
    "&account_name=".urlencode($account)
                     .
    "&primary_address_street=".urlencode($icu_address)
                     .
    "&primary_address_city=".urlencode($icu_city)
                     .
    "&primary_address_state=".urlencode($icu_state)
                     .
    "&primary_address_postalcode=".urlencode($icu_zip)
                     .
    "&lead_source=".urlencode("Web Site")
                     .
    "&lead_source_description=".urlencode("From website")
                     .
    "&existing_customer_c=".urlencode($existing_customer)
                     .
    "&description=".urlencode($email_body);
                     
        
    $sugar_url SUGAR_URL."/leadCapture.php";
        
    $session curl_init();
        
    curl_setopt($sessionCURLOPT_URL$sugar_url); 
        
    curl_setopt ($sessionCURLOPT_POST1); 
        
    curl_setopt ($sessionCURLOPT_POSTFIELDS$postfields); 
        
    curl_setopt($sessionCURLOPT_RETURNTRANSFERtrue);

        
    $response curl_exec($session);
        
    curl_close($session); 
    We created a user in Sugar called leads_capture, gave it the rights it needed, then altered the $users array in leadCapture_override.php to look like:

    PHP Code:
    $users = array(
            
    'leads_capture' => array('name'=>'leads_capture','pass'=>'ENTERUSERHASHHERE'),
    ); 
    We then altered (which is NOT upgrade safe but we have a process in place to handle that) modules/Leads/Capture.php (actually leadCapture.php since we're still in 5.0.x) and changed this code:
    PHP Code:
    if (!empty($_POST['user']) && !empty($users[$_POST['user']])) {
        require_once(
    'modules/Users/User.php');
        
    $current_user = new User();
        
    $current_user->user_name $users[$_POST['user']]['name'];

        if(
    $current_user->authenticate_user($users[$_POST['user']]['pass'])){
            
    $userid $current_user->retrieve_user_id($users[$_REQUEST['user']]['name']); 
    to

    PHP Code:
    if (!empty($_POST['auth_user']) && !empty($users[$_POST['auth_user']])) { /** [eggsurplus] change to auth_user */
        
    require_once('modules/Users/User.php');
        
    $current_user = new User();
        
    $current_user->user_name $users[$_POST['auth_user']]['name']; /** [eggsurplus] change to auth_user */

        
    if($current_user->authenticate_user($users[$_POST['auth_user']]['pass'])){
            
    $userid $current_user->retrieve_user_id($_POST['user']); /** [eggsurplus] change to $_POST['user'] */ 
    If you're getting paid for this customization in good conscience you should really forward that payment to my account

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 2008-07-17, 07:05 PM
  2. WebtoLead Form - create a Contact not Lead
    By southwestcrm in forum Help
    Replies: 1
    Last Post: 2008-05-30, 07:36 PM
  3. Replies: 2
    Last Post: 2008-02-07, 05:53 PM
  4. Replies: 2
    Last Post: 2007-04-17, 02:46 PM
  5. Replies: 10
    Last Post: 2006-03-28, 03:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •