Results 1 to 7 of 7

Thread: How to get the user logged??

  1. #1
    fedepia is offline Sugar Community Member
    Join Date
    Aug 2007
    Location
    Rosario, Argentina
    Posts
    104

    Question How to get the user logged??

    Hello, does anybody know how I can do a login using the sugar webservices using the sugar user logged?
    I need to know who is the user logged. Is there any way using the sugarbean?
    __
    Federico Piazza
    Developer
    Argentina

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: How to get the user logged??

    Hi Federico

    Your needs is not so clear.
    Can you explain in details what you are meaning to do?

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    fedepia is offline Sugar Community Member
    Join Date
    Aug 2007
    Location
    Rosario, Argentina
    Posts
    104

    Default Re: How to get the user logged??

    hi, andopes.
    I'm using sugar 5.0.0d and I've installed the enhancedStudio module to it. This module adds a new type of field named 'code'. In this code field, we can add php code, so we can access to the sugarbean of the specific module.

    For example, if we add a custom field of code type to the detailview of contact, and we put to it the following code:
    echo "The contact name is: " . $bean->name;
    then, when we access to detailview of a contact, we will see in the field that we've added the message "The contact name is John Doe"

    My question is, how can I get the user logged to sugar? Can I do this using a sugarbean? Is there any session variable that saves the user logged?

    Thanks for your time

    cheers
    __
    Federico Piazza
    Developer
    Argentina

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: How to get the user logged??

    Hi Federico

    Contact directly the Enhanced Studio developer.
    He can easily answer that question.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  5. #5
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: How to get the user logged??

    The current user is stored in $current_user, after a global statement you have full access.


    global $current_user;
    $userid = $current_user->id;

    Some example fields that a accessable:

    [name] => Administrator
    [full_name] => Administrator
    [id] => 1
    [user_name] => admin
    [user_hash] => b8c25af11984801275dec87d8d481532
    [salutation] =>
    [first_name] =>
    [last_name] => Administrator
    [date_entered] => 05.06.2008 21:57
    [date_modified] => 05.06.2008 21:57
    [modified_user_id] => 1
    [created_by] =>
    [created_by_name] =>
    [modified_by_name] =>
    [description] =>
    [phone_home] =>
    [phone_mobile] =>
    [phone_work] =>
    [phone_other] =>
    [phone_fax] =>
    [email1] =>
    [email2] =>
    [address_street] =>
    [address_city] =>
    [address_state] =>
    [address_postalcode] =>
    [address_country] =>
    [status] => Active
    [title] => Administrator
    [portal_only] => 0
    [department] =>
    [authenticated] =>
    [error_string] =>
    [is_admin] => 1
    [employee_status] =>
    [messenger_id] =>
    [messenger_type] =>
    [is_group] => 0
    [accept_status] =>
    [receive_notifications] => 1
    [reports_to_name] =>
    [reports_to_id] =>
    Last edited by kuske; 2008-09-18 at 07:49 PM.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  6. #6
    fedepia is offline Sugar Community Member
    Join Date
    Aug 2007
    Location
    Rosario, Argentina
    Posts
    104

    Default Re: How to get the user logged??

    hello kuske, thanks for your detailed answer, it is great to know that.
    I take to ask you, how can I do to know all the field that I can access?
    thank you very much for your help
    __
    Federico Piazza
    Developer
    Argentina

  7. #7
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: How to get the user logged??

    just write a

    global $current_user;
    $GLOBALS['log']->fatal(print_r($current_user,true));

    anywhere in a module and you will see the whole current_user entry in the logfile.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 2008-08-01, 12:48 AM
  2. Replies: 0
    Last Post: 2007-09-14, 09:27 AM
  3. Replies: 0
    Last Post: 2007-07-11, 11:18 AM
  4. Cannot Login
    By Dillon in forum Help
    Replies: 16
    Last Post: 2004-10-13, 02:52 AM

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
  •