This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2015-09-10 on Sugar 7.6.0.0 | |
// filename: custom/data/acl/SugarACLReadOnly.php | |
// | |
// Read only ACL except for Admin users and specific user ids |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2016-05-08 on Sugar 7.7.0.0 | |
// file: custom/data/acl/SugarACLLock.php | |
// | |
// ACL to lock record in certain conditions. Always allow admin users and specific user ids |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// custom/logichooks/application/afterEntryPoint.php | |
class afterEntryPoint | |
{ | |
public function disableActivityStream($event, $arguments) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// custom/logichooks/modules/Users/afterLoginUsers.php | |
class afterLoginUsers | |
{ | |
public function callAfterLogin($bean, $event, $args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
function usage($error = '') { | |
if (!empty($error)) print(PHP_EOL . 'Error: ' . $error . PHP_EOL); | |
print(' php ' . __FILE__ . ' --instance /full/path' . PHP_EOL); | |
exit(1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2017-11-23 tested on Sugar 7.9.2.0 on PHP 7.1 with the addition of: https://gist.github.com/esimonetti/a99ea05b68cd2586949944c1b24b2921 | |
// Custom implementation of Sugar redis cache, using authentication if configured and using persistent connections if configured | |
// | |
// file: custom/include/SugarCache/CustomSugarCacheRedis.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined('sugarEntry') || !sugarEntry) { | |
die('Not A Valid Entry Point'); | |
} | |
require_once 'include/SugarQueue/SugarCronJobs.php'; | |
require_once 'custom/include/SugarQueue/SugarJobFilteredQueue.php'; | |
// Sample configuration: | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2017-06-19 on Sugar 7.9.0.0 | |
// filename: custom/modules/Contacts/sugarpdf/sugarpdf.pdfmanager.php | |
// | |
// This is just an example of how to print all pdf templates of a module (Contacts) landscape instead of portrait. | |
// After this customisation is installed, and the system is repaired, all PDF templates for Contacts will be printed landscape instead of portrait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// Original work: https://gist.github.com/lblockken/78a59273f2460b36eb127a7c2ee510a1 | |
// | |
// 2017-07-31 on Sugar 7.9.1.0 with PHP 7.1 | |
// filename: custom/include/SugarXHprof/TidewaysProf.php |