3

My question is silly, but anyway. I have created a script for downloading files, based on information from custom field. So, now I need to check in that script if the user who tries to download file is an authentificated sugarcrm user. Do you have any ideas?

forik
  • 149
  • 4
  • 15

1 Answers1

1

Add a entry to the SugarCRM "Entry Point" file.

Edit /custom/include/MVC/Controller/entry_point_registry.php and add the following:

$entry_point_registry['my_entry_point'] = array('file' => 'custom/mypath/myscript.php', 'auth' => true);

Go to http://localhost/index.php?entryPoint=my_entry_point.

The last path 'auth' => true means that the user needs to be logged into sugarCRM.

  • Thank you, but I have no idea how to use it :) I go to http://localhost/index.php?entryPoint=my_entry_point&id=123 - passing id parameter but nothing happens.. – forik Apr 12 '12 at 05:30
  • You need to substitute localhost with you server hostname and change the `entry_point_registry.php` file as stated above. Did you check the SugarCRM log file? – Kåre Werner Storgaard Apr 12 '12 at 17:13
  • Thank you! As always my inattention worked against me :) I had a mistake in a key $entry_point_registry['my_entry_point']. – forik Apr 13 '12 at 05:58
  • As of 6.3.x, entry points are created using the extension framework. The entry point extension directory is located at ./custom/Extension/application/Ext/EntryPointRegistry/. Entry point files found is this directory will be compiled into ./custom/application/Ext/EntryPointRegistry/entry_point_registry.ext.php after a Quick Repair and Rebuild. The old method of creating entry points is still compatible but is not recommended from a best practices standpoint. Another note: SuiteCRM is functionally the same as SugarCRM when it comes to this particular part (and many others.) – GeorgeWL Feb 08 '17 at 11:20