Results 1 to 3 of 3

Thread: How to force an authentication/login on a php page?

  1. #1
    Jarabeck is offline Junior Member
    Join Date
    Feb 2007
    Posts
    2

    Default How to force an authentication/login on a php page?

    I built a separate PHP report for my Sugar CRM and would like to force an authentication, so only valid SugarCRM users can have access to it. Ist it possible?

    Which functions should I use?

    Thanks.

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

    Default Re: How to force an authentication/login on a php page?

    You could hook it into the SOAP API. The SOAP API has routines that allow you to validate the user.
    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)
    ______________________________________________

  3. #3
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Talking Re: How to force an authentication/login on a php page?

    Quote Originally Posted by Jarabeck
    I built a separate PHP report for my Sugar CRM and would like to force an authentication, so only valid SugarCRM users can have access to it. Ist it possible?

    Which functions should I use?

    Thanks.
    This is actually very easy to do without soap.



    1. Put it in a directory in "modules". You can pick a current one like Dashboard or charts, or create a new one if you like. I would just choose charts myself.
    2. Then add this line to the top of your php program







      PHP Code:
      if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); 
      This will only allow the program to be run from with SugarCRM.







      -
    3. Then edit a menu.php file. Pick one that makes sense depending on what your report reports on. If its a leads report then edit the modules/Leads/menu.php file. Add an array item to the bottom of the list like this

      PHP Code:
      $module_menu[]=Array("index.php?module=Charts&action=MYREPORT&return_module=Leads&return_action=index""MY REPORT","Reports"'Leads'); 


      Change MYREPORT to the name of your php file (without the .php at the end) and the MY REPORT to whatever text you want to show up in the menu. If you wanted to internationalize it you could get fancy and add a language file string. Look at the other entries in the menu.php for guidence.
    4. Run your report. It will now only run from within sugarcrm.
    Last edited by kbrill; 2007-04-21 at 04:36 AM.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PHP Warnings after install add-in Module
    By kgeving in forum Help
    Replies: 1
    Last Post: 2006-08-08, 05:54 PM
  2. Errors after upgrade
    By mturany in forum Help
    Replies: 0
    Last Post: 2006-04-24, 04:40 AM
  3. ERROR in 4.01
    By rateck in forum Help
    Replies: 3
    Last Post: 2006-02-02, 10:00 PM
  4. Replies: 7
    Last Post: 2005-05-10, 08:25 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
  •