Results 1 to 6 of 6

Thread: Get Current User Password

  1. #1
    jlabuelo is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    426

    Default Get Current User Password

    Hi there

    I need to inlude a link to connect SugarCRM with another web application we have. Login and Password are the same in both systems.

    What I do in the link is to send a POST method with two variables, login & password where I should include the current user login and password.

    I know that to get the current user login I can use the variable $current_user->user_name.... but how can I get the password to be send also in this post call?. Is it possible to get it like $current_user->password???.... if so what is the right syntax?.

    If not where I can look for the password (tables, files...)?.... Will it be encrypted?, if so how can I recober it?

    Thanks a lot guys!!

  2. #2
    christianknoll's Avatar
    christianknoll is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Vienna
    Posts
    939

    Default Re: Get Current User Password

    You cannot recover it. Sugar properly stores the MD5 of the password in the user_hash field of the table users. Read that and pass it to the other application. In that application accept this as a MD5 hash and compare the MD5 hashes there.

    christian.

    Quote Originally Posted by jlabuelo View Post
    Hi there

    I need to inlude a link to connect SugarCRM with another web application we have. Login and Password are the same in both systems.

    What I do in the link is to send a POST method with two variables, login & password where I should include the current user login and password.

    I know that to get the current user login I can use the variable $current_user->user_name.... but how can I get the password to be send also in this post call?. Is it possible to get it like $current_user->password???.... if so what is the right syntax?.

    If not where I can look for the password (tables, files...)?.... Will it be encrypted?, if so how can I recober it?

    Thanks a lot guys!!

  3. #3
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Get Current User Password

    Yes, user password is not possible to be recovered by the explanations above. Sugar do not keep it, just the hash code.

    What I recommend you do do, is to create one user just to make this comunication with your external system (or use your admin user). Then you could use the current user id to paramerize some access rights rules.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  4. #4
    jlabuelo is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    426

    Default Re: Get Current User Password

    Hi Rafael

    Thanks for the answer, I think we are gonna synchronize the systems using LDAP so I will have to figure out how to do it this way.

    Cheers

  5. #5
    montolla's Avatar
    montolla is offline Sugar Community Member
    Join Date
    Sep 2011
    Location
    Medellin, Colombia
    Posts
    49

    Default Re: Get Current User Password

    Helo every body.

    I am "customing" a module, but I need to know the user name and password (md5 it works for me) of the current user, how can I know it?, I am using SUGARCRM CE 6.1.6 and PHP 5.2.x


    Too much thanks.

  6. #6
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Get Current User Password

    The md5 hash of the password is in the user_hash field in the users table. Retrieve that via the API call get_entry() and you are set.

    As for the original problem, you might want to consider doing it the other way around, i.e. login to the other system first and use the seamless_login() option on the Sugar API to then establish a connection to Sugar. You can redirect them to the Sugar URL afterwards if you like too.
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Get the ID of the current logged in user
    By chrislynch8 in forum Help
    Replies: 17
    Last Post: 2010-11-12, 08:17 AM
  2. Current user
    By junie in forum Developer Help
    Replies: 2
    Last Post: 2009-08-14, 10:57 AM
  3. Email Current User
    By Niggy in forum Developer Help
    Replies: 2
    Last Post: 2009-03-17, 02:22 PM
  4. information current user
    By dacco in forum Developer Help
    Replies: 1
    Last Post: 2008-07-29, 04:31 PM
  5. How to get the current user name ?
    By Heilong in forum Help
    Replies: 1
    Last Post: 2008-03-07, 09:59 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
  •