Squashed 'public/legacy/' changes from 60ccef0448..81ce7933fd

81ce7933fd SuiteCRM 7.13.0 Release
595d2bd92b Fix saveDropDown getting called statically
a70c5d1b99 Fix message deletion after auto import
f57b5ede02 Fix Inbound Email allow_outbound_group_usage filtering
9d38016f59 Remove external_oauth_providers config
d5b4f0025c Remove provider field from ExternalOAuthConnection
d457827c7d Change ExternalOAuthProvider to use open visibility by default for group records
3a51437d3a Add null check
b49d6b79a0 Fix Inbound email tests
277f2c91cb Set default on inbound emails
261dae81c1 Add group to OutboundEmailAccounts menu
3e9dbdd5de Fix ExternalOAuthConnection list view pagination and checkboxes
36cbb6a90c Fix ExternalOAuthProvider list view pagination and checkboxes
fe5f0a10d6 Fix OutboundEmailAccounts list view pagination and checkboxes
b9217a36e2 Fix InboundEmail list view pagination and checkboxes
83bd0024a6 Allow selecting group InboundEmails in folder management
f6a9111b25 Fix inbound email relationship definition
07b3110f8a Filter listview email displayed accounts according to preferences
6c49df527a Remove code that auto-selects a group email none is selected
243a0276af Fix preferences mail folder management dropdown
e7838f0bd4 Fix owner field definition in OutboundEmailAccounts
db9a52a27d Fix bounce mailbox type not being properly set
14d43e1efa Fix compose emails not sending
f9e3677db8 Add optional connection string to InboundEmail module
cef8b2bdb6 Allow setting placeholder for varchar on editview
b2d669a022 Fix group_id not being saved properly on InboundEmail
8d25cc19d8 Fix: From not populating
fae3d7b629 Fix folders not clearing subscription
a8e9eba917 Fix signatures not being editable after being created
1762704a28 Fix menu label in ExternalOAuthConnections module
e97ddb6af0 Fix inbound_emails_external_oauth_connections relationship
2cbebdd5a9 Replace External Oauth Provider sugar_config with module
89f2cee005 Add admin menu entry for ExternalOAuthProviders
dbe91ffe26 Add External providers to ExternalOAuthConnector menu
63b944e033 Add ExternalOAuthProvider module
214f0d9008 Rename ExternalOAuthProvider to ExternalOAuthProviderConnector
972356fa90 Add stringmap field
c701e4c6d5 Add json_decode smarty modifier
49024376be Update Travis build to remove php 7.3 test runs
c23f0e57ac Update Minimum php version to php 7.4
b5914d782e Fix #9670 - Disabling the user profile option about notification of assignments does not work
c2f260e477 Clear caches used by Inline Edition
89de5b620f Fix #99568: Ignore int length when comparing vardefs in newer MySQL versions
fb50e2250e ElasticSearch Indexing batch error handling
32af678e4f Fix #9473 - Missing item "Survey" in campainglog_activity_type_dom
a12f4f37be Fix #9638 - Elasticsearch issue with accented characters
d85d72996d Fix #9499 - Add View Survey Responses Menu item
dcd3ea1091 Fix #9574 - Update method to static for module renaming
c56a5b2188 Fix #9646 - Display TinyMCE in step 4 of the campaigns form wizard
d99439aca1 Fix #9717 - Security Suite Record Group selector doesn't appear when duplicating records
ea0b42469a Add new ACL access logic hooks
be0dec47dc Refactor module access query for extendability
8361cceb60 fix #9802 - Diagnostic checkboxes
44e4f47cca SuiteCRM 7.13.0-beta Release
0d6fef782e Fix #9839 - Make Inbound Email not auditable
c0b93a5d2a Fix #9839 - Align Inbound and Outbound email menu labels
3883c2cb7e Fix #9839 - Inbound email assignment fields save and detail display
0a4fbfa2a9 Fix #9839 - Inbound email filters not displaying
6fefdd79a0 Fix #9839 - OutboundEmailAccounts list filtering
3dcab78053 Fix #9839 - Hide sort fields in search modal if none is sortable
95d099d3b4 Fix #9839 - Always sort emails by date received
aff7965abd Fix #9839 - Add showing sort direction when field is not manually sortable
e3f7d02a65 Fix #9839 - Use previously selected email mailbox when using the navigation links
01c96bf15c Fix #9839 - Add Imap2Handler to use imap2 lib
d8dee51d94 Fix #9839 - Move email list retrieval from InboundEmail to ImapHandler
f798b9af4a Fix #9839 - Update InboundEmail calls to mailparser to send 2nd argument
68a8fa97dd Fix #9839 - Move stream validity check to ImapHandlers
fb4f1c81ec Fix #9839 - Fix InboundEmail pagination totals
dc26951a35 Fix #9839 - Use previously selected email mailbox when using the navigation links
cca80e945b Fix #9839 - Move case macro input to Case module settings admin menu
0fb1075aa2 Fix #9839 - Fix undefined error in listview displayEmptyDataMessages
990e98e4bc Fix #9839 - Add support to test oauth connection in InboundEmail
7259c9ce79 Fix #9839 - Allow refreshing ExternalOAuthConnection tokens
49c5c0ee09 Fix #9839 - Make ExternalOAuthConnection sensitive fields db_encrypted
17bbeb3683 Fix #9839 - Allow admins to list Group and personal ExternalOAuthConnection
0f559a6223 Fix #9839 - Allow encrypting fields on db by setting db_encrypted
471792d75f Fix #9839 - Apply acl and group check filtering to OutboundEmailAccounts
093f08f27b Fix #9839 - Apply acl and group check filtering to InboundEmail
decdd27b23 Fix #9839 - Apply acl and group check filtering to ExternalOAuthConnection
584e40cfb3 Fix #9839 - Add user acl group action check
07c5b9f021 Fix #9839 - Show no-data message on empty OutboundEmailAccounts listview
b857e4feab Fix #9839 - Show no-data message on empty ExternalOAuthConnection listview
9b6a7c4fcf Fix #9839 - Validate required fields on InboundEmail folder selection
0755e4bc7e Fix #9839 - Mark fields required when changing authType in InboundEmail
55123f4d70 Fix #9839 - Show no-data message on empty InboundEmail listview
059d112349 Fix #9839 - Fix InboundEmail save
a656abd069 Fix #9839 - Make getUserRoleNames a static method
ae49f130a9 Fix #9839 - Add is-value-set data to password field
2964fcbebc Fix #9839 - Add option to disable listview empty data messages
a5794343cb Fix #9839 - Add ExternalOAuthConnection link to admin menu
215413931c Fix #9839 - Align mail related menu entries
ee9e98741d Fix #9839 - Always keep write-only fields in OutboundEmailAccounts
4e0551e9f0 Fix #9839 - Disable massupdate and export in OutboundEmailAccounts bulk actions
bbf351ee5e Fix #9839 - Disable massupdate and export in InboundEmail bulkactions
6871295c66 Fix #9839 - Allow selecting auth type in InboundEmail module
9befcd0ae6 Fix #9839 - Add ExternalOAuthConnection entrypoints
2cee6f1d67 Fix #9839 - Add ExternalOAuthConnection module
70025d5b66 Fix #9839 - Add write-only display option to text fields
25e2443850 Fix #9839 - Add write-only display option to varchar fields
6be8a334b1 Fix #9839 - Allow creating personal outbound email accounts
8bff1fb237 Fix #9839 - Align Outbound email accounts views with Inbound
e396b7373c Fix #9839 - Allow admin to create personal inbound accounts for users
284d0eca76 Fix #9839 - Align inbound email and outbound email list views
186d8e41e4 Fix #9839 - Add Security Groups subpanel to Outbound email accounts
c07f43decb Fix #9839 - Add Security Groups subpanel to Inbound email accounts
87c9eee413 Fix #9839 - Add access checks to personal outbound email accounts
2f76e6a5f5 Fix #9839 - Add access checks to personal inbound email accounts
88adc8135b Fix #9839 - Remove email account configuration from User Settings
33feb0b1c2 Fix #9839 - Allow setting personal InboundEmail signatures
4cb0fd99aa Fix #9839 - Allow setting personal InboundEmail as default
b8cc31d8dd Fix #9839 - Add security groups to OutboundEmailAccounts
70a0daba51 Fix #9839 - Tidy OutboundEmailAccounts view definitions
ca171a4460 Fix #9839 - Remove email_provider_chooser from OutboundEmailAccounts
f8a6105618 Fix #9839 - Add menu definition to OutboundEmailAccounts
7d6cfd6c6c Fix #9839 - Load InboundEmail stored_options into fields on load
f18ec84b47 Fix #9839 - Adjust InboundEmail save to use new fields
54bfb4f72c Fix #9839 - Remove InboundEmail legacy custom views
69d008671e Fix #9839 - Add new menu entries to InboundEmail
d01a196f3b Fix #9839 - Add js code for inboundEmail
701498d007 Fix #9839 - Add standard view definitions to InboundEmail
b5870531ba Fix #9839 - Add fields for stored_options in InboundEmail
8c57b07591 Fix #9839 - Add inbound and outbound email menu links to Users module
a8bc647662 Fix #9839 - Add combinescripts smarty plugin
e4db0fbfd4 Fix #9839 - Add writeonly display mode for password fields
1cc85c2dbf Fix #9839 - Add readonly display mode for enum fields

git-subtree-dir: public/legacy
git-subtree-split: 81ce7933fd9cecc378154ed4eac7eaab5ec1f139
This commit is contained in:
Clemente Raposo 2022-12-21 11:44:57 +00:00
parent 88ca186f1a
commit 9d484f189a
188 changed files with 13961 additions and 3464 deletions

View file

@ -4,15 +4,12 @@ os: linux
matrix:
fast_finish: true
include:
- name: "PHP 7.3 / MySQL 5.7"
php: "7.3"
dist: xenial
- name: "PHP 7.4 / MySQL 5.7"
php: "7.4"
dist: xenial
# Run composer validate to make sure the composer.json and composer.lock are in sync.
- name: "composer validate"
php: "7.3"
php: "7.4"
dist: xenial
before_script: composer install
script: composer validate

View file

@ -68,6 +68,7 @@ if (!defined('sugarEntry') || !sugarEntry) {
"filtermappers" => array("section" => "filter_mappers","extdir" => "FilterMappers", "file" => 'filter_mappers.ext.php'),
"classicviewroutingexclusions" => array("section" => "classicview_routing_exclusions","extdir" => "ClassicViewRoutingExclusions", "file" => 'classicview_routing_exclusions.ext.php'),
"pdf" => array("section" => "pdfs", "extdir" => "PDF", "file" => 'pdfs.ext.php', "module" => "application"),
"externaloauthproviders" => array("section" => "external_oauth_providers", "extdir" => "ExternalOAuthProviders", "file" => 'externaloauthproviders.ext.php', "module" => "application"),
);
if (file_exists("custom/application/Ext/Extensions/extensions.ext.php")) {
include("custom/application/Ext/Extensions/extensions.ext.php");

View file

@ -2,7 +2,7 @@
<img width="180px" height="41px" src="https://suitecrm.com/wp-content/uploads/2017/12/logo.png" align="right" />
</a>
# SuiteCRM 7.12.8
# SuiteCRM 7.13.0
[![LICENSE](https://img.shields.io/github/license/suitecrm/suitecrm.svg)](https://github.com/salesagility/suitecrm/blob/hotfix/LICENSE.txt)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/salesagility/SuiteCRM-Core/issues)

View file

@ -2712,6 +2712,11 @@ class SugarBean
default:
//do nothing
}
if ($def['type'] !== 'encrypt' && isTrue($def['db_encrypted'] ?? false)) {
$this->$field = $this->encrpyt_before_save($this->$field);
}
}
if ($reformatted) {
$GLOBALS['log']->info('Formatting correction: ' . $this->module_dir . '->' . $field .
@ -3220,10 +3225,10 @@ class SugarBean
* function NAME(&$bean, $event, $arguments)
* $bean - $this bean passed in by reference.
* $event - The string for the current event (i.e. before_save)
* $arguments - An array of arguments that are specific to the event.
* $arguments - An object or array of arguments that are specific to the event.
*
* @param string $event
* @param array $arguments
* @param object|array $arguments
*/
public function call_custom_logic($event, $arguments = null)
{
@ -3586,21 +3591,6 @@ class SugarBean
$show_deleted = 1;
}
if ($this->bean_implements('ACL') && ACLController::requireOwner($this->module_dir, 'list')) {
global $current_user;
$owner_where = $this->getOwnerWhere($current_user->id);
//rrs - because $this->getOwnerWhere() can return '' we need to be sure to check for it and
//handle it properly else you could get into a situation where you are create a where stmt like
//WHERE .. AND ''
if (!empty($owner_where)) {
if (empty($where)) {
$where = $owner_where;
} else {
$where .= ' AND ' . $owner_where;
}
}
}
$query = $this->create_new_list_query(
$order_by,
$where,
@ -3632,6 +3622,56 @@ class SugarBean
return '';
}
/**
* @param string $view
* @param User $user
* @return string
*/
public function buildAccessWhere($view, $user = null)
{
global $current_user, $sugar_config;
$conditions = [];
$user = $user === null ? $current_user : $user;
if ($this->bean_implements('ACL') && ACLController::requireOwner($this->module_dir, $view)) {
$ownerWhere = $this->getOwnerWhere($user->id);
if (!empty($ownerWhere)) {
$conditions['owner'] = $ownerWhere;
}
}
/* BEGIN - SECURITY GROUPS */
$SecurityGroupFile = BeanFactory::getBeanFile('SecurityGroups');
require_once $SecurityGroupFile;
if ($view === 'list' && $this->module_dir === 'Users' && !is_admin($user)
&& isset($sugar_config['securitysuite_filter_user_list'])
&& $sugar_config['securitysuite_filter_user_list']
) {
$groupWhere = SecurityGroup::getGroupUsersWhere($user->id);
$conditions['group'] = $groupWhere;
} elseif ($this->bean_implements('ACL') && ACLController::requireSecurityGroup($this->module_dir, $view)) {
$ownerWhere = $this->getOwnerWhere($user->id);
$groupWhere = SecurityGroup::getGroupWhere($this->table_name, $this->module_dir, $user->id);
if (!empty($ownerWhere)) {
$conditions['group'] = " (" . $ownerWhere . " or " . $groupWhere . ") ";
} else {
$conditions['group'] = $groupWhere;
}
}
/* END - SECURITY GROUPS */
$args = new stdClass();
$args->view = $view;
$args->user = $user;
$args->conditions = $conditions;
$this->call_custom_logic('before_acl_query', $args);
return implode(' AND ', $args->conditions);
}
/**
* Return the list query used by the list views and export button.
* Next generation of create_new_list_query function.
@ -3667,45 +3707,12 @@ class SugarBean
$secondarySelectedFields = array();
$ret_array = array();
$distinct = '';
if ($this->bean_implements('ACL') && ACLController::requireOwner($this->module_dir, 'list')) {
global $current_user;
$owner_where = $this->getOwnerWhere($current_user->id);
if (empty($where)) {
$where = $owner_where;
} else {
$where .= ' AND ' . $owner_where;
}
$accessWhere = $this->buildAccessWhere('list');
if (!empty($accessWhere)) {
$where .= empty($where) ? $accessWhere : ' AND ' . $accessWhere;
}
/* BEGIN - SECURITY GROUPS */
global $current_user, $sugar_config;
if ($this->module_dir == 'Users' && !is_admin($current_user)
&& isset($sugar_config['securitysuite_filter_user_list'])
&& $sugar_config['securitysuite_filter_user_list']
) {
require_once('modules/SecurityGroups/SecurityGroup.php');
global $current_user;
$group_where = SecurityGroup::getGroupUsersWhere($current_user->id);
if (empty($where)) {
$where = " (" . $group_where . ") ";
} else {
$where .= " AND (" . $group_where . ") ";
}
} elseif ($this->bean_implements('ACL') && ACLController::requireSecurityGroup($this->module_dir, 'list')) {
require_once('modules/SecurityGroups/SecurityGroup.php');
global $current_user;
$owner_where = $this->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere($this->table_name, $this->module_dir, $current_user->id);
if (!empty($owner_where)) {
if (empty($where)) {
$where = " (" . $owner_where . " or " . $group_where . ") ";
} else {
$where .= " AND (" . $owner_where . " or " . $group_where . ") ";
}
} else {
$where .= ' AND ' . $group_where;
}
}
/* END - SECURITY GROUPS */
if (!empty($params['distinct'])) {
$distinct = ' DISTINCT ';
}
@ -4547,34 +4554,6 @@ class SugarBean
$show_deleted = 1;
}
if ($this->bean_implements('ACL') && ACLController::requireOwner($this->module_dir, 'list')) {
global $current_user;
$owner_where = $this->getOwnerWhere($current_user->id);
if (empty($where)) {
$where = $owner_where;
} else {
$where .= ' AND ' . $owner_where;
}
}
/* BEGIN - SECURITY GROUPS */
if ($this->bean_implements('ACL') && ACLController::requireSecurityGroup($this->module_dir, 'list')) {
require_once('modules/SecurityGroups/SecurityGroup.php');
global $current_user;
$owner_where = $this->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere($this->table_name, $this->module_dir, $current_user->id);
if (!empty($owner_where)) {
if (empty($where)) {
$where = " (" . $owner_where . " or " . $group_where . ") ";
} else {
$where .= " AND (" . $owner_where . " or " . $group_where . ") ";
}
} else {
$where .= ' AND ' . $group_where;
}
}
/* END - SECURITY GROUPS */
$query = $this->create_new_list_query($order_by, $where, array(), array(), $show_deleted, $offset);
return $this->process_detail_query($query, $row_offset, $limit, $max, $where, $offset);
@ -4937,7 +4916,7 @@ class SugarBean
$this->$field = $timedate->to_display_time($this->$field, true, false);
}
}
} elseif ($type == 'encrypt' && empty($disable_date_format)) {
} elseif (($type == 'encrypt' && empty($disable_date_format)) || isTrue($fieldDef['db_encrypted'] ?? false)) {
$this->$field = $this->decrypt_after_retrieve($this->$field);
}
}
@ -6248,7 +6227,28 @@ class SugarBean
require_once("modules/SecurityGroups/SecurityGroup.php");
$in_group = SecurityGroup::groupHasAccess($this->module_dir, $this->id, $view);
}
return ACLController::checkAccess($this->module_dir, $view, $is_owner, $this->acltype, $in_group);
$args = new stdClass();
$args->view = $view;
$args->is_owner = $is_owner;
$args->in_group = $in_group;
$args->access = true;
$args->override_acl_check = false;
$this->call_custom_logic('before_acl_check', $args);
if ($args->override_acl_check) {
return $args->access;
}
return $args->access
&& ACLController::checkAccess(
$this->module_dir,
$args->view,
$args->is_owner,
$this->acltype,
$args->in_group
);
}
/**

288
files.md5
View file

@ -1,5 +1,5 @@
<?php
// created: 2022-11-10 17:00:00
// created: 2022-12-20 17:00:00
$md5_string = array (
'./Api/Core/Config/ApiConfig.php' => '69a1e7b3d7755a2a63499a16ddae81cf',
'./Api/Core/Config/slim.php' => 'b134e68765e6a1403577e2a5a06322b8',
@ -115,8 +115,8 @@ $md5_string = array (
'./ModuleInstall/PackageManager/tpls/PackageForm.tpl' => 'bffd280ab5cd7381a5b0da41a9c1f34f',
'./ModuleInstall/PackageManager/tpls/PackageManagerLicense.tpl' => 'df5e267d1df5ce08fb9406e42d5b4816',
'./ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl' => '98e396c0aa57329731fda19c790fffb2',
'./ModuleInstall/extensions.php' => '094f4650261f6efbab1b90b119829388',
'./README.md' => '76ec8409ea1fa360d1255f693dfd5a40',
'./ModuleInstall/extensions.php' => 'de30837895f67175b7fbc04274a837a6',
'./README.md' => '54743d8cbb99f27a15c42be076e7c293',
'./RoboFile.php' => '045b82c1df69553824d0e4ffcce6e03c',
'./SugarSecurity.php' => '47e316b2d408e8c5192c8ea4a4f921b3',
'./TreeData.php' => '32873e20cb5fd33f9d1cdaf18c3cac5c',
@ -507,8 +507,8 @@ $md5_string = array (
'./build/push_output.sh' => 'cde8cd38e3b0c4e988ec4be7d81faa89',
'./build/travis-ci-apache' => 'e1e212c4eaf679b6ec620cd0b12f4571',
'./campaign_tracker.php' => '321e43ca8b664e6ca57ae5589e8c0667',
'./composer.json' => 'db3d5c1d78b364766bf171d0374b23f3',
'./composer.lock' => '060badb951dc9a03fe4f77d748a56b12',
'./composer.json' => '6bd6f8c467d45fa7b42f41a565c3c15b',
'./composer.lock' => '7651f60b1796ac7aec447c2c341ebcba',
'./cron.php' => '0b8b6bd839a2232a8da074b31feaa708',
'./crossdomain.xml' => '24b7711640c652b21aa89c9d83d6ec13',
'./data/BeanFactory.php' => '84b7c36b6a59ea8c5c4069659cc72950',
@ -522,7 +522,7 @@ $md5_string = array (
'./data/Relationships/One2OneRelationship.php' => 'c46d3067d5651fbc928763600d5e1a51',
'./data/Relationships/RelationshipFactory.php' => '98a46e44186f2d2db23be9b894a4f1e2',
'./data/Relationships/SugarRelationship.php' => 'a71b96492ee7457826fc91a2356c4ebd',
'./data/SugarBean.php' => 'ccf600118e4ad9437e82efb376443ea4',
'./data/SugarBean.php' => 'b5426bf71a4779ded1955c2eefa9cbd1',
'./deprecated.php' => 'f5f507fd6314f38d29c97e2cc2c62239',
'./dictionary.php' => 'b7c1370fb75a2940c04db74627c4462c',
'./download.php' => 'ffc5806938cc1f888c7ddedb79f7bedf',
@ -543,14 +543,14 @@ $md5_string = array (
'./include/Dashlets/DashletHeader.tpl' => '8b8ce31451810ba6e2df4da49ab1eed2',
'./include/Dashlets/DashletRssFeedTitle.php' => '40032748c6a72a8d0929c608ea16f6a7',
'./include/DatabaseTransactions.php' => '430f1e917f9d65f1304f6094e946bb1a',
'./include/DetailView/DetailView.php' => '89a6d36cd323c0b79a53e405281703a8',
'./include/DetailView/DetailView.php' => 'd10f95d0b370f1fdb67b9bfff7540deb',
'./include/DetailView/DetailView.tpl' => 'd58cd38e065ff5b213e152408d4b900c',
'./include/DetailView/DetailView2.php' => '73b01c85a6b55d203db8bf2be98df9bf',
'./include/DetailView/footer.tpl' => 'b63d62eac5c99afa3497881c59da906b',
'./include/DetailView/header.tpl' => '79e5e7385483e4486ac1f20d739d8cd5',
'./include/EditView/EditView.php' => '6bd1f5815f5c674416efd1e71a67bd65',
'./include/EditView/EditView.tpl' => '4458f5584adfdb8d54e74b8e867e048c',
'./include/EditView/EditView2.php' => 'b2684fe27ec214563d935d5080dd9742',
'./include/EditView/EditView2.php' => '7ad84a44d52c2d5ae9a7e51d170a0efc',
'./include/EditView/Panels.js' => '580266b80716d8e7003807189565e557',
'./include/EditView/PopupQuickCreate.php' => '09b22d51578ba228a89ba6a7e5f403c8',
'./include/EditView/QuickCreate.php' => 'dbd2c8b5be42047ada748e073b87ff90',
@ -584,13 +584,14 @@ $md5_string = array (
'./include/HTTP_WebDAV_Server/dav.txt' => 'c5235ed64efa685da638c6dcdb6a9708',
'./include/HTTP_WebDAV_Server/license.txt' => 'a45bb1bbeed9e26b26c5763df1d3913d',
'./include/HtmlSanitizer.php' => 'efcd753e725f16eb9212bc3bb2ed2cff',
'./include/Imap/ImapHandler.php' => 'dbabb67c1d5c7d66dd0e9848a5d1956a',
'./include/Imap/Imap2Handler.php' => '847bc7709b73a75b700e5acca59a5819',
'./include/Imap/ImapHandler.php' => '29e289d005995cde4a35144bfe176fb0',
'./include/Imap/ImapHandlerException.php' => '43d045dace421f51ad30eab02e1d1e91',
'./include/Imap/ImapHandlerFactory.php' => '0b015e476295d1edaa6bd55fe0717cf7',
'./include/Imap/ImapHandlerFake.php' => '944f354c498721810af1e37c32f9c6f2',
'./include/Imap/ImapHandlerFakeCalls.php' => '040b64de74e02accf657087177ea182f',
'./include/Imap/ImapHandlerFactory.php' => '3690854b3f23f1f7e3e73f98a5fa3655',
'./include/Imap/ImapHandlerFake.php' => '836493c75c86459f9449809f9dc6d010',
'./include/Imap/ImapHandlerFakeCalls.php' => '78bb2e1e21c97feab44c1e274050c050',
'./include/Imap/ImapHandlerFakeData.php' => '8269f4b291c9a24abedfc4aee98f1d0e',
'./include/Imap/ImapHandlerInterface.php' => 'ee29799b42b6e32762a35f5bbe32b701',
'./include/Imap/ImapHandlerInterface.php' => '8472059ae0b7f2c79f06d8fef7249e63',
'./include/Imap/ImapTestSettingsEntry.php' => '3d95c35c794247f3a4109704867eb202',
'./include/Imap/ImapTestSettingsEntryHandler.php' => '3292a309c3331e60ab13f48c56e672c8',
'./include/Imap.php' => '0f93494ddbae70f85acdcbac5e92dbc5',
@ -617,7 +618,7 @@ $md5_string = array (
'./include/ListView/ListViewPagination.tpl' => '33063ccce1750e85762c3f0910c29a6a',
'./include/ListView/ListViewSearchLink.tpl' => '9cd943804ef3db4fa47ba41c99f5a12f',
'./include/ListView/ListViewSelectObjects.tpl' => '04b1d6d2c02f649966e9b4d26f46a430',
'./include/ListView/ListViewSmarty.php' => '3eed8e14bc3ede6151ccd475b3068278',
'./include/ListView/ListViewSmarty.php' => '4e3b9e5afb52ef4a0e4c375bf0137668',
'./include/ListView/ListViewSubPanel.php' => '689b69b240c6177cbd1da575a0eb6c65',
'./include/ListView/ListViewXTPL.php' => '6a32cb0d7c7bce48c8d6eee6ea76a1f7',
'./include/Localization/Localization.php' => '2ae644ee0562e38287e5804bcdab32ad',
@ -625,7 +626,7 @@ $md5_string = array (
'./include/MVC/Controller/SugarController.php' => 'fddd4ec4cb64ba9450f82f84e9730aac',
'./include/MVC/Controller/action_file_map.php' => '890a7903fc8c66e372f365bddc530cba',
'./include/MVC/Controller/action_view_map.php' => 'fb0f1173db35edb1ed4ed191896f6274',
'./include/MVC/Controller/entry_point_registry.php' => 'c107d0eb8f9f32c4af3ae12bb43ac87f',
'./include/MVC/Controller/entry_point_registry.php' => 'b8b8fb6e4f432de3b996fbbc6acb7a73',
'./include/MVC/Controller/file_access_control_map.php' => '86baf77effe4eb6167c4557c481c2f5f',
'./include/MVC/SugarApplication.php' => '0aebe6f78a37464d305522abfcd09f36',
'./include/MVC/SugarModule.php' => '7ffbda56ac7bd074795034533ef93c1a',
@ -679,7 +680,7 @@ $md5_string = array (
'./include/MySugar/tpls/dashletsSearchResults.tpl' => '687c3a1ef953e103fa5cfc91adac2b1e',
'./include/MySugar/tpls/retrievePage.tpl' => 'e4f99a0c96f4b9af18ff4e16b35ebc83',
'./include/MySugar/tpls/retrieveReportCharts.tpl' => 'eae923db515b990099e897c335560dc8',
'./include/OutboundEmail/OutboundEmail.php' => 'b67350f1a16e4b072d2b9ce7128360ad',
'./include/OutboundEmail/OutboundEmail.php' => 'e4292d317ca83921c2d798e1bf441fc9',
'./include/Pear/Crypt_Blowfish/Blowfish/DefaultKey.php' => '71c33c848e1219ea3cfad5795f02f3cd',
'./include/Pear/Crypt_Blowfish/Blowfish.php' => '0c73a6dbf2fa10ae60ecb7dde76c67eb',
'./include/Pear/Crypt_Blowfish/license.txt' => 'a45bb1bbeed9e26b26c5763df1d3913d',
@ -704,6 +705,7 @@ $md5_string = array (
'./include/Services/Batch/BatchJob.php' => 'bada8d2023e3824673b3a709a54e76f7',
'./include/Services/NormalizeRecords/NormalizeRecords.php' => '0daac688a03ca6212dee84f6411a8b30',
'./include/Services/NormalizeRecords/NormalizeRecordsSchedulerJob.php' => '8931bcef83a853868bd8f0dc934818d1',
'./include/Services/ScriptLoader/SuiteScriptLoader.php' => 'ceb2826ba8881fefea8db6b2462ce4d3',
'./include/Smarty/plugins/block.minify.php' => 'a4a8771c5a8a48c7ab030b0b552957dd',
'./include/Smarty/plugins/block.nocache.php' => '66bb941778de43b9e52d06a47becb9f5',
'./include/Smarty/plugins/block.textformat.php' => 'f4e1cc15997ff132066f5e4e09e92054',
@ -767,6 +769,7 @@ $md5_string = array (
'./include/Smarty/plugins/function.sugarvar.php' => 'b4322c3942894bb10263ff2f36d9f0b8',
'./include/Smarty/plugins/function.sugarvar_connector.php' => '1dd5d26b7b0984843d9005f7bf90d33e',
'./include/Smarty/plugins/function.suite_check_access.php' => '3d2d528bdfdeafa4cd24fd773f1c3497',
'./include/Smarty/plugins/function.suite_combinescripts.php' => 'c9c6797941fae76654f679535b385574',
'./include/Smarty/plugins/modifier.capitalize.php' => '70f58c49c5bd2851be11a3d67a92d2a4',
'./include/Smarty/plugins/modifier.cat.php' => '9dbc6c2d6d78165d9d0ffae481509b6a',
'./include/Smarty/plugins/modifier.count_characters.php' => '91694b84f8b86aa551ff49ced16dbd11',
@ -782,6 +785,7 @@ $md5_string = array (
'./include/Smarty/plugins/modifier.in_array.php' => 'f5aabe01841e76d205eec79f091ded5f',
'./include/Smarty/plugins/modifier.indent.php' => 'ea1f5db88c00e850c3968e434eadb074',
'./include/Smarty/plugins/modifier.json.php' => 'a63f703e849949d7960e8511d91573e8',
'./include/Smarty/plugins/modifier.json_decode.php' => 'e42b68aacb908034f615471f16263bd2',
'./include/Smarty/plugins/modifier.lookup.php' => 'e9867a0ffb18f7be9aaea8fba75b41cd',
'./include/Smarty/plugins/modifier.lower.php' => '5520933762ceac07d49e658c52587279',
'./include/Smarty/plugins/modifier.multienum_to_ac.php' => '2a1c9c5feb31d24f7f2f5f832941ff4e',
@ -872,7 +876,7 @@ $md5_string = array (
'./include/SugarFields/Fields/Assigned_user_name/SugarFieldAssigned_user_name.php' => '7cac00ee300243213c08527325b8a7e9',
'./include/SugarFields/Fields/Base/DetailView.tpl' => 'f5f751c593d52a5161f3c6995cc25181',
'./include/SugarFields/Fields/Base/DetailViewFunction.tpl' => 'f1699feaa5a9dd4bfbb7b7439fe64016',
'./include/SugarFields/Fields/Base/EditView.tpl' => 'b5254733554c9f672222bf8367cafa8f',
'./include/SugarFields/Fields/Base/EditView.tpl' => 'fde178f65e2a19d264736800c298d3a2',
'./include/SugarFields/Fields/Base/EditViewFunction.tpl' => '155f1d12fee72306ef962041219d4beb',
'./include/SugarFields/Fields/Base/ImportViewFunction.tpl' => '155f1d12fee72306ef962041219d4beb',
'./include/SugarFields/Fields/Base/InlineEdit.tpl' => '87eade8699bf0f65b4868efdef9b12c3',
@ -921,7 +925,7 @@ $md5_string = array (
'./include/SugarFields/Fields/EmailBody/SugarFieldEmailBody.php' => '96c3842013034dc88da2d2f6d3271639',
'./include/SugarFields/Fields/Enum/DetailView.tpl' => 'f68d242afc933f84f80bcf035a378193',
'./include/SugarFields/Fields/Enum/DetailViewFunction.tpl' => 'fd1aa861ebf16be11b53350c2cb0914c',
'./include/SugarFields/Fields/Enum/EditView.tpl' => '4fe49b7c57e7e3d68bbdeb0989edf374',
'./include/SugarFields/Fields/Enum/EditView.tpl' => '5f2f2c61a31b72cf2d9f7de6a072c1e1',
'./include/SugarFields/Fields/Enum/EditViewFunction.tpl' => '083913c40c0cb1015acd2012ba7bb8e8',
'./include/SugarFields/Fields/Enum/SearchView.tpl' => '42aafd0812c443c10d37f84ce05aefa8',
'./include/SugarFields/Fields/Enum/SugarFieldEnum.php' => '9f702dee447a05073e55c270bc827517',
@ -967,7 +971,7 @@ $md5_string = array (
'./include/SugarFields/Fields/Parent/EditView.tpl' => 'a9fa8c11ad879f4c4f0b545d7d33467e',
'./include/SugarFields/Fields/Parent/SearchView.tpl' => '7cc8ff9ee4939ce0301d25f188089f51',
'./include/SugarFields/Fields/Parent/SugarFieldParent.php' => '6786883a41a2645e343522685df23d79',
'./include/SugarFields/Fields/Password/EditView.tpl' => 'fa98991bce7296a82929356d9bbff76a',
'./include/SugarFields/Fields/Password/EditView.tpl' => '8173b48e432bb9e83802566e9e426f4e',
'./include/SugarFields/Fields/Password/SugarFieldPassword.php' => 'ccb4a64dc91636e6a8eef1c3bba90692',
'./include/SugarFields/Fields/Phone/DetailView.tpl' => '5b227d36a93c3600f3cfeed0e6addf7d',
'./include/SugarFields/Fields/Phone/EditView.tpl' => 'edd6e93c04eab6a52d873c3340b1073c',
@ -981,9 +985,14 @@ $md5_string = array (
'./include/SugarFields/Fields/Relate/EditView.tpl' => 'dcb2bc4266af61b62b8f8ba684443e2e',
'./include/SugarFields/Fields/Relate/SearchView.tpl' => '3358b13b5f65f59f39f122e99b864ef8',
'./include/SugarFields/Fields/Relate/SugarFieldRelate.php' => '4994983d4481579977f46d04181bc6b1',
'./include/SugarFields/Fields/Stringmap/DetailView.tpl' => '43b65b8a95fa14fbb56014a12015342f',
'./include/SugarFields/Fields/Stringmap/EditView.tpl' => 'a66fa4934c14fc9db8861ab58073c848',
'./include/SugarFields/Fields/Stringmap/SugarFieldStringmap.php' => 'd77ce6924d528309d253ed860d01d84c',
'./include/SugarFields/Fields/Stringmap/js/stringmap-factory.js' => '87d4bf9d3326a346a8058d7e99b19164',
'./include/SugarFields/Fields/Stringmap/js/stringmap.js' => '57fa98bc5a0967be038f53c22efdb133',
'./include/SugarFields/Fields/Text/ClassicEditView.tpl' => '8b3eb086dd74cef40e61faae361d8776',
'./include/SugarFields/Fields/Text/DetailView.tpl' => '92021168bdfa2a630fa02962c9618dec',
'./include/SugarFields/Fields/Text/EditView.tpl' => '72271a7a85ca15433f71f9993f74fed6',
'./include/SugarFields/Fields/Text/EditView.tpl' => '200c18ec02c03c84fc55813e309edf89',
'./include/SugarFields/Fields/Text/SugarFieldText.php' => '0a800255ce21f9dfa927e5f80ba521d5',
'./include/SugarFields/Fields/Time/EditView.tpl' => 'e3eb06cfa4f9845eaa7b63b8fb62e1fd',
'./include/SugarFields/Fields/Time/SugarFieldTime.php' => 'c8b01634167a9509625413c6d956e8cb',
@ -1027,7 +1036,7 @@ $md5_string = array (
'./include/SugarFields/Parsers/SearchFormMetaParser.php' => '732eecf76268b82b84667f6d00a905f5',
'./include/SugarFields/SugarFieldHandler.php' => '73b2605cef98e6b0b03880d299a49e92',
'./include/SugarFolders/SugarFolderEmptyException.php' => 'd8052a2f3abf6ff8db9563bf3e22842e',
'./include/SugarFolders/SugarFolders.php' => '4b79dc7fc655f6fe17210eb93191beb4',
'./include/SugarFolders/SugarFolders.php' => 'a2323abcfb7ead79b307e05c8739512c',
'./include/SugarHtml/SugarHtml.php' => 'b457a731768480ce81d6e709d920e2cb',
'./include/SugarHttpClient.php' => 'bf0aedbad0c73763186e37fb9107d3d7',
'./include/SugarLogger/LoggerManager.php' => 'd30492d39dc1aecce2e9cabdc4c148e8',
@ -1199,7 +1208,7 @@ $md5_string = array (
'./include/SugarObjects/templates/sale/metadata/subpanels/default.php' => '933ed06ff0fd822b455b6c05d3526b35',
'./include/SugarObjects/templates/sale/vardefs.php' => '0594cbe418f268edf893cced47b022f3',
'./include/SugarObjects/translated_prefix.php' => 'ba8e90a225dfa38f779119b10c366d40',
'./include/SugarPHPMailer.php' => 'f3e4df19eab7a1ec3023c62dc383a85e',
'./include/SugarPHPMailer.php' => '7f75d0acba639a135c7ab3f7b9f88fb0',
'./include/SugarQueue/SugarCronJobs.php' => 'ee32b208de3d393fa352f4f578a5b746',
'./include/SugarQueue/SugarCronRemoteJobs.php' => '07feac4c96f9cb8c0e00a8d9f075f841',
'./include/SugarQueue/SugarJobQueue.php' => 'ed2f9154587957a89b85121039a05fed',
@ -1209,7 +1218,7 @@ $md5_string = array (
'./include/SugarTheme/SugarThemeRegistry.php' => '437a775ba6ef36dc87cb59d5ae1a3b14',
'./include/SugarTheme/cssmin.php' => 'ff649bb50d5dafcce509ed9d340b6d06',
'./include/SugarTheme/getImage.php' => 'd7963d20b0365d62c7d1c84ea3faf3ed',
'./include/SugarTinyMCE.php' => '3e1df6fa7bcbb9e3caf75d97e1d8924b',
'./include/SugarTinyMCE.php' => '9be7450638b50efe57ccc33bfbb35eb0',
'./include/Sugar_Smarty.php' => '9ce2f82df09600f42ccd1eee7bf78294',
'./include/Sugarpdf/FontManager.php' => '4f3e178b643571961d9f2590122342cc',
'./include/Sugarpdf/Sugarpdf.php' => '10f553017faf60a1ba027c96dea2d43d',
@ -1336,12 +1345,12 @@ $md5_string = array (
'./include/database/FreeTDSManager.php' => '23ec109e38260e0ffa2a1676d486fd62',
'./include/database/MssqlManager.php' => '8ec8ad4bd3df1c19aa96b228f3b356a7',
'./include/database/MysqlManager.php' => 'e291bd0e38fde596a8bd1f6c75688eaa',
'./include/database/MysqliManager.php' => '31cf1de8eba53e933ea116870129da12',
'./include/database/MysqliManager.php' => '19025de16a37f6bb8ffb1b8c4e0ab34d',
'./include/database/SqlsrvManager.php' => 'ad3f8e07dce347f8cf1906e7e91ec776',
'./include/dir_inc.php' => '4ec954313ef7c8b164ec1232a1ec1bd7',
'./include/entryPoint.php' => '6c03ccc488eae94ac702743421951115',
'./include/entryPointConfirmOptInConnector.php' => '66fed04564c4f4182f3b277d5b6dfafc',
'./include/export_utils.php' => 'b8144b36a084682de435bfa26a66259b',
'./include/export_utils.php' => '5f539efced9a07f53e78663126d1fc5d',
'./include/externalAPI/Base/ExternalAPIBase.php' => 'e52639773bbdaa1d9e3308fd7a41e392',
'./include/externalAPI/Base/ExternalAPIPlugin.php' => '9f8d318d518a9f950fd0d80a6bac7c20',
'./include/externalAPI/Base/ExternalOAuthAPIPlugin.php' => 'fd065e2de29e6fa0dfc86956e2c86230',
@ -1675,7 +1684,7 @@ $md5_string = array (
'./include/javascript/quickCompose.js' => '047d7eea0263fa0c2cd9bdb53ecf6258',
'./include/javascript/quicksearch.js' => '97475c83c2614b54f3a0dd63edb2dfb2',
'./include/javascript/report_additionals.js' => '094fef2462c9d640ee3ef4dc7af613d0',
'./include/javascript/sugar_3.js' => '37dafba08d7a447439882819e54de1e1',
'./include/javascript/sugar_3.js' => '1648c3c6a4f2e6ba8eecb9425f897251',
'./include/javascript/sugar_connection_event_listener.js' => 'c8a148e865988e17f9b0328de44803a7',
'./include/javascript/sugar_yui_overrides.js' => 'd99ea792b967d53cef54e0b870acdd88',
'./include/javascript/sugarwidgets/SugarYUILoader.js' => '959d552199b65eab09ed534ade65b064',
@ -2280,11 +2289,11 @@ $md5_string = array (
'./include/javascript/yui/build/yuitest/yuitest_core.js' => 'ed5230a0f4a885d8ea51c2fe78895d07',
'./include/javascript/yui/ygDDList.js' => '0cd9051a220de7e8c79bf5b9cccce10f',
'./include/json_config.php' => 'ba7fb6f2fb1df51bc367835406ef7ba5',
'./include/language/en_us.lang.php' => '6963637150f1b221f9f70dd45d63bf87',
'./include/language/en_us.lang.php' => 'ce7095b341f605c0fedb300f9ad95ab6',
'./include/language/en_us.notify_template.html' => 'c6a897ace7af46a44889dfab1a9d44c5',
'./include/language/getJSLanguage.php' => '1bc910bd5a9953fbf443d3d97fddbffa',
'./include/language/jsLanguage.php' => '3d27819dc00f2fe5426f72733a7edca1',
'./include/modules.php' => '3223205c71cf9365281b9807c518c137',
'./include/modules.php' => 'a2dbb8cc5bb27724399b6133f51f0fc9',
'./include/nusoap/changelog' => 'd75ed67ec93c02e5bce94eee8205b425',
'./include/nusoap/class.nusoap_base.php' => '7cf46001fe52a1abe276ce3874937cd6',
'./include/nusoap/class.soap_fault.php' => '9055e7b0b5962c47ddffe3607736d18c',
@ -2372,7 +2381,7 @@ $md5_string = array (
'./include/templates/TemplateGroupChooser.php' => '7fa25dfd4b6667dbb94d30f65e50544a',
'./include/upload_file.php' => '10cfcf529e92e2ce1411ae5e111d79a6',
'./include/utils/BaseHandler.php' => '449516b84f4160f2c8880f7a06cd325f',
'./include/utils/LogicHook.php' => '5f5e285b41b00ccf5f1972d159ce0e7a',
'./include/utils/LogicHook.php' => '5c5bf9de49d7c37daedff422f5f846ff',
'./include/utils/activity_utils.php' => '8ffd9e9af5ca08e8aa26dbd014d499d5',
'./include/utils/additional_details.php' => 'cbb4ffe2c86d7644707cf88035cb2966',
'./include/utils/array_utils.php' => '50b2476acbfe22a61197dd7ee67e0260',
@ -2391,7 +2400,7 @@ $md5_string = array (
'./include/utils/recaptcha_utils.php' => '73f5eddf707788c1dff4b7d07dc82656',
'./include/utils/security_utils.php' => 'e953d0b673df3df313ecf1ac975e8f57',
'./include/utils/sugar_file_utils.php' => '1c1915cad8c88feb0edbf5bbaee106c4',
'./include/utils.php' => '55b02dfc0dc39c73996597a598b96264',
'./include/utils.php' => '7ef07e3591bf75669eb1fc8359cbfff0',
'./include/vCard.php' => '44052bbedcdaba3fdf67cfc10a112e75',
'./include/ytree/ExtNode.php' => '000d4ccbdb6e0a7628c636128781b5e3',
'./include/ytree/JQueryTree.php' => '3712d2224b93818b990b876f8405b745',
@ -2484,7 +2493,7 @@ $md5_string = array (
'./install/install_defaults.php' => 'd25503407f0db14fa875b295d0f34ae5',
'./install/install_utils.php' => '9910d3f9f63ac7fafd1ed474f8a773b1',
'./install/lang.config.php' => 'cb3e68fdb0600481497dcd60f0746aca',
'./install/language/en_us.lang.php' => '443a21c6c24b089d6dc085a3ebb588d8',
'./install/language/en_us.lang.php' => 'ab18c27ce23d99ef25fcf9602be1804c',
'./install/license.js' => '305c727ac2bd20adb6c169bf07b18a8e',
'./install/license.php' => '73aecaa43ecaf1743897049f991fb785',
'./install/licensePrint.php' => 'd8e905c5b6c769cd726ad94399118d88',
@ -2496,7 +2505,7 @@ $md5_string = array (
'./install/populateSeedData.php' => '08323b30a68541fb5dc5b0b757e1051a',
'./install/processing.gif' => 'd7c43fc19181ee59862601bfce100b41',
'./install/ready.css' => '31c31392abb65459827b0761723b8e33',
'./install/ready.php' => 'b717d12a149dc161790c6b953a2f569e',
'./install/ready.php' => 'aa4832e4667e05b7b5eb8aff7ca8829f',
'./install/register.js' => 'b35a76c2a52053d5f9128fa78aa3adb0',
'./install/register.php' => '3c6e5671e698af7b372a6b0e8e783c54',
'./install/seed_data/Advanced_Password_SeedData.php' => '5e5384ab0fb37868c705172967993406',
@ -2564,7 +2573,7 @@ $md5_string = array (
'./jssource/src_files/include/javascript/quickCompose.js' => '31c8e3efcf325c0c805018587fa585cb',
'./jssource/src_files/include/javascript/quicksearch.js' => '0329400df3d1b8e4eab0765f8fe9f2e4',
'./jssource/src_files/include/javascript/report_additionals.js' => 'baca991df446eaf401dda47d1685fad1',
'./jssource/src_files/include/javascript/sugar_3.js' => '1013320f0f4e078b999641d94e979fb6',
'./jssource/src_files/include/javascript/sugar_3.js' => '6dc9b5bab2dd6bf363cec7dff16aa248',
'./jssource/src_files/include/javascript/sugar_connection_event_listener.js' => '431e88e62c5a7005693189d1e9d8e916',
'./jssource/src_files/include/javascript/sugar_yui_overrides.js' => 'efbf74aa5e7d0af070ae7faab7725538',
'./jssource/src_files/include/javascript/sugarwidgets/SugarYUILoader.js' => 'abc59adf77cf85c0424dbcb6c356bee8',
@ -2604,7 +2613,7 @@ $md5_string = array (
'./jssource/src_files/modules/EAPM/EAPMEdit.js' => '0e4186b5358b2b403e6c6ef717ee7aa4',
'./jssource/src_files/modules/EmailTemplates/EmailTemplate.js' => '6e48b43a26a1a16d3b7925001408b338',
'./jssource/src_files/modules/Home/tour.js' => '8d3968fbeb138587fbd6ab2e6bf565b9',
'./jssource/src_files/modules/InboundEmail/InboundEmail.js' => 'c0c026adb789b2344ee1fdeb6f399be1',
'./jssource/src_files/modules/InboundEmail/InboundEmail.js' => '1644be1f7b1854367142c261dcb2b2be',
'./jssource/src_files/modules/Leads/Lead.js' => '976776af2d77794460dc8bec9a0eab89',
'./jssource/src_files/modules/Meetings/duration_dependency.js' => '6fdc91648e92f1198bcf6f5ff4fae049',
'./jssource/src_files/modules/Meetings/jsclass_scheduler.js' => 'fbaac9e2b6ac6866a543232509f09eb5',
@ -2791,9 +2800,9 @@ $md5_string = array (
'./lib/Search/AOD/LuceneSearchEngine.php' => '7a589c07fae355ad81ba1893e40e1bb9',
'./lib/Search/BasicSearch/BasicSearchEngine.php' => '1f6ecd5faa8a58cd6d2e06da6ca35cd3',
'./lib/Search/ElasticSearch/ElasticSearchClientBuilder.php' => '4743c29fa00cb5d4025c974af7b79156',
'./lib/Search/ElasticSearch/ElasticSearchEngine.php' => '89b2b27ef2c5dd8e7482360a8e499bfc',
'./lib/Search/ElasticSearch/ElasticSearchEngine.php' => '728d22251a99bf9606170fc1b48279ef',
'./lib/Search/ElasticSearch/ElasticSearchHooks.php' => '8898cc8d7cec43f13352397be9397f3e',
'./lib/Search/ElasticSearch/ElasticSearchIndexer.php' => '580d41b2ebfb016fff416f9cea38dd57',
'./lib/Search/ElasticSearch/ElasticSearchIndexer.php' => '3775a9343fb6e0323a35a592c5b94f87',
'./lib/Search/ElasticSearch/ElasticSearchModuleDataPuller.php' => 'ad1144c9e9f58af496714d6dcdbdbaa5',
'./lib/Search/ElasticSearch/elasticsearch.example.json' => 'cd776b60993b4521cd5cfd79db95af46',
'./lib/Search/Exceptions/SearchEngineNotFoundException.php' => '4f83830aea088643ee87f82bd173d96d',
@ -2811,7 +2820,7 @@ $md5_string = array (
'./lib/Search/SearchConfigurator.php' => '3da51dc9e7b6d9b8fcbd45c0a8db5759',
'./lib/Search/SearchEngine.php' => '92775fe01a004fb58f1bf6edcc9f3dc8',
'./lib/Search/SearchModules.php' => '5261f4a9ab7a7d690618aefa08c6ca76',
'./lib/Search/SearchQuery.php' => 'ccc5b48e33c5bd4c1cc51be8f5889466',
'./lib/Search/SearchQuery.php' => '523292cc81871ec25ac17a7ab96bc888',
'./lib/Search/SearchResults.php' => 'bdcdd0018e1fa375dc9c0344dd00b14e',
'./lib/Search/SearchWrapper.php' => '2aaaa78656373bbdb2f0187a208d60eb',
'./lib/Search/SqlSearch/SimpleSqlSearchEngine.php' => 'db160c7c333582c7028a59f2bed03fcb',
@ -2819,7 +2828,7 @@ $md5_string = array (
'./lib/Search/UI/MVC/View.php' => '060017bf23671e429cca7187b72ddd2a',
'./lib/Search/UI/SearchFormController.php' => '2cf159703562da6348ece57ef68313b4',
'./lib/Search/UI/SearchFormView.php' => '15662e4bd9237044fe1b74f41632660d',
'./lib/Search/UI/SearchResultsController.php' => '4670567daea7e976e25cd215150f79ed',
'./lib/Search/UI/SearchResultsController.php' => '788728a30dc77334a9682e49ff9f0307',
'./lib/Search/UI/SearchResultsView.php' => 'ce2615a6390cfe62924d44fdfc7a18fa',
'./lib/Search/UI/SearchThrowableHandler.php' => '14cd2232a5a73df32a755e85a52cd7fd',
'./lib/Search/UI/templates/search.form.tpl' => '8a03f27dd8860270f7c91d64c211fffe',
@ -2829,7 +2838,7 @@ $md5_string = array (
'./lib/Utility/AntiMalware/Providers/ClamTCP.php' => 'f5eab54f8e3bcaa605a036a69bbb99b1',
'./lib/Utility/AntiMalware/Providers/Sophos.php' => '6edbdf87006927ea647395bc945238f5',
'./lib/Utility/ApplicationLanguage.php' => '5bc996ea12af48ba0f167a50f699483a',
'./lib/Utility/ArrayMapper.php' => '128538045d9530d999a46b90ed14c3c1',
'./lib/Utility/ArrayMapper.php' => '03c31accfe841c560daafe3d2d86c672',
'./lib/Utility/BeanJsonSerializer.php' => 'f12bad930b18f23e5270139f46966733',
'./lib/Utility/BeanJsonSerializer.yml' => 'c9f6e3dae78a0061d5ed1612eb50c02d',
'./lib/Utility/Configuration.php' => '97f895c91d3f247b6fe7be7f063efbfa',
@ -2949,7 +2958,7 @@ $md5_string = array (
'./modules/ACLActions/language/en_us.lang.php' => '5fbb977deea129f58673a1a899dd19e5',
'./modules/ACLActions/metadata/subpaneldefs.php' => 'eeb92f8d430ef3fcc134cf83dc972497',
'./modules/ACLActions/vardefs.php' => 'fa9d7e17b81d212f1c5634714ebb6c0c',
'./modules/ACLRoles/ACLRole.php' => '34d51d437972618a5068bfb279f31670',
'./modules/ACLRoles/ACLRole.php' => 'a0de0c7d873bea9a4f15f6e5cb4b1e64',
'./modules/ACLRoles/ACLRoles.js' => '6a8acb939b3a059dea0ddf298f63123b',
'./modules/ACLRoles/Delete.php' => 'cddba6f5e193634d70a709c46445b57c',
'./modules/ACLRoles/DetailUserAccess.php' => 'cc3dfdcf77f5151b165959e5d9906d4d',
@ -3255,7 +3264,7 @@ $md5_string = array (
'./modules/AOP_Case_Updates/metadata/quickcreatedefs.php' => '2ad09f9d04ec4e060eec43c51f189a17',
'./modules/AOP_Case_Updates/metadata/searchdefs.php' => '02962dadabd5f9ebb1a8d8f7e0821a43',
'./modules/AOP_Case_Updates/tpl/caseUpdateForm.tpl' => '090a89e828774dde4b9b744b3b73c4f9',
'./modules/AOP_Case_Updates/util.php' => '98b2f2b14fea00af615f25f4fec404b5',
'./modules/AOP_Case_Updates/util.php' => '70f248d011f0b5ad5f6ace48e762da70',
'./modules/AOP_Case_Updates/vardefs.php' => '20f0fcc9b6261db648076addc1e9c3a3',
'./modules/AOR_Charts/AOR_Chart.php' => 'e157566b99b62f4958dfff96c286410c',
'./modules/AOR_Charts/chartLines.js' => '4aa11696fc23f9c1d4f300e29334dbab',
@ -3308,7 +3317,7 @@ $md5_string = array (
'./modules/AOR_Fields/language/en_us.lang.php' => '50a4309bdae43ce819c1a9bf95db1393',
'./modules/AOR_Fields/vardefs.php' => '385d0f1955e9e46e276159b67c716eb1',
'./modules/AOR_Reports/AOR_Report.js' => 'f95623b1ab32a4325a3f1c2649b63702',
'./modules/AOR_Reports/AOR_Report.php' => '8f4cb0629e02de58e997250d6a01bb64',
'./modules/AOR_Reports/AOR_Report.php' => '90c1567df1f72d4a19982213a727f13b',
'./modules/AOR_Reports/AOR_Report_After.js' => 'ab77afb81f872f96f22bc676d0ae4beb',
'./modules/AOR_Reports/AOR_Report_Before.js' => 'ab5397e1ca56871cb28514092029fd90',
'./modules/AOR_Reports/Dashlets/AORReportsDashlet/AORReportsDashlet.js' => '95fb8234d31774e011b0984229dca16a',
@ -3655,8 +3664,8 @@ $md5_string = array (
'./modules/Activities/tpls/PopupHeader.tpl' => 'a5d6e208e7df413a1247c17b59402e41',
'./modules/Activities/views/view.list.php' => '2f8f97ee242f1c60f80f18c23456c4e5',
'./modules/Activities/views/view.modulelistmenu.php' => 'b287fb1055865e6fe47ad46d584e054a',
'./modules/Administration/AOPAdmin.php' => 'c5467f61940b965c61147e8de0cb0aeb',
'./modules/Administration/AOPAdmin.tpl' => 'a29e010dc42642c97eb6bc45b77586ca',
'./modules/Administration/AOPAdmin.php' => '52db79bb630ad53239ac17c5e260a61a',
'./modules/Administration/AOPAdmin.tpl' => '04391325ff3ba9d2d16d427f0a60d0ab',
'./modules/Administration/AOSAdmin.php' => 'd7e75c25af0a4e4a9bd954280b7450ec',
'./modules/Administration/AOSAdmin.tpl' => 'ee8d38886e9253512b0d9db8d9613b5a',
'./modules/Administration/Administration.php' => 'afb22cff58476d164e61eb4000ac3133',
@ -3667,7 +3676,7 @@ $md5_string = array (
'./modules/Administration/CustomizeFields.php' => '2b4c96aa7706703e25d7b7e5d03dd78f',
'./modules/Administration/Development.php' => '7b8cf54f333836a77c267f35dca137bc',
'./modules/Administration/Diagnostic.php' => 'f8042639887cc4fddef0ca3b7297b8a6',
'./modules/Administration/Diagnostic.tpl' => '667ba5c34e72f0ebcdcc32e1c0d031d0',
'./modules/Administration/Diagnostic.tpl' => '187755da9831dc3eedd0597df03b5b4d',
'./modules/Administration/DiagnosticDelete.php' => '3c4c57016ab9af8d9210f4066c0a6373',
'./modules/Administration/DiagnosticDownload.php' => 'adf38059f96a770e1f6f0e86c801a142',
'./modules/Administration/DiagnosticRun.php' => '03b55085e82e81362ca91a275a0cd84d',
@ -3689,10 +3698,10 @@ $md5_string = array (
'./modules/Administration/PDF/buttons.tpl' => '4e87ffb6b8826843f3cb222cfada0315',
'./modules/Administration/PDF/view.tpl' => '140212a6ce199fe89ae220027628081c',
'./modules/Administration/PDFSettings.php' => '4f30b105dd71eed4c92dcc390beda5b7',
'./modules/Administration/PasswordManager.php' => 'e997d11ecfbfe0352f863a814176efe9',
'./modules/Administration/PasswordManager.php' => 'db2a2eca793f1d7330af29a5f4ff52fd',
'./modules/Administration/PasswordManager.tpl' => '88d1898cf0bae5d3e053eb21ffc34ade',
'./modules/Administration/PasswordManagerSecurity.tpl' => '5010789c306f4c665e0ebe0466c9f50d',
'./modules/Administration/QuickRepairAndRebuild.php' => '44b428d870c178243326bbf1d51cb6dd',
'./modules/Administration/QuickRepairAndRebuild.php' => '14a4e14865732a12f4cbda21add1c8cc',
'./modules/Administration/RebuildAudit.php' => '7b1c137ae149d763e44053ae542a4432',
'./modules/Administration/RebuildConfig.php' => 'd1b925885ca4b6da62add9d26548c35c',
'./modules/Administration/RebuildDashlets.php' => 'e549bd62a92ffac96744a113a50835f0',
@ -3731,9 +3740,9 @@ $md5_string = array (
'./modules/Administration/SyncInboundEmailAccounts/SyncInboundEmailAccountsInvalidMethodTypeException.php' => 'd8465264b9d4c195aa1936552f93b5a7',
'./modules/Administration/SyncInboundEmailAccounts/SyncInboundEmailAccountsInvalidSubActionArgumentsException.php' => '0c7dccc07b1f188b0c9e0a2aa7e56a51',
'./modules/Administration/SyncInboundEmailAccounts/SyncInboundEmailAccountsNoMethodException.php' => 'f631b9edef8522ef9a897c47e77831fe',
'./modules/Administration/SyncInboundEmailAccounts/SyncInboundEmailAccountsPage.php' => '7c958075bb8dc2dde8b54db9519426c3',
'./modules/Administration/SyncInboundEmailAccounts/SyncInboundEmailAccountsSubActionHandler.php' => '0cc2feed6130ad15f81be89c352968b5',
'./modules/Administration/SyncInboundEmailAccounts.php' => '12d7e813df836c9791c0335e4f04bbe5',
'./modules/Administration/SyncInboundEmailAccounts/SyncInboundEmailAccountsPage.php' => '5ca9d5a6db5588469337b0be3267d66f',
'./modules/Administration/SyncInboundEmailAccounts/SyncInboundEmailAccountsSubActionHandler.php' => '899bd94ee1f6348798230e9654d1e6f3',
'./modules/Administration/SyncInboundEmailAccounts.php' => 'f8080077b58070025c9dda11561537f5',
'./modules/Administration/Updater.html' => '41dafda58b09eb9893644d0e6b13499f',
'./modules/Administration/Updater.php' => '8c6ed7adff356877fd3a52525e42f7fe',
'./modules/Administration/Upgrade.php' => '0923bd7f06f07a793d75099119a8a582',
@ -3755,9 +3764,9 @@ $md5_string = array (
'./modules/Administration/index.tpl' => 'e2267cd142b9509c13eaed32180e5e88',
'./modules/Administration/javascript/Administration.js' => '3548a43145e0b00b880d50fce62126f6',
'./modules/Administration/javascript/Async.js' => '7cda344ae778c0633b8941dcc6fd2bd6',
'./modules/Administration/language/en_us.lang.php' => 'd8ccac3816ffad28005a4a4ab0bbd0da',
'./modules/Administration/language/en_us.lang.php' => '634ef77b8cd3ef0bb22c7eb2c062e65e',
'./modules/Administration/metadata/SearchFields.php' => '678fb87cfc3b3e95d7e7ea8a72d8da16',
'./modules/Administration/metadata/adminpaneldefs.php' => 'f4a4741b7165c657d017869bdc10bc67',
'./modules/Administration/metadata/adminpaneldefs.php' => '31fee9f25c4a34fca0e18fed684af9fb',
'./modules/Administration/ncc_config.php' => '643e7a46ad14a6aed7431c6679362b95',
'./modules/Administration/repairDatabase.php' => '237183a42ea27d8a3fddccc3f448d8a6',
'./modules/Administration/repairSelectModule.php' => '9588bcfaff9028bf6849038f108079f1',
@ -4026,7 +4035,7 @@ $md5_string = array (
'./modules/CampaignTrackers/vardefs.php' => 'bc3f35b69c922008f5ed3f71d1e7e557',
'./modules/Campaigns/Campaign.php' => '83dda271352bdaf2c2741bd91e81e681',
'./modules/Campaigns/CampaignDiagnostic.html' => '60080d757c3e55758872387e86ad3b6a',
'./modules/Campaigns/CampaignDiagnostic.php' => '79c01f4b173f139a0b7eaa514128f37d',
'./modules/Campaigns/CampaignDiagnostic.php' => '838ca95c838d4648b198866503ded0ed',
'./modules/Campaigns/CaptchaValidate.php' => 'b3120831810a3081319b8b741104724f',
'./modules/Campaigns/Charts.php' => '0ec076f700155b1261e7fa8b9eb05093',
'./modules/Campaigns/Charts1.php' => '0e0f100a44c3d70add09f7cf978e63a4',
@ -4075,7 +4084,7 @@ $md5_string = array (
'./modules/Campaigns/WebToPersonCapture.php' => '27e24a36a16897c8a4fac043c8b85516',
'./modules/Campaigns/WizardCampaignSave.php' => 'f7a73bc932dcf289d4d5d94eee3ad138',
'./modules/Campaigns/WizardEmailSetup.html' => 'bdf9ae5e62512fba93fc6660ecc9bf64',
'./modules/Campaigns/WizardEmailSetup.php' => '5f7a49cf10fa319d90c32310a76fdce9',
'./modules/Campaigns/WizardEmailSetup.php' => '2a27180993e401a90335777939309d90',
'./modules/Campaigns/WizardEmailSetupSave.php' => '863bd22c85e4e401fab39c8c2464372b',
'./modules/Campaigns/WizardHome.html' => '347b5be091dfc343497a518fd5aae913',
'./modules/Campaigns/WizardHome.php' => 'ec5b6e745550bd1c61b1127dc96c4a12',
@ -4111,7 +4120,7 @@ $md5_string = array (
'./modules/Campaigns/tpls/WizardNewsletter.tpl' => '168198cad6b844c66c1f1b7bc0c0d7e3',
'./modules/Campaigns/tpls/campaign-inactive.tpl' => 'fa6ad86dabbbb0350649cdd48bda9801',
'./modules/Campaigns/tpls/progressStepsStyle.html' => '188a9323131c1665062b361e1a26df10',
'./modules/Campaigns/utils.php' => 'ec1404fdd8f9051b132b776b08472854',
'./modules/Campaigns/utils.php' => '30877564f0bc47a307586bbf0faf2c78',
'./modules/Campaigns/vardefs.php' => '3356dc662190231795ec344641c886ab',
'./modules/Campaigns/views/view.classic.php' => 'd3dd10e40e7e6a9d5d0168996c80792f',
'./modules/Campaigns/views/view.detail.php' => '21ab18453038a4f2ee5458eea0a94ed9',
@ -4494,7 +4503,7 @@ $md5_string = array (
'./modules/EmailAddresses/vardefs.php' => 'b812f8828d28cb7e09240773674f033a',
'./modules/EmailMan/EmailImage.php' => 'b48af6ba51f94bbb96a28008bd90522f',
'./modules/EmailMan/EmailMan.php' => '5e785f21cb6debd7139f0339be236e56',
'./modules/EmailMan/EmailManDelivery.php' => '389efe1bb53c7ae08e9620df8ee14139',
'./modules/EmailMan/EmailManDelivery.php' => 'e6b2c2d356c5e787f0a30919582f63ff',
'./modules/EmailMan/Forms.php' => 'd939f3555ef708f533a77c77b696ccd8',
'./modules/EmailMan/Menu.php' => '9fec01e70c034091a9fe652a61407886',
'./modules/EmailMan/action_view_map.php' => 'e4b8e3c021d90ed66c74caa7e1f8e4c5',
@ -4569,19 +4578,19 @@ $md5_string = array (
'./modules/Emails/Dashlets/MyEmailsDashlet/MyEmailsDashlet.meta.php' => '31dc1ea85cee70a8abab57f66cd77684',
'./modules/Emails/Dashlets/MyEmailsDashlet/MyEmailsDashlet.php' => 'ca55901c82bab1060a87e98af0ca524f',
'./modules/Emails/Delete.php' => '9c783f1e16850cfe4de22d719d7ce8ca',
'./modules/Emails/Email.php' => 'da0933084b76101c68fec1d4d355d78d',
'./modules/Emails/Email.php' => 'e79b83979c605cc261a93fdd855dee6c',
'./modules/Emails/EmailException.php' => '360377b7b2b00fc5d6bb9935c3c92a3f',
'./modules/Emails/EmailFromValidator.php' => '275e4e1167d68361483e18bae111fdc3',
'./modules/Emails/EmailUI.css' => '79ef2b93606dc4b6d4e04b679c0b898f',
'./modules/Emails/EmailUI.php' => 'f8b37b1db23d7baaa64d8eb4a99d2d02',
'./modules/Emails/EmailUI.php' => '7cc23aa2caa633911ea7db193a6f2a70',
'./modules/Emails/EmailUIAjax.php' => '474940d575ae666cd0b00437f75e76d4',
'./modules/Emails/EmailValidatorException.php' => 'cb225382f8842456d005769be4f3752d',
'./modules/Emails/EmailsController.php' => '9a70756105e5fba7221fd7d77f02ae45',
'./modules/Emails/EmailsController.php' => '08748fffab0b9bc0d757b8aee13a766a',
'./modules/Emails/EmailsControllerActionGetFromFields.php' => 'b9d8167b00bff53cf76503c5023207f7',
'./modules/Emails/EmailsDataAddress.php' => 'ba1274fe0f3bc27f4cb6d397adf42de7',
'./modules/Emails/EmailsDataAddressCollector.php' => '35e502fadb385a66d71bc44ddd62a259',
'./modules/Emails/EmailsDataAddressCollector.php' => '2ff867b7e4b76f10e983af57030ddd45',
'./modules/Emails/EmailsSignatureResolver.php' => '67c883763451b6ff65741fc0c3b1029e',
'./modules/Emails/Folder.php' => '7b869a8d8f462d08656cf5cd8005e1a5',
'./modules/Emails/Folder.php' => '1c15b4b4c6f541b65009384c1936bf0e',
'./modules/Emails/GenerateQuickComposeFrame.php' => 'b3c126bee579c9db56e11f3c3d3fdee0',
'./modules/Emails/Grab.php' => '95b21789d0a259bd4dff2e1e50752051',
'./modules/Emails/Menu.php' => '25ef132c32614fb9dff1c2ff9b399899',
@ -4616,10 +4625,10 @@ $md5_string = array (
'./modules/Emails/include/ListView/DeleteEmailAction.js' => 'f55735d833d2a77bea56b63e97d5d610',
'./modules/Emails/include/ListView/FoldersViewModal.js' => '3bd4d38fa4b6d5db35423005004d8d66',
'./modules/Emails/include/ListView/ImportEmailAction.js' => 'a658f8cb5a4bb0d17a635c7631fad088',
'./modules/Emails/include/ListView/ListViewDataEmails.php' => '0f4002220cfd3da8cc0ed9fab91cfb52',
'./modules/Emails/include/ListView/ListViewDataEmails.php' => '8838985127b9e0e08b33d6bb30063f99',
'./modules/Emails/include/ListView/ListViewDataEmailsSearchAbstract.php' => '0c79defa61814a8ad7d5c6607068ac6e',
'./modules/Emails/include/ListView/ListViewDataEmailsSearchOnCrm.php' => '4a61d87963a828e96aaae4a6305194d4',
'./modules/Emails/include/ListView/ListViewDataEmailsSearchOnIMap.php' => 'a41fb7a4a002db7e75bbc4f33f0b53db',
'./modules/Emails/include/ListView/ListViewDataEmailsSearchOnIMap.php' => 'd9c498549e2f25ff601f53854ce6b8ba',
'./modules/Emails/include/ListView/ListViewHeader.js' => 'a74d18ab45171fb85502d9777c6404d9',
'./modules/Emails/include/ListView/ListViewHeader.tpl' => '548957f43d54966db79f8c03127a8560',
'./modules/Emails/include/ListView/ListViewSmartyEmails.php' => 'b832e8aa4a47555934cdd5c292d716c0',
@ -4631,7 +4640,7 @@ $md5_string = array (
'./modules/Emails/include/displayIndicatorField.php' => '1fad0b67cf02e4d9d922915374851814',
'./modules/Emails/include/displaySubjectField.php' => '5586ded7c7471bfc36bb12397e0a68e7',
'./modules/Emails/javascript/Email.js' => 'eec2d71e9610ad46c94bc7ae9851c746',
'./modules/Emails/javascript/EmailUI.js' => '9bdd220de280920ba9ca09d0f94429f3',
'./modules/Emails/javascript/EmailUI.js' => '0d81e92bbc32af59c0e03c596e382489',
'./modules/Emails/javascript/EmailUICompose.js' => '47c90104973369fa9b454e614662a1a9',
'./modules/Emails/javascript/EmailUIShared.js' => 'dd25ff03a2af3d6f51d15892bb4e8e91',
'./modules/Emails/javascript/ajax.js' => '6c29f87276d59cd1ec23f246e7dd9432',
@ -4652,7 +4661,7 @@ $md5_string = array (
'./modules/Emails/metadata/detailviewdefs.php' => '0e6b0bc4f9e006978b6d33dc902a6779',
'./modules/Emails/metadata/editviewdefs.php' => 'ab93b79de12963a9ca0e112d50477958',
'./modules/Emails/metadata/importviewdefs.php' => '393b8a7c1f9d5b23bc75ce5d6dfdfc51',
'./modules/Emails/metadata/listviewdefs.php' => '6352a475112c82070f741f5f6386aff3',
'./modules/Emails/metadata/listviewdefs.php' => 'a5eb4fb66965e791efad9f4bf491ff3a',
'./modules/Emails/metadata/metafiles.php' => '9876f3a92c8fffb0b7d3aec6993c370d',
'./modules/Emails/metadata/nonimporteddetailviewdefs.php' => 'ae75f85d07dc926ff8a489cfad6c27a0',
'./modules/Emails/metadata/popupdefs.php' => 'ba85426b428b440975b08f5e9a016ece',
@ -4709,7 +4718,7 @@ $md5_string = array (
'./modules/Emails/views/view.detailnonimported.php' => '9db1a37dd52c269a3f98963379704a11',
'./modules/Emails/views/view.edit.php' => 'b550b1b4445d88eec112ae13ce5deae8',
'./modules/Emails/views/view.import.php' => 'c736c9992c0401643e8a15250bc7ce73',
'./modules/Emails/views/view.list.php' => 'c21e4087255556ec8e9038780d6591c5',
'./modules/Emails/views/view.list.php' => '27cd5ecc7b270683e629e702eef03430',
'./modules/Emails/views/view.popup.php' => '4ff1e52f105970c29fed966e2f058dd3',
'./modules/Emails/views/view.savedraftemail.php' => '000c8d786c87e0ad997fc5de443d9b2c',
'./modules/Emails/views/view.sendemail.php' => '78784b11ddb5257b0f3f5c59c9db17a1',
@ -4739,6 +4748,43 @@ $md5_string = array (
'./modules/Employees/views/view.detail.php' => '2914878ea39a317773d9619d18b7c5ef',
'./modules/Employees/views/view.edit.php' => 'af1290ff28c858906d705a21a0f9590d',
'./modules/Employees/views/view.list.php' => '3fac70b690d87e7e7dd95f5e2602d129',
'./modules/ExternalOAuthConnection/ExternalOAuthConnection.php' => 'cbb2e64b88e64434b92fd0fcbd8e2ac4',
'./modules/ExternalOAuthConnection/Menu.php' => '6ae8433d8a70354ed103bf6c9c227b8a',
'./modules/ExternalOAuthConnection/controller.php' => 'bfc8e833c3a36ac58f6ffa562573ae55',
'./modules/ExternalOAuthConnection/entrypoint/redirectToExternalOAuth.php' => '5c7689fab50bbb50b2b10c9a5bf497c8',
'./modules/ExternalOAuthConnection/entrypoint/setExternalOAuthToken.php' => '7b079da4660ddb159a9b529bd05905f8',
'./modules/ExternalOAuthConnection/js/authenticate.js' => '2f9c2092d9fe9735c3b860d693d87969',
'./modules/ExternalOAuthConnection/js/fields.js' => '41c33c39973e488bf1c34ada8305f433',
'./modules/ExternalOAuthConnection/language/en_us.lang.php' => '827b4374757a8a78b6a8c22d489e4e88',
'./modules/ExternalOAuthConnection/metadata/SearchFields.php' => 'fb3470c35919d6b84d0cdfb9f7290e3c',
'./modules/ExternalOAuthConnection/metadata/detailviewdefs.php' => '25b2cf0f9fc6d780b7f085efa4b85dda',
'./modules/ExternalOAuthConnection/metadata/editviewdefs.php' => '591963a075e340aa2b8462b6a2503a77',
'./modules/ExternalOAuthConnection/metadata/listviewdefs.php' => '71cf23498927393829df9ab78132ab96',
'./modules/ExternalOAuthConnection/metadata/metafiles.php' => '5cc48e251ba234ba9985072185d10c8c',
'./modules/ExternalOAuthConnection/metadata/searchdefs.php' => 'a2c59ab32c118fcf194bf0d22587f51e',
'./modules/ExternalOAuthConnection/metadata/subpaneldefs.php' => 'd6c6da8edcab19e164820493779963b3',
'./modules/ExternalOAuthConnection/provider/ExternalOAuthProviderConnector.php' => '6f2936a4d7161d29fae83110cf321131',
'./modules/ExternalOAuthConnection/provider/ExternalOAuthProviderConnectorInterface.php' => '6b49d82a98f9015cb2e40af139ab930e',
'./modules/ExternalOAuthConnection/provider/Generic/GenericOAuthProviderConnector.php' => 'aef335448cc29998d0a5feecad88d666',
'./modules/ExternalOAuthConnection/provider/Microsoft/MicrosoftOAuthProviderConnector.php' => '5a3fa092bdbdd57e5b33e9786624302a',
'./modules/ExternalOAuthConnection/services/OAuthAuthorizationService.php' => '98bd48935353a426768816b220700997',
'./modules/ExternalOAuthConnection/tpl/setToken.tpl' => '3001ed5ecb6ccfe3a967c1f3a45f042f',
'./modules/ExternalOAuthConnection/vardefs.php' => '10926d5ab08f56277f12ca8bb4fe644f',
'./modules/ExternalOAuthConnection/views/view.list.php' => 'bf6a7674a1b649099afa941fb7d2e0ba',
'./modules/ExternalOAuthProvider/ExternalOAuthProvider.php' => 'ff4f5725e6ea98b07c06317087b54d30',
'./modules/ExternalOAuthProvider/Menu.php' => '1d5f42e855c60778bb371e2451bd7c44',
'./modules/ExternalOAuthProvider/controller.php' => '4092c7ff3987c1df62c2180a0708c7de',
'./modules/ExternalOAuthProvider/language/en_us.lang.php' => '250b259d406bce7a9bf834e1b9a4c936',
'./modules/ExternalOAuthProvider/metadata/SearchFields.php' => '0238216ef6c3eb39b0a71e70bb58d592',
'./modules/ExternalOAuthProvider/metadata/detailviewdefs.php' => 'de6eaf9ac35fe3ae956553769281345d',
'./modules/ExternalOAuthProvider/metadata/editviewdefs.php' => 'ae452aa2d0eb15915882283766d41a33',
'./modules/ExternalOAuthProvider/metadata/listviewdefs.php' => '55d6f8fd42cfd23161cf72c2e9eef220',
'./modules/ExternalOAuthProvider/metadata/metafiles.php' => 'faee880023fe8aa5ee96680fffc52aaf',
'./modules/ExternalOAuthProvider/metadata/searchdefs.php' => 'fdd1f160af740c9519bb7bc6618e097d',
'./modules/ExternalOAuthProvider/metadata/subpaneldefs.php' => '7b74cbeac99be4dbe347dec438d65745',
'./modules/ExternalOAuthProvider/utils.php' => 'bcc88930505c62d88b0c4f9d51425401',
'./modules/ExternalOAuthProvider/vardefs.php' => 'f37309817977dfa9d68685cd62450208',
'./modules/ExternalOAuthProvider/views/view.list.php' => 'f521fd6146ff159ef6e3933713b84617',
'./modules/FP_Event_Locations/Dashlets/FP_Event_LocationsDashlet/FP_Event_LocationsDashlet.meta.php' => '1cc320528f655f9caf565c5202f27f08',
'./modules/FP_Event_Locations/Dashlets/FP_Event_LocationsDashlet/FP_Event_LocationsDashlet.php' => 'e59a23bd3847471f45e86ef0cb5e40dc',
'./modules/FP_Event_Locations/FP_Event_Locations.php' => 'f53d7a7f39aec1199b7637f05be58b6b',
@ -4939,30 +4985,46 @@ $md5_string = array (
'./modules/Import/views/view.step4.php' => '8694e2f07e6ddc9128af648d42aa802d',
'./modules/Import/views/view.undo.php' => '0f11a824c733c819214ef88f666358b5',
'./modules/InboundEmail/AOPInboundEmail.php' => '2c74ce41273c1982b221a8862dfcc997',
'./modules/InboundEmail/Delete.php' => 'e0672cbf0ad18846fb8303e8bd908629',
'./modules/InboundEmail/DetailView.html' => '9eec384f2d5c6409dae36b9b8abd9a3c',
'./modules/InboundEmail/DetailView.php' => '0e82f93d3caf1577d75e15eefb0bd598',
'./modules/InboundEmail/Delete.php' => '2dec384b7a0c8bc29bf2dcfdfc26506c',
'./modules/InboundEmail/EditGroupFolder.php' => 'd7c41e935f01bfe5b6ce52c2f0385c9b',
'./modules/InboundEmail/EditView.html' => '785f83b87c343cc1d8fbf27e5208472a',
'./modules/InboundEmail/EditView.php' => '220f324796e33920332b9b432c7a952f',
'./modules/InboundEmail/InboundEmail.js' => 'f37733f6ef00da52b9230d9168f13a29',
'./modules/InboundEmail/InboundEmail.php' => 'fa4e3077620acf2dd5359f494bd6a2f7',
'./modules/InboundEmail/ListView.html' => '8b0dd15b6993338cccd5bb39ae7184d4',
'./modules/InboundEmail/ListView.php' => 'dda0cffd64113ebf057d34ab35e637e6',
'./modules/InboundEmail/Menu.php' => 'eed62ccb742c392298bc1dfe9878eb97',
'./modules/InboundEmail/InboundEmail.js' => 'f5d19901b247cdc225a999b08204cf45',
'./modules/InboundEmail/InboundEmail.php' => '14c6126769c4e9afd7ae88e46c45e1c8',
'./modules/InboundEmail/Menu.php' => 'bfb4c000e482ae7206a9c0dea76acafe',
'./modules/InboundEmail/Overview.php' => 'e12117e0d20035b2c04dad6526783f07',
'./modules/InboundEmail/Popup.php' => '42167ecdc28380ccaefe89a3e5ab1a4d',
'./modules/InboundEmail/Save.php' => '100686ad555581fffc3e8f54fc8c999c',
'./modules/InboundEmail/Popup.php' => 'b37711aaab32543d3a6a1fb0386c679e',
'./modules/InboundEmail/PostSave.php' => 'bc1907c89fd2dc22e2ce13ada5f5c62a',
'./modules/InboundEmail/Save.php' => 'cac8ae11bba0f6d9512a835a81355d1a',
'./modules/InboundEmail/SaveGroupFolder.php' => '6894a715a39d2074b652a30a1463a430',
'./modules/InboundEmail/ShowInboundFoldersList.php' => '5b52d96db389a50cd7fbd6d2c1c9a952',
'./modules/InboundEmail/ShowInboundFoldersList.php' => '7c94ce6fa12d6e5ebefd5c1746e20662',
'./modules/InboundEmail/View.html' => 'aeaf0daf6157c5a74738a47145576ee0',
'./modules/InboundEmail/field_arrays.php' => '8daa51b73ea6499fbf2ab18767c0fe78',
'./modules/InboundEmail/index.php' => '22be0681c56292809306913fb48f3178',
'./modules/InboundEmail/language/en_us.lang.php' => 'bfa663d5408d00baaa1631d53ff123a2',
'./modules/InboundEmail/controller.php' => 'b41d298f9bb2ac68235d7a12f7714de8',
'./modules/InboundEmail/field_arrays.php' => '92ec96b7f8a11b5cb6a89892406c94b6',
'./modules/InboundEmail/js/auth_type_fields_toggle.js' => 'c7a860d744eb86c30a892a2277a2f673',
'./modules/InboundEmail/js/case_create_toggle.js' => '562861c813aeeff13ebbc12861ef360a',
'./modules/InboundEmail/js/distribution_toggle.js' => 'f138273ae9801f2e59350ac844097f67',
'./modules/InboundEmail/js/fields.js' => '3234a04a145438bad3d2560f2e3deb75',
'./modules/InboundEmail/js/fields_toggle.js' => '3e81efcbb518185f29a58f4f4cef3eac',
'./modules/InboundEmail/js/mail_folders.js' => '365df2f5552c3ca4fb83338920db1617',
'./modules/InboundEmail/js/owner_toggle.js' => '439227988acf9cddae78496d4ffe3fd6',
'./modules/InboundEmail/js/panel_toggle.js' => '9f939fcd54b840e766ad90e903dc2445',
'./modules/InboundEmail/js/ssl_port_set.js' => 'f44377e9d154de21127af16b31fd5418',
'./modules/InboundEmail/js/test_configuration.js' => 'c6698de64dcea19490323d074aab6dc8',
'./modules/InboundEmail/language/en_us.lang.php' => 'cfa041c826f2607e34bd7a0ec150bf26',
'./modules/InboundEmail/metadata/SearchFields.php' => '6f2e27a576a956001693c7af731539dc',
'./modules/InboundEmail/metadata/detailviewdefs.php' => 'eac3ee94aecb8d0ade34281f6aab1bb4',
'./modules/InboundEmail/metadata/editviewdefs.php' => 'c21d08248f7ea73f1595c1c074679b8a',
'./modules/InboundEmail/metadata/listviewdefs.php' => '1c2356b61d6a96ec253251df20849673',
'./modules/InboundEmail/metadata/metafiles.php' => '8fcde39fad982363c862e4fbf53eb35e',
'./modules/InboundEmail/metadata/searchdefs.php' => '28102b46db74ae6a90fcb93d70cc1cba',
'./modules/InboundEmail/metadata/subpaneldefs.php' => 'd177016155e0874dd6a4791f1fb35e76',
'./modules/InboundEmail/temp.php' => '181b066ddeb4e0acbd93ec891ab2fb6f',
'./modules/InboundEmail/tpls/checkImap.tpl' => 'e6ffd2a625f24091435894426d47016c',
'./modules/InboundEmail/tpls/systemSettingsForm.tpl' => 'f9fd7244167a1822c4673637ba9db2ba',
'./modules/InboundEmail/vardefs.php' => '98bea685916f0a87055942750906e953',
'./modules/InboundEmail/utils.php' => '1f5c1737a6682c63c60aa6270d99d8ed',
'./modules/InboundEmail/vardefs.php' => 'f5222a3d914a052c979391357d92168a',
'./modules/InboundEmail/views/view.detail.php' => 'c542825b80e41328a0fee82baa891873',
'./modules/InboundEmail/views/view.edit.php' => '7325f9bae56b6fa44a15bbdfa01e09bf',
'./modules/InboundEmail/views/view.list.php' => '0e9f5d43a7400362cee323a7bc332b94',
'./modules/LabelEditor/EditView.html' => 'fe93e6a7e2174ae321be14378465dfa2',
'./modules/LabelEditor/EditView.php' => 'cdec2e48a8882ecdd8d32b508390ba2f',
'./modules/LabelEditor/Forms.php' => 'baf0abfa37e381f3bebb62a873304f1f',
@ -5091,7 +5153,7 @@ $md5_string = array (
'./modules/MergeRecords/Menu.php' => 'adeb546c41b28fcde1b26c0e79993212',
'./modules/MergeRecords/Merge.js' => 'c946baecd2cea038c1c7dc05d39ec159',
'./modules/MergeRecords/MergeField.html' => 'e922f12b0857d30cc780d9a9602deadd',
'./modules/MergeRecords/MergeRecord.php' => '994b83feb69353895bb2233fe5ac7c3b',
'./modules/MergeRecords/MergeRecord.php' => 'dfdca4a622af8fca66135ba64561bfb4',
'./modules/MergeRecords/SaveMerge.php' => '675144d12d12c459180418739f16ee69',
'./modules/MergeRecords/SearchForm.html' => 'bd7522bd9e435d7ba158d9ec8b0476e0',
'./modules/MergeRecords/Step1.html' => '2835549086784cde9d01e493766f64b4',
@ -5374,22 +5436,32 @@ $md5_string = array (
'./modules/OptimisticLock/language/en_us.lang.php' => '281cfcb6abc4854f792867d135927942',
'./modules/OutboundEmailAccounts/Dashlets/OutboundEmailAccountsDashlet/OutboundEmailAccountsDashlet.meta.php' => '564160df3adaa9773a86a2a244df28a2',
'./modules/OutboundEmailAccounts/Dashlets/OutboundEmailAccountsDashlet/OutboundEmailAccountsDashlet.php' => '22ef1ad6261d81c6c1b28409629a3d0a',
'./modules/OutboundEmailAccounts/OutboundEmailAccounts.php' => 'cc7bccd0ed8d8ec335b1d4e9a28e2ccc',
'./modules/OutboundEmailAccounts/OutboundEmailAccounts_sugar.php' => '2db44e3dff97dd2498c9621b4718bae7',
'./modules/OutboundEmailAccounts/language/en_us.lang.php' => '9b9becdbac51bb11ec5009007f7aa682',
'./modules/OutboundEmailAccounts/metadata/SearchFields.php' => 'b1d3821e188938066156f0c85d4e37fe',
'./modules/OutboundEmailAccounts/Menu.php' => 'ba722ed3aadca9ab1b969b70b9fbb519',
'./modules/OutboundEmailAccounts/OutboundEmailAccounts.php' => 'a3381c6d65dbbf0e7fb4d7d4c687ef4b',
'./modules/OutboundEmailAccounts/OutboundEmailAccounts_sugar.php' => '20b589d798825ca87ddc5456bcb96ff2',
'./modules/OutboundEmailAccounts/controller.php' => '7ca3815b742cdd6c05566610b4d77171',
'./modules/OutboundEmailAccounts/js/fields.js' => '07c9e6fb4762f099f79477d27f562439',
'./modules/OutboundEmailAccounts/js/owner_toggle.js' => '8e5defb59d799779164997733f7991c5',
'./modules/OutboundEmailAccounts/js/smtp_auth_toggle.js' => 'b0d4e2ad9d7a92eb57702613d67dfedd',
'./modules/OutboundEmailAccounts/js/ssl_port_set.js' => '97d8f0bef082f24e9fb2dd0d9446c626',
'./modules/OutboundEmailAccounts/language/en_us.lang.php' => 'ea2f58968b90e3e6996e236d2542c499',
'./modules/OutboundEmailAccounts/metadata/SearchFields.php' => '8c105dc9670943e3677c33ef51b4a61e',
'./modules/OutboundEmailAccounts/metadata/dashletviewdefs.php' => '93e262245007ffc79f1ff9938e8bbac9',
'./modules/OutboundEmailAccounts/metadata/detailviewdefs.php' => '948df4801e3d229ea4bac06e247fd643',
'./modules/OutboundEmailAccounts/metadata/editviewdefs.php' => 'f28a1bf18ca13bcfe8229c1d5fa6eee4',
'./modules/OutboundEmailAccounts/metadata/listviewdefs.php' => '82a5ef5ac3d3c79f653e91f2b2b4a7b8',
'./modules/OutboundEmailAccounts/metadata/detailviewdefs.php' => '7e4c8f1bfbd71405a426a403cf820c3f',
'./modules/OutboundEmailAccounts/metadata/editviewdefs.php' => '37225d9f8027552f058bb386de7bc5dc',
'./modules/OutboundEmailAccounts/metadata/listviewdefs.php' => '428a7fcfcac94e9e1875629f2d898f92',
'./modules/OutboundEmailAccounts/metadata/metafiles.php' => 'd163cfdaa7fa3d697326f798bbcc6867',
'./modules/OutboundEmailAccounts/metadata/popupdefs.php' => '3464601d89e63838c93f7bfcd2142eec',
'./modules/OutboundEmailAccounts/metadata/popupdefs.php' => 'ccb60aa6a4e11726dab4e1bc99000b34',
'./modules/OutboundEmailAccounts/metadata/quickcreatedefs.php' => 'c738540479456935212e6b806706002a',
'./modules/OutboundEmailAccounts/metadata/searchdefs.php' => '76ceb98b2e64281d411caec3e3bfed07',
'./modules/OutboundEmailAccounts/metadata/studio.php' => 'd1a4aee4586f29bc1d22f2719b156bd1',
'./modules/OutboundEmailAccounts/metadata/subpaneldefs.php' => '5928a4543d2c06d6ba9e032e01fc5081',
'./modules/OutboundEmailAccounts/metadata/subpanels/default.php' => 'a58b6710e2acc338ef0712175eb95cf5',
'./modules/OutboundEmailAccounts/smtpPreselection.tpl' => 'f3d86727a10f3fd50e16fa88769478fd',
'./modules/OutboundEmailAccounts/vardefs.php' => '07d0609b4814572d07a781fb75c5e70a',
'./modules/OutboundEmailAccounts/vardefs.php' => '1e9b9038a810365377df4f7beabfc152',
'./modules/OutboundEmailAccounts/views/view.detail.php' => 'c71af76cd203a164fe5a99e7c0f8db10',
'./modules/OutboundEmailAccounts/views/view.edit.php' => '3fe1866151f37a6a42b9a224b1b65876',
'./modules/OutboundEmailAccounts/views/view.list.php' => 'e2b1a1bd2a9a517fe5eb0bf17f6cf4d5',
'./modules/Project/Dashlets/MyProjectDashlet/MyProjectDashlet.data.php' => 'cece42df3c32ba5e9670cbdc7edefd0e',
'./modules/Project/Dashlets/MyProjectDashlet/MyProjectDashlet.meta.php' => 'f77f6be351839075a309369c4f307877',
'./modules/Project/Dashlets/MyProjectDashlet/MyProjectDashlet.php' => 'e86a9ace71623a867f5e87adc31121e1',
@ -5504,7 +5576,7 @@ $md5_string = array (
'./modules/ProspectLists/Save.php' => '9b3bad7aff47a312451e34a44f63fee8',
'./modules/ProspectLists/SubPanelView.html' => '12a8e783bd44a156e193bc1be8247cda',
'./modules/ProspectLists/SubPanelView.php' => 'c2f9c067fc5a8b04272ea96b2b865ddc',
'./modules/ProspectLists/TargetListUpdate.php' => '6352f71bf03f199ddd91f3ae64371169',
'./modules/ProspectLists/TargetListUpdate.php' => 'fb273882f80b2dacdcb28239ddfe8e97',
'./modules/ProspectLists/field_arrays.php' => '42da48c616f237ba884f341a4551fe26',
'./modules/ProspectLists/language/en_us.lang.php' => '1ab6bf758e61bbd13edf2afb01ab9273',
'./modules/ProspectLists/metadata/SearchFields.php' => 'f7608542836f425b5cfdbfe00b739aff',
@ -5683,7 +5755,7 @@ $md5_string = array (
'./modules/Spots/ShowSpots.php' => 'dc81e1537a1d3d3d8a2d063f84184af1',
'./modules/Spots/Spots.php' => 'a707ccbea20d9e14c12fc8a88a5e57a6',
'./modules/Spots/SpotsListViewSmarty.php' => 'ec027fa39cee8950725bb157729b66d0',
'./modules/Spots/controller.php' => '324cd1f78df1e6e48c693803d74494fc',
'./modules/Spots/controller.php' => 'ca2928ff26f679beb52d16e4c08f95e9',
'./modules/Spots/language/en_us.lang.php' => '72b4e079d7757eb0547316da3a508191',
'./modules/Spots/metadata/SearchFields.php' => 'f716711d5b9fd7aa06ac3ba79454a00d',
'./modules/Spots/metadata/dashletviewdefs.php' => 'b780c4bbdd632f137e0ff8b672d7fc17',
@ -5712,13 +5784,13 @@ $md5_string = array (
'./modules/Studio/TabGroups.php' => '0b53258e874bf76af6ba4e698fe1faf2',
'./modules/Studio/config.php' => 'ffcfb2aaf49f4c2735abdbd8116db4b3',
'./modules/Studio/language/en_us.lang.php' => 'e5d8138b1cb0465f26e362de69a02b51',
'./modules/Studio/parsers/StudioParser.php' => '3df803d50e322cea269673d0f6c5470d',
'./modules/Studio/parsers/StudioParser.php' => 'dbd08a554f38f79d34a44e36c6477dc8',
'./modules/Studio/studio.js' => '4fb625bbde873e47be7230e1fd1bb067',
'./modules/Studio/studiodd.js' => '88e575cd322889b4d300152eb11bc3ee',
'./modules/Studio/studiotabgroups.js' => '612e25ce77d7bb265511698814e7f03c',
'./modules/Studio/wizard.php' => '6b65a4ab3c4bea9b981d46cea203ecbf',
'./modules/Studio/wizards/EditDropDownWizard.php' => 'c70983bbbb5f7ca928a64a7c571a69d8',
'./modules/Studio/wizards/RenameModules.php' => '264e7c1b70d9dce1dba021f1be2d5e01',
'./modules/Studio/wizards/EditDropDownWizard.php' => '3a9ac695701a4c1f9ef892f533d28f92',
'./modules/Studio/wizards/RenameModules.php' => '330fd7843edf5f764f4311d40bdf90cf',
'./modules/Studio/wizards/RenameModules.tpl' => '9c2a4a726f39081a0b574990bb63a5da',
'./modules/Studio/wizards/StudioWizard.php' => 'df3f9698f44033c0ef8475efa9975758',
'./modules/Studio/ygDDListStudio.js' => '149762df3f1f2648f44a06af06480030',
@ -5827,7 +5899,7 @@ $md5_string = array (
'./modules/Surveys/Entry/SurveySubmit.php' => '973c1a318b9a9d95d72d56037b68c04f',
'./modules/Surveys/Entry/Thanks.php' => '6eff234e04438f049e4e4b9d8758f633',
'./modules/Surveys/Lines/Lines.php' => '0332378d16368686f29d959eac1842ed',
'./modules/Surveys/Menu.php' => 'ecfbb08b99bb8e379eecd436b4922856',
'./modules/Surveys/Menu.php' => 'ba18e736af4a1d2a261fbf67d3f174b2',
'./modules/Surveys/Surveys.php' => 'e9d5c639799ac830281414c7f38d1272',
'./modules/Surveys/Utils/utils.php' => 'a83853c0fe095b0c2d6b2296a0d9ab42',
'./modules/Surveys/controller.php' => '0dd5f1a9f4feca78ee0d64f124f47285',
@ -5982,7 +6054,7 @@ $md5_string = array (
'./modules/Users/LoggedOut.tpl' => '9537c8e192b86a038ba3177d9e2fdff1',
'./modules/Users/Login.php' => 'efa7ccf3e685d1dcdfaf7b34baebd134',
'./modules/Users/Logout.php' => 'dd93eeb56baa9fa101b8237da3c7ec99',
'./modules/Users/Menu.php' => 'a422cdd4f82ca22cdb0c9a4da07a1b24',
'./modules/Users/Menu.php' => '452985da4fc294ef9be055ddf363253b',
'./modules/Users/PasswordRequirementBox.css' => '836245343f059e04a8bcf40eed8672cc',
'./modules/Users/PasswordRequirementBox.js' => 'e6ebfc550a17aa8bf9249cb528b018bd',
'./modules/Users/PopupSignature.php' => 'da9e47509bcbc63d0a32a6896d446f8f',
@ -6026,7 +6098,7 @@ $md5_string = array (
'./modules/Users/entryPointSaveGoogleApiKey.php' => 'af2395a659fbe4c935ac555e4f3b592b',
'./modules/Users/field_arrays.php' => 'b2de6918c313caef59c28582475ab3a6',
'./modules/Users/googleApiKeySaverEntryPointError.tpl' => '5b45b5ce045c459e3e6c571d43eef873',
'./modules/Users/language/en_us.lang.php' => '7cf5849bd441e65eb84ae48067c4a47b',
'./modules/Users/language/en_us.lang.php' => '6300b22349c2b3ee79d98d856c44f694',
'./modules/Users/login.css' => '2c43ea9ba2bed908c545bde7ee7c4575',
'./modules/Users/login.js' => 'f54ae3775635f5cf93b7854e6dde656d',
'./modules/Users/login.tpl' => '76e56647f4334e8ee80ec2defa4d1659',
@ -6054,7 +6126,7 @@ $md5_string = array (
'./modules/Users/password_utils.php' => 'c445ba371decfae7afb76ad09c060e8a',
'./modules/Users/reassignUserRecords.php' => '0db6428f348ea8ab23a1bd88a5725339',
'./modules/Users/tpls/DetailView.tpl' => '2b5edc433a18eab9e1dc24f55c015ced',
'./modules/Users/tpls/EditViewFooter.tpl' => '3468ee673ada79bdb8129aeca2a739b6',
'./modules/Users/tpls/EditViewFooter.tpl' => '09e287fec2fef683c1aedd71598e52e5',
'./modules/Users/tpls/EditViewGroup.tpl' => '97bbb48546d0b13a60dac111abb8358a',
'./modules/Users/tpls/EditViewHeader.tpl' => '099f5e4896d623b64d44f243c33941b2',
'./modules/Users/tpls/QuickEditFooter.tpl' => 'b7a9c930f9e885fcc51b7da358411c31',
@ -6215,7 +6287,7 @@ $md5_string = array (
'./modules/vCals/vCal.php' => 'e20c0d7ec2b900ce37c8d621db8835ad',
'./modules/vCals/vardefs.php' => 'aa722f4d5a1fa352bc808da9fce072bd',
'./pdf.php' => '9c17ce70f633f699b8f5accd104f7e67',
'./php_version.php' => '928257f676637cf31a03032c3e661e27',
'./php_version.php' => 'b22ff00eccf1b700d0ff2fe495a12e65',
'./phpcs.xml' => '49c142cb59dc75e074493c3718b42528',
'./robots.txt' => 'fce2c714b591aa9b36ed1e1b1d8ef900',
'./run_job.php' => 'f790368883c1f979df13359bde217944',
@ -6254,7 +6326,7 @@ $md5_string = array (
'./service/v3/rest.php' => 'e972697761509f2ac0caca7e0db74fe4',
'./service/v3/soap.php' => '9b15d3b080a2d27256b7e3c0094e882a',
'./service/v3_1/SugarWebServiceImplv3_1.php' => '8aada8ef2732e366319e8f98779bbee3',
'./service/v3_1/SugarWebServiceUtilv3_1.php' => 'ee1179dd3cc6f121652c93717095595e',
'./service/v3_1/SugarWebServiceUtilv3_1.php' => 'd81be16dc13e28aa64a27ef01fb0b206',
'./service/v3_1/registry.php' => 'c7690074b2106e368881e0fb7f728fcf',
'./service/v3_1/rest.php' => '3607b4865ee496046f1a6583f40c23e7',
'./service/v3_1/soap.php' => 'cedfe09f86b6a9e921940924786d68e9',
@ -6277,12 +6349,12 @@ $md5_string = array (
'./soap/SoapPortalUsers.php' => '49a5b68e0cd8ecec6dce4ecc155a4629',
'./soap/SoapRelationshipHelper.php' => '37d9a8052ff34d9197ce121c19c5bd0e',
'./soap/SoapStudio.php' => '321282965d0108d7198a22d98b9b52fe',
'./soap/SoapSugarUsers.php' => '24b1d06f162af2c641ec6cda2fe025f2',
'./soap/SoapSugarUsers.php' => '6480c73b0988eff5c512570aa511de29',
'./soap/SoapTypes.php' => '6620161d7b9c96ac37df5f9d04a7118d',
'./soap.php' => 'e28988c2e0b8e2c484587b537a710525',
'./sugar_version.json' => 'bdfbcefae2f9af559bef6a36367df7bb',
'./sugar_version.php' => 'db7b6c8d51f87879fce1e6172eedfbed',
'./suitecrm_version.php' => 'e2ddbf9c955577640332b6c21101478a',
'./suitecrm_version.php' => '01090b9e33bc845e4138231c914b133e',
'./themes/SuiteP/css/Dawn/color-palette.scss' => 'e64677d79e1d68c069bdc2dc661c4f99',
'./themes/SuiteP/css/Dawn/icons.scss' => 'd59f8c5855e7a8df09542a663835a196',
'./themes/SuiteP/css/Dawn/select.ico' => '22393ad23f16c3f1462455bae8f20279',
@ -7707,7 +7779,7 @@ $md5_string = array (
'./themes/SuiteP/include/EditView/header.tpl' => '132ace198c0a390b2000408fdde3457f',
'./themes/SuiteP/include/EditView/tab_panel_content.tpl' => 'e74279dc0e6d4185121b699d9d76750f',
'./themes/SuiteP/include/ListView/ListViewDCMenu.tpl' => 'bc847c86bae071f507e486acfd05fa31',
'./themes/SuiteP/include/ListView/ListViewGeneric.tpl' => '39476db9d89d53d776fe5833d3a33eec',
'./themes/SuiteP/include/ListView/ListViewGeneric.tpl' => '67001b6016d7a4065d33cbeed3e049d1',
'./themes/SuiteP/include/ListView/ListViewNoMassUpdate.tpl' => '4f238f8e41ce9479193be0cf537728a6',
'./themes/SuiteP/include/ListView/ListViewPagination.tpl' => '80ff62f8b828bde2ee846d42206dc00f',
'./themes/SuiteP/include/ListView/ListViewPaginationBottom.tpl' => '11147ef51e845a60fe1b29ab1b304d2b',
@ -7748,7 +7820,7 @@ $md5_string = array (
'./themes/SuiteP/modules/Meetings/tpls/header.tpl' => '33fd4689fc13c9aacc72008edbfdede1',
'./themes/SuiteP/modules/ModuleBuilder/tpls/includes.tpl' => '168d710713885364a3834143d23ef129',
'./themes/SuiteP/modules/ModuleBuilder/tpls/layoutView.tpl' => 'b74115723b4ed2c26563b857bb6fc413',
'./themes/SuiteP/modules/SavedSearch/SavedSearchForm.tpl' => 'f9a26d05295563e6ef7dd649307dd688',
'./themes/SuiteP/modules/SavedSearch/SavedSearchForm.tpl' => 'a0add8999a51448085ac82f092d9441a',
'./themes/SuiteP/modules/Studio/TabGroups/EditViewTabs.tpl' => '8a66a691000f7b9af5caed0a71f43eb5',
'./themes/SuiteP/modules/Users/tpls/DetailView-advanced-tab-content.tpl' => 'c58912bb9157ca237992f13bc5cd82f5',
'./themes/SuiteP/modules/Users/tpls/DetailView.tpl' => '6c83f2aead0405c152b2ff9936b65d33',

View file

@ -65,6 +65,12 @@ class DetailView extends ListView
/**
* @param string $html_varName
* @param SugarBean $seed
* @param int $offset
* @return SugarBean
*/
public function processSugarBean($html_varName, $seed, $offset)
{
global $row_count, $sugar_config;
@ -152,27 +158,11 @@ class DetailView extends ListView
$db_offset=$offset-1;
$this->populateQueryWhere($isFirstView, $html_varName);
if (ACLController::requireOwner($seed->module_dir, 'view')) {
global $current_user;
$seed->getOwnerWhere($current_user->id);
if (!empty($this->query_where)) {
$this->query_where .= ' AND ';
}
$this->query_where .= $seed->getOwnerWhere($current_user->id);
$accessWhere = $seed->buildAccessWhere('view');
if (!empty($accessWhere)) {
$this->query_where .= empty($this->query_where) ? $accessWhere : ' AND ' . $accessWhere;
}
/* BEGIN - SECURITY GROUPS */
if (ACLController::requireSecurityGroup($seed->module_dir, 'view')) {
require_once('modules/SecurityGroups/SecurityGroup.php');
global $current_user;
$owner_where = $seed->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere($seed->table_name, $seed->module_dir, $current_user->id);
if (empty($this->query_where)) {
$this->query_where = " (".$owner_where." or ".$group_where.")";
} else {
$this->query_where .= " AND (".$owner_where." or ".$group_where.")";
}
}
/* END - SECURITY GROUPS */
$order = $this->getLocalSessionVariable($seed->module_dir.'2_'.$html_varName, "ORDER_BY");
$orderBy = '';

View file

@ -936,7 +936,7 @@ class EditView
//if popup select add panel if user is a member of multiple groups to metadataFile
global $sugar_config;
if(isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true
&& empty($this->focus->fetched_row['id']) && $this->focus->module_dir != "Users" && $this->focus->module_dir != "SugarFeed") {
&& (empty($this->focus->fetched_row['id']) || $_REQUEST['isDuplicate'] == true) && $this->focus->module_dir != "Users" && $this->focus->module_dir != "SugarFeed") {
//there are cases such as uploading an attachment to an email template where the request module may
//not be the same as the current bean module. If that happens we can just skip it

File diff suppressed because it is too large Load diff

View file

@ -894,4 +894,156 @@ class ImapHandler implements ImapHandlerInterface
return $ret;
}
/**
* @param $stream
* @return bool
*/
public function isValidStream($stream): bool
{
return is_resource($stream);
}
/**
* @inheritDoc
*/
public function getMessageList(
?string $filterCriteria,
$sortCriteria,
$sortOrder,
int $offset,
int $pageSize,
array &$mailboxInfo,
array $columns
): array {
if (empty($filterCriteria) && $sortCriteria === SORTDATE) {
// Performance fix when no filters are enabled
$totalMsgs = $this->getNumberOfMessages();
$mailboxInfo['Nmsgs'] = $totalMsgs;
if ($sortOrder === 0) {
// Ascending order
if ($offset === "end") {
$firstMsg = $totalMsgs - (int)$pageSize;
$lastMsg = $totalMsgs;
} elseif ($offset <= 0) {
$firstMsg = 1;
$lastMsg = $firstMsg + (int)$pageSize;
} else {
$firstMsg = (int)$offset;
$lastMsg = $firstMsg + (int)$pageSize;
}
} else {
// Descending order
if ($offset === "end") {
$firstMsg = 1;
$lastMsg = $firstMsg + (int)$pageSize;
} elseif ($offset <= 0) {
$firstMsg = $totalMsgs - (int)$pageSize;
$lastMsg = $totalMsgs;
} else {
$offset = ($totalMsgs - (int)$offset) - (int)$pageSize;
$firstMsg = $offset;
$lastMsg = $firstMsg + (int)$pageSize;
}
}
$firstMsg = $firstMsg < 1 ? 1 : $firstMsg;
$firstMsg = $firstMsg > $totalMsgs ? $totalMsgs : $firstMsg;
$lastMsg = $lastMsg < $firstMsg ? $firstMsg : $lastMsg;
$lastMsg = $lastMsg > $totalMsgs ? $totalMsgs : $lastMsg;
$sequence = $firstMsg . ':' . $lastMsg;
$emailSortedHeaders = $this->fetchOverview($sequence);
$uids = [];
if (!empty($emailSortedHeaders)) {
$uids = array_map(
function ($x) {
return $x->uid;
},
$emailSortedHeaders // TODO: this should be an array!
);
}
} else {
// Filtered case and other sorting cases
// Returns an array of msgno's which are sorted and filtered
$emailSortedHeaders = $this->sort(
$sortCriteria,
$sortOrder,
SE_UID,
$filterCriteria
);
if ($emailSortedHeaders === false) {
return [];
}
$uids = array_slice($emailSortedHeaders, $offset, $pageSize);
$lastSequenceNumber = $mailboxInfo['Nmsgs'] = count($emailSortedHeaders);
// paginate
if ($offset === "end") {
$offset = $lastSequenceNumber - $pageSize;
} elseif ($offset <= 0) {
$offset = 0;
}
}
if (empty($uids)) {
return [];
}
// TODO: uids could be invalid for implode!
$uids = implode(',', $uids);
// Get result
$emailHeaders = $this->fetchOverview(
$uids,
FT_UID
);
$emailHeaders = json_decode(json_encode($emailHeaders), true);
if (isset($columns['has_attachment'])) {
// get attachment status
foreach ($emailHeaders as $i => $emailHeader) {
$structure = $this->fetchStructure($emailHeader['uid'], FT_UID);
$emailHeaders[$i]['has_attachment'] = $this->messageStructureHasAttachment($structure);
}
}
return $emailHeaders;
}
/**
* @param $structure
* @return bool
*/
public function messageStructureHasAttachment($structure): bool
{
if (($structure->type !== 0) && ($structure->type !== 1)) {
return true;
}
$attachments = [];
if (empty($structure->parts)) {
return false;
}
foreach ($structure->parts as $i => $part) {
if (empty($part) || empty($part->dparameters[0])) {
continue;
}
if (is_string($part->dparameters[0]->value)) {
$attachments[] = $part->dparameters[0]->value;
}
}
return !empty($attachments);
}
}

View file

@ -43,6 +43,7 @@ if (!defined('sugarEntry') || !sugarEntry) {
}
require_once __DIR__ . '/ImapHandler.php';
require_once __DIR__ . '/Imap2Handler.php';
require_once __DIR__ . '/ImapHandlerException.php';
/**
@ -187,16 +188,15 @@ class ImapHandlerFactory
}
/**
*
* @global array $sugar_config
* @param string $testSettings
* Get Handler
* @param string|null $testSettings
* @return ImapHandlerInterface
* @throws ImapHandlerException
*/
public function getImapHandler($testSettings = null)
public function getImapHandler(string $testSettings = null, string $handlerType = 'native' )
{
if (null === $this->interfaceObject) {
global $sugar_config;
global $sugar_config, $log;
$test = (isset($sugar_config['imap_test']) && $sugar_config['imap_test']) || $testSettings;
$charset = (isset($sugar_config['default_email_charset'])) ? $sugar_config['default_email_charset'] : null;
@ -209,7 +209,8 @@ class ImapHandlerFactory
$logCalls = false;
}
$interfaceClass = ImapHandler::class;
$interfaceClass = $this->getHandlerClass($handlerType);
$log->fatal('Using imap handler class: ' . $interfaceClass);
if ($test) {
$this->loadTestSettings($testSettings);
} else {
@ -218,4 +219,46 @@ class ImapHandlerFactory
}
return $this->interfaceObject;
}
/**
* Check if all handlers are available
* @return bool
*/
public function areAllHandlersAvailable(): bool {
foreach ($this->getHandlers() as $handlerClass) {
$available = (new $handlerClass())->isAvailable();
if ($available === false) {
return false;
}
}
return true;
}
/**
* Get Handler
* @param string $handlerType
* @return string
*/
protected function getHandlerClass(string $handlerType): string
{
$handlers = $this->getHandlers();
if (!empty($handlers[$handlerType])) {
return $handlers[$handlerType];
}
return ImapHandler::class;
}
/**
* @return ImapHandlerInterface[]
*/
protected function getHandlers(): array
{
return [
'native' => ImapHandler::class,
'imap2' => Imap2Handler::class,
];
}
}

View file

@ -489,4 +489,30 @@ class ImapHandlerFake implements ImapHandlerInterface
{
return $this->fakes->call('utf8', [$mime_encoded_text]);
}
/**
* @param $stream
* @return bool
* @throws Exception
*/
public function isValidStream($stream): bool
{
return $this->fakes->call('isValidStream', [$stream]);
}
/**
* @param string|null $filterCriteria
* @param $sortCriteria
* @param $sortOrder
* @param int $offset
* @param int $pageSize
* @param array $mailboxInfo
* @param array $columns
* @return array
* @throws Exception
*/
public function getMessageList(?string $filterCriteria, $sortCriteria, $sortOrder, int $offset, int $pageSize, array &$mailboxInfo, array $columns): array
{
return $this->fakes->call('getMessageList', [$filterCriteria, $sortCriteria, $sortOrder, $offset, $pageSize, $mailboxInfo, $columns]);
}
}

View file

@ -57,6 +57,12 @@ interface ImapHandlerInterface
*/
public function isAvailable();
/**
* @param $stream mixed
* @return bool
*/
public function isValidStream($stream): bool;
/**
*
* @return string|boolean
@ -110,7 +116,7 @@ interface ImapHandlerInterface
/**
*
* @return resource|boolean
* @return mixed
*/
public function getConnection();
@ -356,4 +362,25 @@ interface ImapHandlerInterface
* @return bool Returns TRUE on success or FALSE on failure.
*/
public function mailMove($msglist, $mailbox, $options = 0);
/**
* @param string|null $filterCriteria
* @param $sortCriteria
* @param $sortOrder
* @param int $offset
* @param int $pageSize
* @param array $mailboxInfo
* @param array $columns
* @return array
* @throws ImapHandlerException
*/
public function getMessageList(
?string $filterCriteria,
$sortCriteria,
$sortOrder,
int $offset,
int $pageSize,
array &$mailboxInfo,
array $columns
): array;
}

View file

@ -69,6 +69,7 @@ class ListViewSmarty extends ListViewDisplay
public $showMassupdateFields = true;
public $menu_location = 'top';
public $templateMeta = array();
public $displayEmptyDataMessages = null;
/**
* Constructor, Smarty object immediately available after
@ -311,7 +312,11 @@ class ListViewSmarty extends ListViewDisplay
'of' => $app_strings['LBL_LIST_OF']);
$this->ss->assign('navStrings', $navStrings);
$displayEmptyDataMessages = true;
if ($this->displayEmptyDataMessages === null) {
$displayEmptyDataMessages = true;
} else {
$displayEmptyDataMessages = $this->displayEmptyDataMessages;
}
//TODO: Cleanup, better logic for which modules are exempt from the new messaging.
$modulesExemptFromEmptyDataMessages = array('WorkFlow','ContractTypes', 'OAuthKeys', 'TimePeriods');
if ((isset($GLOBALS['moduleTabMap'][$currentModule]) && $GLOBALS['moduleTabMap'][$currentModule] == 'Administration')

View file

@ -98,4 +98,6 @@ $entry_point_registry = array(
'sendConfirmOptInEmail' => array('file' => 'include/entryPointConfirmOptInConnector.php', 'auth' => true),
'saveGoogleApiKey' => array('file' => 'modules/Users/entryPointSaveGoogleApiKey.php', 'auth' => true),
'setImapTestSettings' => ['file' => 'include/Imap/ImapTestSettingsEntry.php', 'auth' => true],
'redirectToExternalOAuth' => ['file' => 'modules/ExternalOAuthConnection/entrypoint/redirectToExternalOAuth.php', 'auth' => true],
'setExternalOAuthToken' => ['file' => 'modules/ExternalOAuthConnection/entrypoint/setExternalOAuthToken.php', 'auth' => true],
);

View file

@ -184,7 +184,7 @@ class OutboundEmail
//Now add the system default or user override default to the response.
if (!empty($system->id)) {
if ($system->mail_sendtype == 'SMTP') {
if (isSmtp($system->mail_sendtype ?? '')) {
$systemErrors = "";
$userSystemOverride = $this->getUsersMailerForSystemOverride($user->id);
@ -232,7 +232,7 @@ class OutboundEmail
while ($a = $this->db->fetchByAssoc($r)) {
$oe = array();
if ($a['mail_sendtype'] != 'SMTP') {
if (isSmtp($a['mail_sendtype'] ?? '')) {
continue;
}
$oe['id'] = $a['id'];

View file

@ -0,0 +1,59 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
class SuiteScriptLoader
{
public function combineScripts($scripts) {
$combined = '';
foreach ($scripts as $script) {
$contents = file_get_contents($script);
if (!empty($contents)) {
$combined .= "\n" . $contents . "\n";
}
}
return $combined;
}
}

View file

@ -0,0 +1,77 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {suite_combinescripts} function plugin
*
* Type: function<br>
* Name: uite_combinescripts<br>
* Purpose: Combine script files
*
* @param array
* @param Smarty
*/
function smarty_function_suite_combinescripts($params, &$smarty)
{
if (! isset($params['files'])) {
$smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'file');
}
$replacedFiles = str_replace("\n", '', $params['files']);
$trimmedFiles = str_replace(" ", '', $replacedFiles);
if (strpos($trimmedFiles, ',') !== false) {
$files = explode(',', $trimmedFiles);
} else {
$files = [$trimmedFiles];
}
require_once __DIR__ .'/../../Services/ScriptLoader/SuiteScriptLoader.php';
$scriptLoader = new SuiteScriptLoader();
$combined = $scriptLoader->combineScripts($files);
return $combined;
}

View file

@ -0,0 +1,50 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
function smarty_modifier_json_decode($value)
{
if (empty($value) || !is_string($value)) {
return [];
}
return json_decode(html_entity_decode($value), true, 512, JSON_THROW_ON_ERROR);
}

View file

@ -44,8 +44,19 @@
{else}
{assign var="value" value={{sugarvar key='value' string=true}} }
{/if}
{{if isset($vardef.display) && $vardef.display == 'writeonly'}}
<input type='text' name='{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}'
id='{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}' size='{{$displayParams.size|default:30}}'
{{if isset($displayParams.maxlength)}}maxlength='{{$displayParams.maxlength}}'{{elseif isset($vardef.len)}}maxlength='{{$vardef.len}}'{{/if}}
placeholder="{if !empty({{sugarvar key='value' string=true}})}{sugar_translate label='LBL_VALUE_SET_PLACEHOLDER'}{/if}"
value=''
title='{{$vardef.help}}' {{if !empty($tabindex)}} tabindex='{{$tabindex}}' {{/if}}
{{if !empty($displayParams.accesskey)}} accesskey='{{$displayParams.accesskey}}' {{/if}} {{$displayParams.field}}>
{{else}}
<input type='text' name='{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}'
id='{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}' size='{{$displayParams.size|default:30}}'
{{if isset($displayParams.maxlength)}}maxlength='{{$displayParams.maxlength}}'{{elseif isset($vardef.len)}}maxlength='{{$vardef.len}}'{{/if}}
{{if isset($vardef.placeholder)}}placeholder="{{sugar_translate label=$vardef.placeholder}}"{{/if}}
value='{$value}' title='{{$vardef.help}}' {{if !empty($tabindex)}} tabindex='{{$tabindex}}' {{/if}}
{{if !empty($displayParams.accesskey)}} accesskey='{{$displayParams.accesskey}}' {{/if}} {{$displayParams.field}}>
{{/if}}

View file

@ -40,16 +40,23 @@
*}
<select name="{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}"
id="{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}"
title='{{$vardef.help}}' {{if !empty($tabindex)}} tabindex="{{$tabindex}}" {{/if}}
{{if !empty($displayParams.accesskey)}}
accesskey='{{$displayParams.accesskey}}' {{/if}} {{$displayParams.field}}
{{if isset($displayParams.javascript)}}{{$displayParams.javascript}}{{/if}}>
{{if isset($vardef.display) && $vardef.display == 'readonly'}}
<input type="hidden" class="sugar_field" id="{{sugarvar key='name'}}" name="{{sugarvar key='name'}}" value="{ {{sugarvar key='value' string=true}} }">
{ {{sugarvar key='options' string=true}}[{{sugarvar key='value' string=true}}]}
{{else}}
<select name="{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}"
id="{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}"
title='{{$vardef.help}}' {{if !empty($tabindex)}} tabindex="{{$tabindex}}" {{/if}}
{{if !empty($displayParams.accesskey)}}
accesskey='{{$displayParams.accesskey}}' {{/if}} {{$displayParams.field}}
{{if isset($displayParams.javascript)}}{{$displayParams.javascript}}{{/if}}>
{if isset({{sugarvar key='value' string=true}}) && {{sugarvar key='value' string=true}} != ''}
{html_options options={{sugarvar key='options' string=true}} selected={{sugarvar key='value' string=true}}}
{else}
{html_options options={{sugarvar key='options' string=true}} selected={{sugarvar key='default' string=true}}}
{/if}
</select>
{{/if}}
{if isset({{sugarvar key='value' string=true}}) && {{sugarvar key='value' string=true}} != ''}
{html_options options={{sugarvar key='options' string=true}} selected={{sugarvar key='value' string=true}}}
{else}
{html_options options={{sugarvar key='options' string=true}} selected={{sugarvar key='default' string=true}}}
{/if}
</select>

View file

@ -39,6 +39,13 @@
*/
*}
<input type='password' id='{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}'
name='{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}'
size='{{$displayParams.size|default:30}}' value='{{sugarvar key='value'}}' title='{{$vardef.help}}' tabindex='{{$tabindex}}' {{if !empty($displayParams.accesskey)}} accesskey='{{$displayParams.accesskey}}' {{/if}} >
<input type='password'
id='{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}'
name='{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}'
size='{{$displayParams.size|default:35}}'
placeholder="{{if isset($vardef.display) && $vardef.display == 'writeonly'}}{if !empty({{sugarvar key='value' string=true}})}{sugar_translate label='LBL_PASSWORD_SET_NEW_VALUE_TO_RESET'}{/if}{{/if}}"
data-is-value-set="{if !empty({{sugarvar key='value' string=true}})}true{else}false{/if}"
value='{{if isset($vardef.display) && $vardef.display == 'writeonly'}}{{else}}{{sugarvar key='value'}}{{/if}}'
title='{{$vardef.help}}'
tabindex='{{$tabindex}}'
{{if !empty($displayParams.accesskey)}} accesskey='{{$displayParams.accesskey}}' {{/if}}>

View file

@ -0,0 +1,79 @@
{*
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
*}
{{capture name=idname assign=idname}}{{sugarvar key='name'}}{{/capture}}
{{if !empty($displayParams.idName)}}
{{assign var=idname value=$displayParams.idName}}
{{/if}}
<style>
{literal}
.string-map-label {
font-weight: bold;
padding-right: 10px;
}
{/literal}
</style>
<div class="string-map-container {{if empty($displayParams.idName)}}{{sugarvar key='name'}}-string-map{{else}}{{$displayParams.idName}}-string-map{{/if}}">
{assign var=json value={{sugarvar key='value' string=true}}}
{assign var=values value=$json|json_decode}
<div class="container-fluid string-map-values-list">
{if !empty($values) }
{foreach from=$values key=k item=v}
<div class="row string-map-entry-row">
{{if $vardef.show_keys === true}}
<div class="col-sm-6 col-xs-12 string-map-key-col">
{{if !empty($entry_value_label)}}<span class="string-map-label">{{$entry_key_label}}:</span>{{/if}}<span>{$k}</span>
</div>
{{/if}}
<div class="col-sm-6 col-xs-12 string-map-value-col">
{{if !empty($entry_value_label)}}<span class="string-map-label">{{$entry_value_label}}:</span>{{/if}}<span>{$v}</span>
</div>
</div>
{/foreach}
{/if}
</div>
</div>

View file

@ -0,0 +1,121 @@
{*
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
*}
{{capture name=idname assign=idname}}{{sugarvar key='name'}}{{/capture}}
{{if !empty($displayParams.idName)}}
{{assign var=idname value=$displayParams.idName}}
{{/if}}
<div class="string-map-container" id="{{if empty($displayParams.idName)}}{{sugarvar key='name'}}-string-map{{else}}{{$displayParams.idName}}-string-map{{/if}}">
{assign var=json value={{sugarvar key='value' string=true}}}
{assign var=values value=$json|json_decode}
<script src='{sugar_getjspath file="include/SugarFields/Fields/Stringmap/js/stringmap.js"}'></script>
<script src='{sugar_getjspath file="include/SugarFields/Fields/Stringmap/js/stringmap-factory.js"}'></script>
<style>
{literal}
.string-map-entry-row {
display: flex;
justify-content: start;
}
.string-map-key-col, .string-map-value-col {
flex-grow: 1;
}
.string-map-actions {
display: flex;
justify-content: end;
}
.string-map-action .add-btn, .string-map-button-col .remove-btn {
width: 30px;
}
{/literal}
</style>
<div class="container-fluid string-map-values-list">
{if !empty($values) }
{foreach from=$values key=k item=v}
<div class="string-map-entry-row">
{{if $vardef.show_keys === true}}
<div class="string-map-key-col">
<input type="text" name="{{$idname}}-key[]" value="{$k}" placeholder="{{$entry_key_label}}">
</div>
{{/if}}
<div class="string-map-value-col">
<input type="text" name="{{$idname}}-value[]" value="{$v}" {{if !empty($vardef.show_keys)}} {if empty($k) && empty($v)}placeholder="{{$entry_value_label}}"{/if} {{/if}}>
</div>
<div class="string-map-button-col">
<button type="button" class="btn btn-sm btn-primary remove-btn" onclick=""> - </button>
</div>
</div>
{/foreach}
{/if}
</div>
<div class="container-fluid string-map-actions">
<div class="string-map-action">
<button type="button" class="btn btn-sm btn-primary add-btn" onclick=""> + </button>
</div>
</div>
{literal}
<script>
$(document).ready(function(){
var fieldIdentifier = '{/literal}{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}{literal}';
var options = {
containerSelector: '#' + fieldIdentifier + '-string-map',
showKeys: {/literal}{{if $vardef.show_keys === true}}true{{else}}false{{/if}}{literal},
idName: fieldIdentifier,
keyPlaceholder: '{/literal}{{$entry_key_label}}{literal}',
valuePlaceholder: '{/literal}{{$entry_value_label}}{literal}'
};
var stringMap = StringMapFactory.make(options);
stringMap.initEdit();
$(fieldIdentifier + '-string-map').data('string-map', stringMap);
});
</script>
{/literal}
</div>

View file

@ -0,0 +1,152 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
require_once 'include/SugarFields/Fields/Text/SugarFieldText.php';
class SugarFieldStringmap extends SugarFieldText
{
/**
* @inheritDoc
*/
function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
$this->calculateShowKeys($vardef);
$this->setLabels($vardef);
return parent::getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
}
/**
* @inheritDoc
*/
public function getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
$this->calculateShowKeys($vardef);
$this->setLabels($vardef);
return parent::getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
}
/**
* @inheritDoc
*/
public function save(&$bean, $params, $field, $properties, $prefix = '')
{
parent::save($bean, $params, $field, $properties, $prefix);
$map = $this->getStringMapFromRequest($field);
$bean->$field = '';
if(!empty($map)) {
$bean->$field = json_encode($map, JSON_THROW_ON_ERROR);
}
}
/**
* @param array $vardef
* @return void
*/
protected function calculateShowKeys(array &$vardef): void
{
$showKeys = false;
if (isTrue($vardef['show_keys'] ?? false)) {
$showKeys = $vardef['show_keys'];
}
$vardef['show_keys'] = $showKeys;
}
/**
* @param $field
* @return array
*/
protected function getStringMapFromRequest($field): array
{
$requestKeyEntry = $field . '-key';
$requestValueEntry = $field . '-value';
$keys = [];
if (!empty($_REQUEST[$requestKeyEntry]) && is_array($_REQUEST[$requestKeyEntry])) {
$keys = $_REQUEST[$requestKeyEntry];
}
$values = [];
if (!empty($_REQUEST[$requestValueEntry]) && is_array($_REQUEST[$requestValueEntry])) {
$values = $_REQUEST[$requestValueEntry];
}
$map = [];
$i = 0;
foreach ($values as $value) {
$key = $i;
if (!empty($keys[$i])) {
$key = $keys[$i];
}
if (empty($keys[$i]) && empty($value)){
$i++;
continue;
}
$map[$key] = $value;
$i++;
}
return $map;
}
/**
* @param array $vardef
* @return void
*/
protected function setLabels(array $vardef): void
{
global $app_strings;
$keyLabelKey = $vardef['key_label'] ?? 'LBL_KEY';
$valueLabelKey = $vardef['value_label'] ?? 'LBL_VALUE';
$this->ss->assign('entry_key_label', $app_strings[$keyLabelKey] ?? '');
$this->ss->assign('entry_value_label', $app_strings[$valueLabelKey] ?? '');
}
}

View file

@ -0,0 +1,56 @@
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
var StringMapFactory = (function () {
return {
make: function (options) {
var stringMap = Object.create(StringMap);
stringMap.$container = $(options.containerSelector);
stringMap.$list = stringMap.$container.find('.string-map-values-list');
stringMap.showKeys = options.showKeys || false;
stringMap.idName = options.idName || '';
stringMap.keyPlaceholder = options.keyPlaceholder || '';
stringMap.valuePlaceholder = options.valuePlaceholder || '';
return stringMap;
},
};
})();

View file

@ -0,0 +1,136 @@
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
var StringMap = (function () {
return {
$container:null,
$list:null,
idName: null,
keyPlaceholder: null,
valuePlaceholder: null,
events: {
'click .add-btn': 'addRow',
'click .remove-btn': 'removeRow'
},
bindEvents: function(){
var self = this;
$.each(this.events, function(key, callback){
var parts = key.split(' ');
var eventType = parts[0];
var selector = parts[1];
self.$container.on(eventType, selector, function(event){
self[callback](event);
});
});
},
generateInputCol: function(colClass, inputName, placeholder, inputValue){
var $col = $('<div>', {
class:(colClass || '')
});
var options = {
name: inputName || '',
value: inputValue || '',
type: 'text'
};
if (placeholder) {
options.placeholder = placeholder
}
var $input = $('<input>', options);
$col.append($input);
return $col;
},
generateButtonCol: function(){
var $buttonCol = $('<div class="string-map-button-col"></div>');
var $button = $('<button type="button" class="btn btn-sm btn-primary remove-btn" onClick=""> - </button>');
$buttonCol.append($button);
return $buttonCol;
},
generateRow: function(){
var $row = $('<div>', {
class: "string-map-entry-row"
});
if(this.showKeys) {
var keyInputName = (this.idName || '') + '-key[]';
var $keyCol = this.generateInputCol('string-map-key-col', keyInputName, this.keyPlaceholder);
$row.append($keyCol);
}
var valueInputName = (this.idName || '') + '-value[]';
var placeholder = this.valuePlaceholder;
if (!this.showKeys) {
placeholder = '';
}
var $valueCol = this.generateInputCol('string-map-value-col', valueInputName, placeholder);
$row.append($valueCol);
var $buttonCol = this.generateButtonCol();
$row.append($buttonCol);
return $row;
},
addRow: function(event){
var self = this;
var $newRow = self.generateRow();
self.$list.append($newRow);
event.stopPropagation();
},
removeRow: function(event){
var self = this;
var $removeButton = $(event.currentTarget);
var $row = $removeButton.closest('.string-map-entry-row');
$row.remove();
event.stopPropagation();
},
initEdit: function (options) {
var self = this;
this.bindEvents();
},
};
})();

View file

@ -52,11 +52,23 @@
{{/if}}
<textarea id='{{$idname}}' name='{{$idname}}'
rows="{{if !empty($displayParams.rows)}}{{$displayParams.rows}}{{elseif !empty($vardef.rows)}}{{$vardef.rows}}{{else}}{{4}}{{/if}}"
cols="{{if !empty($displayParams.cols)}}{{$displayParams.cols}}{{elseif !empty($vardef.cols)}}{{$vardef.cols}}{{else}}{{60}}{{/if}}"
title='{{$vardef.help}}' tabindex="{{$tabindex}}" {{$displayParams.field}}
{{if !empty($displayParams.accesskey)}} accesskey='{{$displayParams.accesskey}}' {{/if}} >{$value}</textarea>
{{if isset($vardef.display) && $vardef.display == 'writeonly'}}
<textarea id='{{$idname}}' name='{{$idname}}'
rows="{{if !empty($displayParams.rows)}}{{$displayParams.rows}}{{elseif !empty($vardef.rows)}}{{$vardef.rows}}{{else}}{{4}}{{/if}}"
cols="{{if !empty($displayParams.cols)}}{{$displayParams.cols}}{{elseif !empty($vardef.cols)}}{{$vardef.cols}}{{else}}{{60}}{{/if}}"
title='{{$vardef.help}}' tabindex="{{$tabindex}}" {{$displayParams.field}}
placeholder="{if !empty({{sugarvar key='value' string=true}})}{sugar_translate label='LBL_VALUE_SET_PLACEHOLDER'}{/if}"
{{if !empty($displayParams.accesskey)}} accesskey='{{$displayParams.accesskey}}' {{/if}} ></textarea>
{{else}}
<textarea id='{{$idname}}' name='{{$idname}}'
rows="{{if !empty($displayParams.rows)}}{{$displayParams.rows}}{{elseif !empty($vardef.rows)}}{{$vardef.rows}}{{else}}{{4}}{{/if}}"
cols="{{if !empty($displayParams.cols)}}{{$displayParams.cols}}{{elseif !empty($vardef.cols)}}{{$vardef.cols}}{{else}}{{60}}{{/if}}"
title='{{$vardef.help}}' tabindex="{{$tabindex}}" {{$displayParams.field}}
{{if !empty($displayParams.accesskey)}} accesskey='{{$displayParams.accesskey}}' {{/if}} >{$value}</textarea>
{{/if}}
{literal}{{$tinymce}}{/literal}

View file

@ -786,8 +786,19 @@ class SugarFolder
$secureReturn = [];
$userAccessibleInboundIds = $this->getUserAccessibleInboundIds($user);
foreach ($return as $item) {
if ($item->isgroup === 1 || $item['created_by'] === $user->id || is_admin($user)) {
if (empty($item) || empty($item['id'])) {
continue;
}
$isGroup = $item->isgroup ?? '';
if ($isGroup === 1) {
$secureReturn[] = $item;
}
if (!empty($userAccessibleInboundIds[$item['id']])) {
$secureReturn[] = $item;
}
}
@ -851,13 +862,17 @@ class SugarFolder
);
try {
$folders = $this->retrieveFoldersForProcessing($focusUser);
$folders = $this->retrieveFoldersForProcessing($focusUser, false);
$subscriptions = $this->getSubscriptions($focusUser);
foreach ($folders as $a) {
$a['selected'] = (in_array($a['id'], $subscriptions)) ? true : false;
$a['origName'] = $a['name'];
if (isTrue($a['deleted'] ?? false)) {
continue;
}
if (isset($a['dynamic_query'])) {
unset($a['dynamic_query']);
}
@ -1008,7 +1023,17 @@ class SugarFolder
$folderStates = array();
}
foreach ($folders as $a) {
$settingsFolders = $this->getFoldersForSettings($user);
$selectedFolders = [];
foreach ($folders as $folder) {
if ($this->isToDisplay($folder['id'] ?? '', $settingsFolders)){
$selectedFolders[] = $folder;
}
}
foreach ($selectedFolders as $a) {
if ($a['deleted'] == 1) {
continue;
}
@ -1441,4 +1466,115 @@ class SugarFolder
return false;
}
/**
* Get first display folder
* @return mixed|null
*/
public function getFirstDisplayFolders(): ?array {
global $current_user;
$settingsFolders = $this->getFoldersForSettings($current_user);
foreach ($settingsFolders['userFolders'] as $folder) {
$isSelected = $folder['selected'] ?? false;
if (isFalse($isSelected)) {
continue;
}
return $folder;
}
foreach ($settingsFolders['groupFolders'] as $folder) {
$isSelected = $folder['selected'] ?? false;
if (isFalse($isSelected)) {
continue;
}
return $folder;
}
return null;
}
/**
* Check if it subscribed
* @param string|null $folderId
* @param array|null $folders
* @return bool
*/
public function isToDisplay(?string $folderId, array $folders = null): bool {
global $current_user;
if (empty($folderId)){
return false;
}
if ($folders === null){
$folders = $this->getFoldersForSettings($current_user);
}
if ($this->shouldFolderDisplay($folders['userFolders'] ?? [], $folderId)) {
return true;
}
if ($this->shouldFolderDisplay($folders['groupFolders'] ?? [], $folderId)) {
return true;
}
return false;
}
/**
* @param array $folders
* @param string $folderId
* @return bool
*/
protected function shouldFolderDisplay(array $folders, string $folderId): bool
{
if (empty($folders)) {
return false;
}
foreach ($folders as $folder) {
$isSelected = $folder['selected'] ?? false;
if (isFalse($isSelected)) {
continue;
}
$id = $folder['id'] ?? '';
if ($id === $folderId) {
return true;
}
}
return false;
}
/**
* @param User|null $user
* @return array
*/
protected function getUserAccessibleInboundIds(?User $user): array
{
$userAccessibleInboundAccountIds = [];
/** @var InboundEmail $inboundEmail */
$inboundEmail = BeanFactory::newBean('InboundEmail');
$accessibleInboundEmails = $inboundEmail->getUserInboundAccounts();
if (!empty($accessibleInboundEmails)) {
foreach ($accessibleInboundEmails as $accessibleInboundEmail) {
if (empty($accessibleInboundEmail)) {
continue;
}
$id = $accessibleInboundEmail->id ?? '';
if (!empty($id)) {
$userAccessibleInboundAccountIds[$id] = true;
}
}
}
return $userAccessibleInboundAccountIds;
}
} // end class def

View file

@ -126,7 +126,7 @@ class SugarPHPMailer extends PHPMailer
// ssl or tcp - keeping outside isSMTP b/c a default may inadvertently set ssl://
$this->protocol = $oe->mail_smtpssl ? 'ssl://' : 'tcp://';
if ($oe->mail_sendtype === 'SMTP') {
if (isSmtp($oe->mail_sendtype ?? '')) {
//Set mail send type information
$this->Mailer = 'smtp';
$this->Host = $oe->mail_smtpserver;
@ -160,7 +160,7 @@ class SugarPHPMailer extends PHPMailer
// ssl or tcp - keeping outside isSMTP b/c a default may inadvertantly set ssl://
$this->protocol = $oe->mail_smtpssl ? 'ssl://' : 'tcp://';
if ($oe->mail_sendtype === 'SMTP') {
if (isSmtp($oe->mail_sendtype ?? '')) {
//Set mail send type information
$this->Mailer = 'smtp';
$this->Host = $oe->mail_smtpserver;

View file

@ -147,13 +147,13 @@ class SugarTinyMCE
<script type="text/javascript">
<!--
$(document).ready(function(){
if (!SUGAR.ajaxUI.hist_loaded){
load_mce_{$unique}();
}
});
if (SUGAR.ajaxUI && SUGAR.ajaxUI.hist_loaded){
setTimeout(function(){ load_mce_{$unique}();},40);
}
if (!SUGAR.ajaxUI.hist_loaded){
load_mce_{$unique}();
}
if (SUGAR.ajaxUI && SUGAR.ajaxUI.hist_loaded){
setTimeout(function(){ load_mce_{$unique}();},40);
}
});
function load_mce_{$unique}(){
if (!SUGAR.util.isTouchScreen()) {
if(tinyMCE.editors.length === 0 ){

View file

@ -427,4 +427,21 @@ class MysqliManager extends MysqlManager
{
return function_exists("mysqli_connect") && empty($GLOBALS['sugar_config']['mysqli_disabled']);
}
public function compareVarDefs($fielddef1, $fielddef2, $ignoreName = false)
{
/**
* Int lengths are ignored in MySQL versions >= 8.0.19 so we need to ignore when comparing vardefs.
*/
if($fielddef1['type'] == 'int') {
$db_version = $this->version();
if (!empty($db_version)
&& version_compare($db_version, '8.0.19') >= 0
&& strpos($db_version, "MariaDB") === false
) {
unset($fielddef2['len']);
}
}
return parent::compareVarDefs($fielddef1, $fielddef2, $ignoreName);
}
}

View file

@ -168,32 +168,11 @@ function export($type, $records = null, $members = false, $sample=false)
ACLController::displayNoAccess();
sugar_die('');
}
if (ACLController::requireOwner($focus->module_dir, 'export')) {
if (!empty($where)) {
$where .= ' AND ';
}
$where .= $focus->getOwnerWhere($current_user->id);
$accessWhere = $focus->buildAccessWhere('export');
if (!empty($accessWhere)) {
$where .= empty($where) ? $accessWhere : ' AND ' . $accessWhere;
}
/* BEGIN - SECURITY GROUPS */
if (ACLController::requireSecurityGroup($focus->module_dir, 'export')) {
require_once('modules/SecurityGroups/SecurityGroup.php');
global $current_user;
$owner_where = $focus->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere($focus->table_name, $focus->module_dir, $current_user->id);
if (!empty($owner_where)) {
if (empty($where)) {
$where = " (". $owner_where." or ".$group_where.")";
} else {
$where .= " AND (". $owner_where." or ".$group_where.")";
}
} else {
if (!empty($where)) {
$where .= ' AND ';
}
$where .= $group_where;
}
}
/* END - SECURITY GROUPS */
}
// Export entire list was broken because the where clause already has "where" in it
// and when the query is built, it has a "where" as well, so the query was ill-formed.

View file

@ -488,7 +488,9 @@ var selectedIndex=0;var nodeCount=-1;for(i in left_side.childNodes){if(typeof le
selectedIndex=nodeCount;}}
document.getElementById('orderBySelect').selectedIndex=selectedIndex;};SUGAR.tabChooser.movementCallback(document.getElementById('display_tabs_td').getElementsByTagName('select')[0]);if(document.search_form.orderBy){if(document.search_form.orderBy.length>1&&document.search_form.orderBy[1].type=='select-one'){document.search_form.orderBy[1].options.value=SUGAR.savedViews.selectedOrderBy;}
else{document.search_form.orderBy.options.value=SUGAR.savedViews.selectedOrderBy;}}
if(SUGAR.savedViews.selectedSortOrder=='DESC')document.getElementById('sort_order_desc_radio').checked=true;else document.getElementById('sort_order_asc_radio').checked=true;}};}();SUGAR.searchForm=function(){var url;return{searchFormSelect:function(view,previousView){var module=view.split('|')[0];var theView=view.split('|')[1];var handleDisplay=function(){document.search_form.searchFormTab.value=theView;patt=module+"(.*)SearchForm$";divId=document.search_form.getElementsByTagName('div');for(i=0;i<divId.length;i++){if(divId[i].id.match(module)==module){if(divId[i].id.match('SearchForm')=='SearchForm'){if(document.getElementById(divId[i].id).style.display==''){previousTab=divId[i].id.match(patt)[1];}
if(SUGAR.savedViews.selectedSortOrder=='DESC')document.getElementById('sort_order_desc_radio').checked=true;else document.getElementById('sort_order_asc_radio').checked=true;var sortableColumnsCount=0;var columnDefs=SUGAR.savedViews.columnsMeta;if(columnDefs&&typeof columnDefs==='object'&&Object.keys(columnDefs)){Object.keys(columnDefs).forEach(function(columnKey){var column=columnDefs[columnKey];if(!column||!column.sortable){return;}
if(column.sortable===true){sortableColumnsCount++;}})}
if(sortableColumnsCount<1){$('.saved-search-sort-column-config-row').hide();}}};}();SUGAR.searchForm=function(){var url;return{searchFormSelect:function(view,previousView){var module=view.split('|')[0];var theView=view.split('|')[1];var handleDisplay=function(){document.search_form.searchFormTab.value=theView;patt=module+"(.*)SearchForm$";divId=document.search_form.getElementsByTagName('div');for(i=0;i<divId.length;i++){if(divId[i].id.match(module)==module){if(divId[i].id.match('SearchForm')=='SearchForm'){if(document.getElementById(divId[i].id).style.display==''){previousTab=divId[i].id.match(patt)[1];}
document.getElementById(divId[i].id).style.display='none';}}}
adv=document.getElementById('advanced_search_link');bas=document.getElementById('basic_search_link');if(adv!==null){adv.setAttribute('accesskey','');}
if(bas!==null){bas.setAttribute('accesskey','');}

View file

@ -700,6 +700,39 @@ $app_list_strings = array(
'PM' => 'PM',
),
'dom_inbound_email_account_types' => [
'personal' => 'Personal',
'group' => 'Group',
'bounce' => 'Bounce',
],
'dom_inbound_email_auth_types' => [
'basic' => 'Basic Auth',
'oauth' => 'OAuth',
],
'dom_external_oauth_connection_types' => [
'personal' => 'Personal',
'group' => 'Group',
],
'dom_external_oauth_provider_types' => [
'personal' => 'Personal',
'group' => 'Group',
],
'dom_outbound_email_account_types' => [
'user' => 'Personal',
'group' => 'Group',
'system' => 'System',
'system-override' => 'System Override',
],
'dom_inbound_email_account_status' => [
'Active' => 'Active',
'Inactive' => 'Inactive',
],
'dom_email_types' => array(
'out' => 'Sent',
'archived' => 'Archived',
@ -906,6 +939,7 @@ $app_list_strings = array(
'lead' => 'Leads Created',
'contact' => 'Contacts Created',
'blocked' => 'Suppressed by address or domain',
'Survey' => 'Survey answered',
),
'campainglog_target_type_dom' => array(
@ -1105,6 +1139,7 @@ $app_strings = array(
'LBL_EMAIL_ACCOUNTS_SMTPUSER' => 'SMTP Username',
'LBL_EMAIL_ACCOUNTS_SMTPDEFAULT' => 'Default',
'LBL_EMAIL_WARNING_MISSING_USER_CREDS' => 'Warning: Missing username and password for outgoing mail account.',
'LBL_EMAIL_WARNING_MISSING_CREDS' => 'Warning: Missing credentials',
'LBL_EMAIL_ACCOUNTS_SUBTITLE' => 'Set up Mail Accounts to view incoming emails from your email accounts.',
'LBL_EMAIL_ACCOUNTS_OUTBOUND_SUBTITLE' => 'Provide SMTP mail server information to use for outgoing email in Mail Accounts.',
@ -3000,7 +3035,7 @@ $app_list_strings['contact_portal_user_type_dom'] =
'Account' => 'Account user',
);
$app_list_strings['dom_email_distribution_for_auto_create'] = array(
'AOPDefault' => 'Use AOP Default',
'AOPDefault' => 'System Default',
'singleUser' => 'Single User',
'roundRobin' => 'Round-Robin',
'leastBusy' => 'Least-Busy',
@ -3561,8 +3596,11 @@ $app_strings['LBL_RESCHEDULE_COUNT'] = 'Call Attempts';
//SecurityGroups
$app_list_strings['moduleList']['SecurityGroups'] = 'Security Suite Management';
$app_strings['LBL_SECURITYGROUP'] = 'Security Group';
$app_strings['LBL_ROLE'] = 'Role';
$app_list_strings['moduleList']['OutboundEmailAccounts'] = 'Outbound Email Accounts';
$app_list_strings['moduleList']['ExternalOAuthConnection'] = 'External OAuth Connection';
$app_list_strings['moduleList']['ExternalOAuthProvider'] = 'External OAuth Provider';
//social
$app_strings['FACEBOOK_USER_C'] = 'Facebook';
@ -3897,3 +3935,13 @@ $app_strings['ERR_INVALID_FILE_NAME'] = 'Invalid file name:';
$app_strings['LBL_LOGGER_VALID_FILENAME_CHARACTERS'] = 'This can only be alphanumeric characters, plus \'.\' , \'-\' and \'_\'';
$app_strings['LBL_LOGGER_INVALID_FILENAME'] = 'Invalid import file name';
$app_strings['LBL_PASSWORD_SET_NEW_VALUE_TO_RESET'] = 'Password set. Enter value to set new password.';
$app_strings['LBL_VALUE_SET_PLACEHOLDER'] = 'Value set. Enter new value to override current one.';
$app_strings['ERR_IMAP_OAUTH_CONNECTION_ERROR'] = 'Not able to connect using OAuth login with Inbound Email server. For connection: ';
$app_strings['WARN_OAUTH_TOKEN_SESSION_EXPIRED'] = 'Your IMAP OAuth session has expired, please login again in the connection: ';
$app_strings['LBL_KEY'] = 'Key';
$app_strings['LBL_VALUE'] = 'Value';
$app_strings['LBL_OPTIONAL'] = 'Optional';
$app_strings['LBL_OPTIONAL_CONNECTION_STRING'] = 'Optional. Set to use a specific connection string';

View file

@ -501,6 +501,14 @@ $modules_exempt_from_availability_check['OutboundEmailAccounts'] = 'OutboundEmai
$report_include_modules['OutboundEmailAccounts'] = 'OutboundEmailAccounts';
$modInvisList[] = 'OutboundEmailAccounts';
$beanList['ExternalOAuthConnection'] = 'ExternalOAuthConnection';
$beanFiles['ExternalOAuthConnection'] = 'modules/ExternalOAuthConnection/ExternalOAuthConnection.php';
$modInvisList[] = 'ExternalOAuthConnection';
$beanList['ExternalOAuthProvider'] = 'ExternalOAuthProvider';
$beanFiles['ExternalOAuthProvider'] = 'modules/ExternalOAuthProvider/ExternalOAuthProvider.php';
$modInvisList[] = 'ExternalOAuthProvider';
$beanList['TemplateSectionLine'] = 'TemplateSectionLine';
$beanFiles['TemplateSectionLine'] = 'modules/TemplateSectionLine/TemplateSectionLine.php';
$modules_exempt_from_availability_check['TemplateSectionLine'] = 'TemplateSectionLine';

View file

@ -570,7 +570,7 @@ function get_sugar_config_defaults(): array
'enable' => true,
'gc_probability' => 1,
'gc_divisor' => 100,
]
],
];
if (!is_object($locale)) {
@ -3235,24 +3235,10 @@ function get_bean_select_array(
$query .= " {$focus->table_name}.deleted=0";
/* BEGIN - SECURITY GROUPS */
global $current_user, $sugar_config;
if ($focus->module_dir == 'Users' && !is_admin($current_user) && isset($sugar_config['securitysuite_filter_user_list']) && $sugar_config['securitysuite_filter_user_list'] == true
) {
require_once 'modules/SecurityGroups/SecurityGroup.php';
$group_where = SecurityGroup::getGroupUsersWhere($current_user->id);
$query .= ' AND (' . $group_where . ') ';
} elseif ($focus->bean_implements('ACL') && ACLController::requireSecurityGroup($focus->module_dir, 'list')) {
require_once 'modules/SecurityGroups/SecurityGroup.php';
$owner_where = $focus->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere($focus->table_name, $focus->module_dir, $current_user->id);
if (!empty($owner_where)) {
$query .= ' AND (' . $owner_where . ' or ' . $group_where . ') ';
} else {
$query .= ' AND ' . $group_where;
}
$accessWhere = $focus->buildAccessWhere('list');
if (!empty($accessWhere)) {
$query .= ' AND ' . $accessWhere;
}
/* END - SECURITY GROUPS */
if ($order_by != '') {
$query .= " order by {$focus->table_name}.{$order_by}";
@ -5190,6 +5176,27 @@ function filterInboundEmailPopSelection($protocol)
return $protocol;
}
/**
* Get Inbound Email protocols
*
* @return array
*/
function getInboundEmailProtocols(): array
{
global $app_list_strings, $sugar_config;
$protocols = $app_list_strings['dom_email_server_type'];
if (!isset($sugar_config['allow_pop_inbound']) || !$sugar_config['allow_pop_inbound']) {
if (isset($protocols['pop3'])) {
unset($protocols['pop3']);
}
} else {
$protocols['pop3'] = 'POP3';
}
return $protocols;
}
/**
* The function is used because currently we are not supporting mbstring.func_overload
* For some user using mssql without FreeTDS, they may store multibyte charaters in varchar using latin_general collation. It cannot store so many mutilbyte characters, so we need to use strlen.
@ -6112,7 +6119,7 @@ function has_valid_extension($fieldName, $name, $validExtensions)
* @return bool
*/
function isTrue($value): bool {
return $value === true || $value === 'true' || $value === 1;
return $value === true || $value === 'true' || $value === 1 || $value === '1' || $value === 'on';
}
/**
@ -6121,7 +6128,7 @@ function isTrue($value): bool {
* @return bool
*/
function isFalse($value): bool {
return $value === false || $value === 'false' || $value === 0;
return $value === false || $value === 'false' || $value === 0 || $value === '0';
}
/**
@ -6138,3 +6145,45 @@ function get_id_validation_pattern(): string {
return $pattern;
}
/**
* Check if user has group and action acls defined
* @param string $module
* @param string $action
* @return bool
*/
function has_group_action_acls_defined(string $module, string $action): bool
{
global $current_user;
$hasGroupActionAcls = true;
$groups = SecurityGroup::getUserSecurityGroups($current_user->id);
$hasGroups = !empty($groups);
$aclActions = ACLAction::getUserActions($current_user->id, false, $module, 'module', $action);
$isDefaultListACL = !empty($aclActions['isDefault']) && isTrue($aclActions['isDefault']);
if (!$hasGroups) {
$hasGroupActionAcls = false;
}
if ($isDefaultListACL) {
$hasGroupActionAcls = false;
}
return $hasGroupActionAcls;
}
/**
* Check if is value is smtp in a case-insensitive way
* @param $value
* @return bool
*/
function isSmtp($value): bool {
if (empty($value) || !is_string($value)) {
return false;
}
return strtolower($value) === 'smtp';
}

View file

@ -179,7 +179,7 @@ class LogicHook
*
* @param string $module_dir
* @param string $event
* @param array $arguments
* @param object|array $arguments
* @param SugarBean $bean
*/
public function call_custom_logic($module_dir, $event, $arguments = null)
@ -209,7 +209,7 @@ class LogicHook
*
* @param array $hook_array
* @param string $event
* @param array $arguments
* @param object|array $arguments
* @param SugarBean $bean
*/
public function process_hooks($hook_array, $event, $arguments)

View file

@ -572,7 +572,7 @@ $contact_user_link_guid',
'LBL_START' => '',
'LBL_DB_CONN_ERR' => 'Database error',
'LBL_OLD_PHP' => 'Old PHP Version Detected!',
'LBL_OLD_PHP_MSG' => 'The recommended PHP version to install SuiteCRM is %s <br />Although the minimum PHP version required is %s, is not recommended due to the large number of fixed bugs, including security fixes, released in the more modern versions.<br />You are using PHP version %s, which is EOL: <a href="http://php.net/eol.php">http://php.net/eol.php</a>.<br />Please consider upgrading your PHP version. Instructions on <a href="http://php.net/migration70">http://php.net/migration70</a>. ',
'LBL_OLD_PHP_MSG' => 'The recommended PHP version to install SuiteCRM is %s <br />The minimum PHP version required is %s<br />You are using PHP version %s, which is EOL: <a href="http://php.net/eol.php">http://php.net/eol.php</a>.<br />Please consider upgrading your PHP version. ',
'LBL_OLD_PHP_OK' => 'I\'m aware of the risks and wish to continue.',
'LBL_DBCONF_TITLE_USER_INFO_LABEL' => 'User',

View file

@ -170,8 +170,7 @@ $envString .='<p><b>'.$mod_strings['LBL_CHECKSYS_PCRE'].'</b> '.$pcreStatus.'</p
// imap
$imapFactory = new ImapHandlerFactory();
$imap = $imapFactory->getImapHandler();
if ($imap->isAvailable()) {
if ($imapFactory->areAllHandlersAvailable()) {
$imapStatus = (string)($mod_strings['LBL_CHECKSYS_OK']);
} else {
$imapStatus = "<span class='stop'><b>{$mod_strings['ERR_CHECKSYS_IMAP']}</b></span>";

View file

@ -3652,6 +3652,7 @@ SUGAR.savedViews = function () {
}
// Firefox needs this to be set after all the option nodes are created.
document.getElementById('orderBySelect').selectedIndex = selectedIndex;
};
SUGAR.tabChooser.movementCallback(document.getElementById('display_tabs_td').getElementsByTagName('select')[0]);
@ -3668,6 +3669,25 @@ SUGAR.savedViews = function () {
// handle direction
if (SUGAR.savedViews.selectedSortOrder == 'DESC') document.getElementById('sort_order_desc_radio').checked = true;
else document.getElementById('sort_order_asc_radio').checked = true;
var sortableColumnsCount = 0;
var columnDefs = SUGAR.savedViews.columnsMeta;
if(columnDefs && typeof columnDefs === 'object' && Object.keys(columnDefs)) {
Object.keys(columnDefs).forEach(function (columnKey) {
var column = columnDefs[columnKey];
if (!column || !column.sortable) {
return;
}
if (column.sortable === true) {
sortableColumnsCount++;
}
})
}
if (sortableColumnsCount < 1 ) {
$('.saved-search-sort-column-config-row').hide();
}
}
};
}();

View file

@ -115,7 +115,7 @@ function getEncryptedPassword(login, password, mailbox) {
return words;
} // fn
function ie_test_open_popup_with_submit(module_name, action, pageTarget, width, height, mail_server, protocol, port, login, password, mailbox, ssl, personal, formName, ie_id)
function ie_test_open_popup_with_submit(module_name, action, pageTarget, width, height, mail_server, protocol, port, login, password, mailbox, ssl, personal, formName, ie_id, connectionString)
{
if (!formName) formName = "testSettingsView";
var words = getEncryptedPassword(login, password, mailbox);
@ -145,6 +145,10 @@ function ie_test_open_popup_with_submit(module_name, action, pageTarget, width,
+ '&ie_id=' + ie_id
+ '&personal=' + isPersonal;
if(connectionString) {
URL += '&connection_string=' + encodeURIComponent(connectionString);
}
var SI = SUGAR.inboundEmail;
if (!SI.testDlg) {
SI.testDlg = new YAHOO.widget.SimpleDialog("testSettingsDiv", {
@ -220,7 +224,7 @@ function isDataValid(formName, validateMonitoredFolder) {
} // fn
function getFoldersListForInboundAccount(module_name, action, pageTarget, width, height, mail_server, protocol, port, login, password, mailbox, ssl, personal, searchFieldValue, formName) {
function getFoldersListForInboundAccount(module_name, action, pageTarget, width, height, mail_server, protocol, port, login, password, mailbox, ssl, personal, searchFieldValue, formName, extraParams) {
if (!formName) formName = "testSettingsView";
var words = getEncryptedPassword(login, password, mailbox);
@ -243,6 +247,12 @@ function getFoldersListForInboundAccount(module_name, action, pageTarget, width,
+ '&personal=' + isPersonal
+ '&searchField='+ searchFieldValue;
if(extraParams && typeof extraParams === 'object' && Object.keys(extraParams).length) {
Object.keys(extraParams).forEach(function (key) {
URL += '&' + key + '=' + (extraParams[key] || '');
})
}
var SI = SUGAR.inboundEmail;
if (!SI.listDlg) {
SI.listDlg = new YAHOO.widget.SimpleDialog("selectFoldersDiv", {

View file

@ -125,7 +125,7 @@ class ElasticSearchEngine extends SearchEngine
}
// Add wildcard at the end of search string
if ((!substr_compare($searchStr, $wildcardBe, -strlen($wildcardBe))) === 0) {
if ((substr_compare($searchStr, $wildcardBe, -strlen($wildcardBe))) !== 0) {
$searchStr .= $wildcardBe;
}

View file

@ -500,16 +500,18 @@ class ElasticSearchIndexer extends AbstractIndexer
// logs the errors
foreach ($responses['items'] as $item) {
$action = array_keys($item)[0];
$type = $item[$action]['error']['type'];
$reason = $item[$action]['error']['reason'];
$this->logger->error("[$action] [$type] $reason");
if(isset($item[$action]['error'])) {
$type = $item[$action]['error']['type'];
$reason = $item[$action]['error']['reason'];
$this->logger->error("[$action] [$type] $reason");
if ($action === 'index') {
$this->indexedRecordsCount--;
}
if ($action === 'index') {
$this->indexedRecordsCount--;
}
if ($action === 'delete') {
$this->removedRecordsCount--;
if ($action === 'delete') {
$this->removedRecordsCount--;
}
}
}
}

View file

@ -356,7 +356,14 @@ class SearchQuery implements JsonSerializable
*/
public function convertEncoding(): void
{
$this->query = mb_convert_encoding($this->query, 'UTF-8', 'HTML-ENTITIES');
$string = $this->query;
preg_match_all("/&#?\w+;/", $string, $entities, PREG_SET_ORDER);
$entities = array_unique(array_column($entities, 0));
foreach ($entities as $entity) {
$decoded = mb_convert_encoding($entity, 'UTF-8', 'HTML-ENTITIES');
$string = str_replace($entity, $decoded, $string);
}
$this->query = $string;
}
/** @inheritdoc */

View file

@ -111,7 +111,8 @@ class SearchResultsController extends Controller
$size = $this->query->getSize();
if ($size) {
$from = $this->query->getFrom();
$string = $this->query->getSearchString();
$queryString = $_REQUEST['query_string'] ?? '';
$string = !empty($_REQUEST['search-query-string']) ? $_REQUEST['search-query-string'] : $queryString;
$page = (int)($from / $size) + 1;
$prev = $page > 1;

View file

@ -409,8 +409,12 @@ class ArrayMapper
private function fixStringValue($value)
{
if (is_string($value)) {
$value = mb_convert_encoding($value, 'UTF-8', 'HTML-ENTITIES');
$value = trim($value);
preg_match_all("/&#?\w+;/", $value, $entities, PREG_SET_ORDER);
$entities = array_unique(array_column($entities, 0));
foreach ($entities as $entity) {
$decoded = mb_convert_encoding($entity, 'UTF-8', 'HTML-ENTITIES');
$value = str_replace($entity, $decoded, $value);
}
}
return $value;
}

View file

@ -122,7 +122,7 @@ class ACLRole extends SugarBean
* @param GUID $user_id
* @return array a list of ACLRole Names
*/
public function getUserRoleNames($user_id)
public static function getUserRoleNames($user_id)
{
$user_roles = sugar_cache_retrieve("RoleMembershipNames_".$user_id);

View file

@ -71,6 +71,55 @@ function getAOPAssignField($assignField, $value)
return $field;
}
/**
* @param mixed $value
* @return string
*/
function getAOPAssignFieldDetailView($value)
{
global $app_list_strings, $app_strings;
if (empty($value)){
return '';
}
if (is_string($value)){
return $value;
}
$roles = get_bean_select_array(true, 'ACLRole', 'name', '', 'name', true);
$securityGroups = get_bean_select_array(true, 'SecurityGroup', 'name', '', 'name', true);
$field = '';
$type = $value[0] ?? null;
$field .= $app_list_strings['aow_assign_options'][$type] ?? '';
if (file_exists('modules/SecurityGroups/SecurityGroup.php')) {
$display = 'none';
if (isset($value[0]) && $value[0] === 'security_group') {
$display = '';
}
if ($display !== 'none') {
$securityGroup = $value[1] ?? null;
$field .= ' | ' . $app_strings['LBL_SECURITYGROUP'] . ': ' . $securityGroups[$securityGroup] ?? '';
}
}
$display = 'none';
if (isset($value[0]) && ($value[0] === 'role' || $value[0] === 'security_group')) {
$display = '';
}
if ($display !== 'none') {
$role = $value[2] ?? null;
$field .= ' | ' . $app_strings['LBL_ROLE'] . ': ' . $roles[$role] ?? '';
}
return $field;
}
/**
* @return bool
*/

View file

@ -1427,29 +1427,10 @@ class AOR_Report extends Basic
{
$tempTableName = $module->table_name;
$module->table_name = $alias;
$where = '';
if ($module->bean_implements('ACL') && ACLController::requireOwner($module->module_dir, 'list')) {
global $current_user;
$owner_where = $module->getOwnerWhere($current_user->id);
$where = ' AND ' . $owner_where;
$where = $module->buildAccessWhere('list');
if (!empty($where)) {
$where = ' AND ' . $where;
}
if (file_exists('modules/SecurityGroups/SecurityGroup.php')) {
/* BEGIN - SECURITY GROUPS */
if ($module->bean_implements('ACL') && ACLController::requireSecurityGroup($module->module_dir, 'list')) {
require_once('modules/SecurityGroups/SecurityGroup.php');
global $current_user;
$owner_where = $module->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere($alias, $module->module_dir, $current_user->id);
if (!empty($owner_where)) {
$where .= " AND (" . $owner_where . " or " . $group_where . ") ";
} else {
$where .= ' AND ' . $group_where;
}
}
/* END - SECURITY GROUPS */
}
$module->table_name = $tempTableName;
return $where;

View file

@ -117,6 +117,11 @@ if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save') {
$_REQUEST['joomla_account_creation_email_template_id'];
$cfg->config['aop']['support_from_address'] = $_REQUEST['support_from_address'];
$cfg->config['aop']['support_from_name'] = $_REQUEST['support_from_name'];
if(isset($_REQUEST['inbound_email_case_macro'])){
$cfg->config['inbound_email_case_subject_macro'] = $_REQUEST['inbound_email_case_macro'];
}
/*
* We save the case_status_changes array as json since the way config changes are persisted to config.php
* means that removing entries is tricky. json simplifies this.
@ -152,6 +157,9 @@ $closureEmailTemplateDropdown =
$joomlaEmailTemplateDropdown =
get_select_options_with_id($emailTemplateList, $cfg->config['aop']['joomla_account_creation_email_template_id']);
$inboundEmailCaseMacro = $cfg->config['inbound_email_case_subject_macro'] ?? '';
$sugar_smarty->assign('inbound_email_case_macro', $inboundEmailCaseMacro);
$sugar_smarty->assign('USER_EMAIL_TEMPLATES', $userEmailTemplateDropdown);
$sugar_smarty->assign('CONTACT_EMAIL_TEMPLATES', $contactEmailTemplateDropdown);
$sugar_smarty->assign('CREATION_EMAIL_TEMPLATES', $creationEmailTemplateDropdown);

View file

@ -205,6 +205,17 @@
<input type="text" name="support_from_name" id="support_from_name" value="{$config.support_from_name}">
</td>
</tr>
<tr>
<td scope="row" width="200">{$MOD.LBL_CASE_MACRO}: </td>
<td >
<input type="text" name="inbound_email_case_macro" id="inbound_email_case_macro" value="{$inbound_email_case_macro}">
<span>
{$MOD.LBL_CASE_MACRO_DESC}
<br />
<i>{$MOD.LBL_CASE_MACRO_DESC2}</i>
</span>
</td>
</tr>
<tr id="user_email_template_row">
<td scope="row" width="200">{$MOD.LBL_AOP_USER_EMAIL_TEMPLATE}: </td>
<td>

View file

@ -59,44 +59,44 @@
<table id="maintable" width="430" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td scope="row"><span>{$MOD.LBL_DIAGNOSTIC_CONFIGPHP}</span></td>
<td ><span><input name='configphp' class="checkbox" type="checkbox" tabindex='1' checked></span></td>
<td ><span><input name='configphp' class="checkbox" type="checkbox" tabindex='1'></span></td>
</tr><tr>
<td scope="row"><span>{$MOD.LBL_DIAGNOSTIC_CUSTOMDIR}</span></td>
<td ><span><input name='custom_dir' class="checkbox" type="checkbox" tabindex='2' checked></span></td>
<td ><span><input name='custom_dir' class="checkbox" type="checkbox" tabindex='2'></span></td>
</tr><tr>
<td scope="row"><span>{$MOD.LBL_DIAGNOSTIC_PHPINFO}</span></td>
<td ><span><input name='phpinfo' class="checkbox" type="checkbox" tabindex='3' checked></span></td>
<td ><span><input name='phpinfo' class="checkbox" type="checkbox" tabindex='3'></span></td>
</tr><tr>
<td scope="row"><span>{$DB_NAME} - {$MOD.LBL_DIAGNOSTIC_MYSQLDUMPS}</span></td>
<td ><span><input name='mysql_dumps' class="checkbox" type="checkbox" tabindex='4' checked></span></td>
<td ><span><input name='mysql_dumps' class="checkbox" type="checkbox" tabindex='4'></span></td>
</tr><tr>
<td scope="row"><span>{$DB_NAME} - {$MOD.LBL_DIAGNOSTIC_MYSQLSCHEMA}</span></td>
<td ><span><input name='mysql_schema' class="checkbox" type="checkbox" tabindex='5' checked></span></td>
<td ><span><input name='mysql_schema' class="checkbox" type="checkbox" tabindex='5'></span></td>
</tr><tr>
<td scope="row"><span>{$DB_NAME} - {$MOD.LBL_DIAGNOSTIC_MYSQLINFO}</span></td>
<td ><span><input name='mysql_info' class="checkbox" type="checkbox" tabindex='6' checked></span></td>
<td ><span><input name='mysql_info' class="checkbox" type="checkbox" tabindex='6'></span></td>
</tr><tr>
<td scope="row"><span>{$MOD.LBL_DIAGNOSTIC_MD5}</span></td>
<td ><span><input name='md5' class="checkbox" type="checkbox" tabindex='7' onclick="md5checkboxes()" checked></span></td>
<td ><span><input name='md5' class="checkbox" type="checkbox" tabindex='7' onclick="md5checkboxes()"></span></td>
</tr><tr>
<td scope="row"><span>{$MOD.LBL_DIAGNOSTIC_FILESMD5}</span></td>
<td ><span><input name='md5filesmd5' class="checkbox" type="checkbox" tabindex='8' ></span></td>
<td ><span><input name='md5filesmd5' class="checkbox" type="checkbox" tabindex='8'></span></td>
</tr><tr>
<td scope="row"><span>{$MOD.LBL_DIAGNOSTIC_CALCMD5}</span></td>
<td ><span><input name='md5calculated' class="checkbox" type="checkbox" tabindex='9' ></span></td>
<td ><span><input name='md5calculated' class="checkbox" type="checkbox" tabindex='9'></span></td>
</tr><tr>
<td scope="row"><span>{$MOD.LBL_DIAGNOSTIC_BLBF}</span></td>
<td ><span><input name='beanlistbeanfiles' class="checkbox" type="checkbox" tabindex='10' checked></span></td>
<td ><span><input name='beanlistbeanfiles' class="checkbox" type="checkbox" tabindex='10'></span></td>
</tr><tr>
<td scope="row"><span>{$MOD.LBL_DIAGNOSTIC_SUITELOG}</span></td>
<td ><span><input name='sugarlog' class="checkbox" type="checkbox" tabindex='11' checked></span></td>
<td ><span><input name='sugarlog' class="checkbox" type="checkbox" tabindex='11'></span></td>
</tr><tr>
<td scope="row"><span>{$MOD.LBL_DIAGNOSTIC_VARDEFS}</span></td>
<td ><span><input name='vardefs' class="checkbox" type="checkbox" tabindex='11' checked></span></td>
<td ><span><input name='vardefs' class="checkbox" type="checkbox" tabindex='11'></span></td>
</tr>
</table>
</div>

View file

@ -151,8 +151,7 @@ $sugar_smarty = new Sugar_Smarty();
// if no IMAP libraries available, disable Save/Test Settings
$imapFactory = new ImapHandlerFactory();
$imap = $imapFactory->getImapHandler();
if (!$imap->isAvailable()) {
if (!$imapFactory->areAllHandlersAvailable()) {
$sugar_smarty->assign('IE_DISABLED', 'DISABLED');
}

View file

@ -290,6 +290,7 @@ class RepairAndClear
}
} else {
$this->_clearCache(sugar_cached('modules/'), '.tpl');
$this->_clearCache(sugar_cached('include/InlineEditing/'), '.tpl');
}
}
public function clearVardefs()

View file

@ -56,6 +56,4 @@ include_once 'modules/Administration/SyncInboundEmailAccounts/SyncInboundEmailAc
include_once 'modules/Administration/SyncInboundEmailAccounts/SyncInboundEmailAccountsPage.php';
include_once __DIR__ . '/../../include/Imap/ImapHandlerFactory.php';
$imapFactory = new ImapHandlerFactory();
$imap = $imapFactory->getImapHandler();
new SyncInboundEmailAccountsPage(get_defined_vars(), $imap);
new SyncInboundEmailAccountsPage(get_defined_vars());

View file

@ -71,9 +71,8 @@ class SyncInboundEmailAccountsPage
* The class handle a sub-action called method, use $_REQUEST['method']
*
* @param array $includeData
* @param ImapHandlerInterface $imap
*/
public function __construct($includeData, ImapHandlerInterface $imap)
public function __construct($includeData)
{
// create object state
@ -84,7 +83,7 @@ class SyncInboundEmailAccountsPage
// handle the sub-action
new SyncInboundEmailAccountsSubActionHandler($this, $imap);
new SyncInboundEmailAccountsSubActionHandler($this);
}
/**

View file

@ -68,27 +68,19 @@ class SyncInboundEmailAccountsSubActionHandler
*/
protected $db;
/**
*
* @var ImapHandlerInterface
*/
protected $imap;
/**
* SyncInboundEmailAccountsSubActionHandler constructor.
*
* Handle sub-action for Sync Inbound Email Accounts
*
* @param SyncInboundEmailAccountsPage $sync
* @param ImapHandlerInterface $imap
* @throws SyncInboundEmailAccountsException
* @throws SyncInboundEmailAccountsNoMethodException
*/
public function __construct(SyncInboundEmailAccountsPage $sync, ImapHandlerInterface $imap)
public function __construct(SyncInboundEmailAccountsPage $sync)
{
global $mod_strings;
$this->imap = $imap;
$this->sync = $sync;
try {
@ -244,7 +236,7 @@ class SyncInboundEmailAccountsSubActionHandler
foreach ($emailIds as $emailId => $emailData) {
$e = $this->getEmailBean($emailId);
if ($e !== false) {
$e->orphaned = $this->isOrphanedEmail($e, $ie, $IMAPHeaders);
$e->orphaned = $this->isOrphanedEmail($e, $IMAPHeaders);
if ($e->uid = $this->getIMAPUID($e->message_id, $IMAPHeaders)) {
if ($e->save()) {
$updated++;
@ -262,6 +254,8 @@ class SyncInboundEmailAccountsSubActionHandler
} catch (SyncInboundEmailAccountsEmptyException $e) {
$this->output($mod_strings['LBL_SYNC_NO_EMAIL']);
}
$this->handleIMAPErrors($ie);
} else {
$this->output($mod_strings['LBL_IE_NOT_FOUND']);
$GLOBALS['log']->debug("Inbound Email Account record not found, please check the record still exists and non-deleted: " . $ieId);
@ -269,8 +263,6 @@ class SyncInboundEmailAccountsSubActionHandler
}
$this->output($mod_strings['LBL_SYNC_DONE']);
$this->handleIMAPErrors();
$output = file_get_contents(self::PROCESS_OUTPUT_FILE);
$this->cleanup();
@ -282,11 +274,10 @@ class SyncInboundEmailAccountsSubActionHandler
/**
* @throws SyncInboundEmailAccountsException
*/
protected function handleIMAPErrors()
protected function handleIMAPErrors(InboundEmail $ie)
{
global $mod_strings;
$errs = $this->imap->getErrors();
$errs = $ie->getImap()->getErrors();
if ($errs) {
foreach ($errs as $err) {
$GLOBALS['log']->error("IMAP error detected: " . $err);
@ -294,7 +285,7 @@ class SyncInboundEmailAccountsSubActionHandler
$this->output($mod_strings['LBL_SYNC_ERROR_FOUND']);
}
$warns = $this->imap->getAlerts();
$warns = $ie->getImap()->getAlerts();
if ($warns) {
foreach ($warns as $warn) {
$GLOBALS['log']->warn("IMAP error detected: " . $warn);
@ -422,11 +413,11 @@ class SyncInboundEmailAccountsSubActionHandler
// ------------- READ IMAP EMAIL-HEADERS AND CALCULATE MD5 BASED MESSAGE_IDs ----------------
$imap_uids = $this->imap->sort(SORTDATE, 0, SE_UID);
$imap_uids = $ie->getImap()->sort(SORTDATE, 0, SE_UID);
$headers = array();
foreach ($imap_uids as $imap_uid) {
$msgNo = $this->imap->getMessageNo((int)$imap_uid);
$headers[$imap_uid] = $this->imap->getHeaderInfo($msgNo);
$msgNo = $ie->getImap()->getMessageNo((int)$imap_uid);
$headers[$imap_uid] = $ie->getImap()->getHeaderInfo($msgNo);
$headers[$imap_uid]->imap_uid = $imap_uid;
$headers[$imap_uid]->imap_msgid_int = (int)$msgNo;
}
@ -439,7 +430,7 @@ class SyncInboundEmailAccountsSubActionHandler
// ------------ IMAP CLOSE -------------
$this->imap->close();
$ie->getImap()->close();
return $headers;
@ -455,11 +446,11 @@ class SyncInboundEmailAccountsSubActionHandler
protected function getCompoundMessageIdMD5(InboundEmail $ie, $uid, $msgNo = null)
{
if (empty($msgNo) and !empty($uid)) {
$msgNo = $this->imap->getMessageNo((int)$uid);
$msgNo = $ie->getImap()->getMessageNo((int)$uid);
}
$header = $this->imap->getHeaderInfo($msgNo);
$fullHeader = $this->imap->fetchHeader($msgNo);
$header = $ie->getImap()->getHeaderInfo($msgNo);
$fullHeader = $ie->getImap()->fetchHeader($msgNo);
$message_id = $header->message_id;
$deliveredTo = $ie->id;
$matches = array();

View file

@ -326,6 +326,13 @@ $mod_strings = array(
'LBL_LOCALE' => 'Set default localization settings for your system',
'LBL_MAILBOX_DESC' => 'Set up group mail accounts for monitoring inbound email and manage personal inbound mail account information for users',
'LBL_MAILBOX_OUTBOUND_DESC' => 'Configure outbound email settings',
'LBL_MANAGE_EXTERNAL_OAUTH_CONNECTIONS' => 'External OAuth Connections',
'LBL_MANAGE_EXTERNAL_OAUTH_CONNECTIONS_DESC' => 'Setup external OAuth connections',
'LBL_MANAGE_EXTERNAL_OAUTH_PROVIDERS' => 'External OAuth Providers',
'LBL_MANAGE_EXTERNAL_OAUTH_PROVIDERS_DESC' => 'Setup external OAuth providers',
'LBL_MANAGE_CURRENCIES' => 'Currencies',
'LBL_MANAGE_LANGUAGES' => 'Languages',
'LBL_MANAGE_LICENSE_TITLE' => 'License Management',
@ -849,6 +856,10 @@ $mod_strings = array(
'LBL_AOP_CASE_CLOSURE_EMAIL_TEMPLATE' => 'Case Closed Email Template',
'LBL_AOP_JOOMLA_ACCOUNT_CREATION_EMAIL_TEMPLATE' => 'Joomla Support Portal Account Creation Template',
'LBL_CASE_MACRO' => 'Case Macro',
'LBL_CASE_MACRO_DESC' => 'Set the macro which will be parsed and used to link imported email to a Case.',
'LBL_CASE_MACRO_DESC2' => 'Set this to any value, but preserve the <b>"%1"</b>.',
'LBL_AOP_BUSINESS_HOURS_SETTINGS' => 'Business Hours',
'LBL_AOP_BUSINESS_HOURS_DESC' => "Restrict Workflow & Case automations to certain days and times",
'LBL_SUPPORT_FROM_ADDRESS' => 'Support Email From Address',

View file

@ -267,6 +267,20 @@ $admin_option_defs['Emails']['mailboxes_outbound'] = [
'./index.php?module=OutboundEmailAccounts&action=index',
'outbound-email'
];
$admin_option_defs['Emails']['external_oauth_connections'] = [
'ExternalOAuthConnection',
'LBL_MANAGE_EXTERNAL_OAUTH_CONNECTIONS',
'LBL_MANAGE_EXTERNAL_OAUTH_CONNECTIONS_DESC',
'index.php?module=ExternalOAuthConnection&action=index',
'oauth2'
];
$admin_option_defs['Emails']['external_oauth_providers'] = [
'ExternalOAuthProvider',
'LBL_MANAGE_EXTERNAL_OAUTH_PROVIDERS',
'LBL_MANAGE_EXTERNAL_OAUTH_PROVIDERS_DESC',
'index.php?module=ExternalOAuthProvider&action=index',
'oauth2'
];
$admin_option_defs['Campaigns']['mass_Email'] = [
'EmailQueue',
'LBL_MASS_EMAIL_MANAGER_TITLE',

View file

@ -150,7 +150,7 @@ if (strstr($focus->settings['notify_fromaddress'], 'example.com')) {
$conf_msg .= "<tr><th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_NAME']."</b></th>"
. " <th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_ADDRESS']."</b></th>"
. " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SENDTYPE']."</b></th>";
if ($focus->settings['mail_sendtype']=='SMTP') {
if (strtolower(isSmtp($focus->settings['mail_sendtype'] ?? '')) {
$conf_msg .= " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPSERVER']."</b></th>"
. " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPUSER']."</b></th></tr>";
} else {
@ -162,7 +162,7 @@ if (strstr($focus->settings['notify_fromaddress'], 'example.com')) {
$conf_msg .= "<tr><td>".$focus->settings['notify_fromname']."</td>";
$conf_msg .= "<td>".$focus->settings['notify_fromaddress']."</td>";
$conf_msg .= "<td>".$focus->settings['mail_sendtype']."</td>";
if ($focus->settings['mail_sendtype']=='SMTP') {
if (isSmtp($focus->settings['mail_sendtype'] ?? '')) {
$conf_msg .= "<td>".$focus->settings['mail_smtpserver']."</td>";
$conf_msg .= "<td>".$focus->settings['mail_smtpuser']."</td></tr>";
} else {

View file

@ -169,8 +169,7 @@ $ss->assign('ROLLOVER', $email->rolloverStyle);
$imapFactory = new ImapHandlerFactory();
$imap = $imapFactory->getImapHandler();
if (!$imap->isAvailable()) {
if (!$imapFactory->areAllHandlersAvailable()) {
$ss->assign('IE_DISABLED', 'DISABLED');
}
/**************************** SUMMARY UI DIV Stuff *******************/

View file

@ -413,15 +413,12 @@ function get_subscription_lists_query($focus, $additional_fields = null)
$all_news_type_pl_query .= "and c.campaign_type = 'NewsLetter' and pl.deleted = 0 and c.deleted=0 and plc.deleted=0 ";
$all_news_type_pl_query .= "and (pl.list_type like 'exempt%' or pl.list_type ='default') ";
/* BEGIN - SECURITY GROUPS */
if ($focus->bean_implements('ACL') && ACLController::requireSecurityGroup('Campaigns', 'list')) {
require_once('modules/SecurityGroups/SecurityGroup.php');
global $current_user;
$owner_where = $focus->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere('c', 'Campaigns', $current_user->id);
$all_news_type_pl_query .= " AND ( c.assigned_user_id ='".$current_user->id."' or ".$group_where.") ";
$campaign = BeanFactory::newBean('Campaigns');
$campaign->table_name = 'c';
$accessWhere = $campaign->buildAccessWhere('list');
if (!empty($accessWhere)) {
$all_news_type_pl_query .= ' AND ' . $accessWhere;
}
/* END - SECURITY GROUPS */
$all_news_type_list =$focus->db->query($all_news_type_pl_query);

View file

@ -305,7 +305,7 @@ do {
$send_all = $send_all ? !$no_items_in_queue : $send_all;
} while ($send_all);
if ($admin->settings['mail_sendtype'] == "SMTP") {
if (isSmtp($admin->settings['mail_sendtype'] ?? '')) {
$mail->SMTPClose();
}
if (isset($temp_user)) {

View file

@ -2065,7 +2065,7 @@ class Email extends Basic
}
$send_type = $current_user->getPreference('mail_sendtype');
if (!empty($send_type) && $send_type == "SMTP") {
if (isSmtp($send_type ?? '')) {
$mail_smtpserver = $current_user->getPreference('mail_smtpserver');
$mail_smtpport = $current_user->getPreference('mail_smtpport');
$mail_smtpauth_req = $current_user->getPreference('mail_smtpauth_req');
@ -2781,7 +2781,7 @@ class Email extends Basic
// ssl or tcp - keeping outside isSMTP b/c a default may inadvertantly set ssl://
$mail->protocol = ($oe->mail_smtpssl) ? "ssl://" : "tcp://";
if ($oe->mail_sendtype == "SMTP") {
if (isSmtp($oe->mail_sendtype ?? '')) {
//Set mail send type information
$mail->Mailer = "smtp";
$mail->Host = $oe->mail_smtpserver;

View file

@ -2543,25 +2543,26 @@ eoq;
$whereAdd .= "{$column} LIKE '{$clause}%'";
}
foreach ($peopleTables as $tableName) {
$module = ucfirst($tableName);
$personBean = BeanFactory::getBean($module);
foreach ($peopleTables as $table) {
$module = ucfirst($table);
$class = substr($module, 0, strlen($module) - 1);
require_once("modules/{$module}/{$class}.php");
$person = new $class();
if (!$person->ACLAccess('list')) {
if ($personBean !== false || !$personBean->ACLAccess('list')) {
continue;
} // if
$table = $personBean->getTableName();
$where = "({$table}.deleted = 0 AND eabr.primary_address = 1 AND {$table}.id <> '{$current_user->id}')";
if (ACLController::requireOwner($module, 'list')) {
$where = $where . " AND ({$table}.assigned_user_id = '{$current_user->id}')";
} // if
$accessWhere = $personBean->buildAccessWhere('list');
if (!empty($accessWhere)) {
$where .= ' AND '. $accessWhere;
}
if (!empty($whereAdd)) {
$where .= " AND ({$whereAdd})";
}
if ($person === 'accounts') {
if ($personBean instanceof Company) {
$t = "SELECT {$table}.id, '' first_name, {$table}.name, eabr.primary_address, ea.email_address, '{$module}' module ";
} else {
$t = "SELECT {$table}.id, {$table}.first_name, {$table}.last_name, eabr.primary_address, ea.email_address, '{$module}' module ";
@ -2571,18 +2572,6 @@ eoq;
$t .= "JOIN email_addresses ea ON (eabr.email_address_id = ea.id) ";
$t .= " WHERE {$where}";
/* BEGIN - SECURITY GROUPS */
//this function may not even be used anymore. Seems like findEmailFromBeanIds is preferred now
if ($person->bean_implements('ACL') && ACLController::requireSecurityGroup($module, 'list')) {
require_once('modules/SecurityGroups/SecurityGroup.php');
global $current_user;
$owner_where = $person->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere($table, $module, $current_user->id);
$t .= " AND (" . $owner_where . " or " . $group_where . ") ";
}
/* END - SECURITY GROUPS */
if (!empty($q)) {
$q .= "\n UNION ALL \n";
}
@ -2675,41 +2664,44 @@ eoq;
$relatedIDs = implode(',', $beanIds);
}
if ($beanType == 'accounts') {
if (isset($whereArr['first_name'])) {
$whereArr['name'] = $whereArr['first_name'];
}
unset($whereArr['last_name']);
unset($whereArr['first_name']);
}
$module = ucfirst($beanType);
$personBean = BeanFactory::getBean($module);
if ($personBean !== false && $personBean->ACLAccess('list')) {
foreach ($whereArr as $column => $clause) {
if (!empty($whereAdd)) {
$whereAdd .= " OR ";
if ($personBean instanceof Company) {
if (isset($whereArr['first_name'])) {
$whereArr['name'] = $whereArr['first_name'];
}
unset($whereArr['last_name']);
unset($whereArr['first_name']);
}
$clause = $current_user->db->quote($clause);
$whereAdd .= "{$column} LIKE '{$clause}%'";
}
$table = $beanType;
$module = ucfirst($table);
$class = substr($module, 0, strlen($module) - 1);
require_once("modules/{$module}/{$class}.php");
$person = new $class();
if ($person->ACLAccess('list')) {
if ($relatedIDs != '') {
foreach ($whereArr as $column => $clause) {
if (!empty($whereAdd)) {
$whereAdd .= " OR ";
}
$clause = $current_user->db->quote($clause);
$whereAdd .= "{$column} LIKE '{$clause}%'";
}
$table = $personBean->getTableName();
if ($relatedIDs !== '') {
$where = "({$table}.deleted = 0 AND eabr.primary_address = 1 AND {$table}.id in ($relatedIDs))";
} else {
$where = "({$table}.deleted = 0 AND eabr.primary_address = 1)";
}
if (ACLController::requireOwner($module, 'list')) {
$where = $where . " AND ({$table}.assigned_user_id = '{$current_user->id}')";
} // if
$accessWhere = $personBean->buildAccessWhere('list');
if (!empty($accessWhere)) {
$where .= ' AND '. $accessWhere;
}
if (!empty($whereAdd)) {
$where .= " AND ({$whereAdd})";
}
if ($beanType === 'accounts') {
if ($personBean instanceof Company) {
$t = "SELECT {$table}.id, '' first_name, {$table}.name last_name, eabr.primary_address, ea.email_address, '{$module}' module ";
} else {
$t = "SELECT {$table}.id, {$table}.first_name, {$table}.last_name, eabr.primary_address, ea.email_address, '{$module}' module ";
@ -2719,16 +2711,6 @@ eoq;
$t .= "JOIN email_addr_bean_rel eabr ON ({$table}.id = eabr.bean_id and eabr.deleted=0) ";
$t .= "JOIN email_addresses ea ON (eabr.email_address_id = ea.id) ";
$t .= " WHERE {$where}";
/* BEGIN - SECURITY GROUPS */
//this function may not even be used anymore. Seems like findEmailFromBeanIds is preferred now
if ($person->bean_implements('ACL') && ACLController::requireSecurityGroup($module, 'list')) {
require_once('modules/SecurityGroups/SecurityGroup.php');
global $current_user;
$owner_where = $person->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere($table, $module, $current_user->id);
$t .= " AND (" . $owner_where . " or " . $group_where . ") ";
}
/* END - SECURITY GROUPS */
} // if
return $t;
@ -3011,7 +2993,7 @@ eoq;
foreach ($ieAccountsFull as $k => $v) {
$personalSelected = (!empty($showFolders) && in_array($v->id, $showFolders));
$allowOutboundGroupUsage = $v->get_stored_options('allow_outbound_group_usage', false);
$allowOutboundGroupUsage = isTrue($v->get_stored_options('allow_outbound_group_usage', false) ?? false);
$groupSelected = (in_array($v->groupfolder_id, $groupSubs) && $allowOutboundGroupUsage);
$selected = ($personalSelected || $groupSelected);
@ -3231,7 +3213,7 @@ eoq;
$type = $v->is_personal ? $mod_strings['LBL_MAILBOX_TYPE_PERSONAL'] : $mod_strings['LBL_MAILBOX_TYPE_GROUP'];
$personalSelected = (!empty($showFolders) && in_array($v->id, $showFolders, true));
$allowOutboundGroupUsage = $v->get_stored_options('allow_outbound_group_usage', false);
$allowOutboundGroupUsage = isTrue($v->get_stored_options('allow_outbound_group_usage', false) ?? false);
$selected = $personalSelected || $allowOutboundGroupUsage || is_admin($current_user);
if (!$selected) {

View file

@ -937,7 +937,7 @@ class EmailsController extends SugarController
// if group email account, check that user is allowed to use group email account
if ($requestedInboundEmail->isGroupEmailAccount()) {
if ($inboundEmailStoredOptions['allow_outbound_group_usage'] === true) {
if (isTrue($inboundEmailStoredOptions['allow_outbound_group_usage'] ?? false)) {
$hasAccessToInboundEmailAccount = true;
} else {
$hasAccessToInboundEmailAccount = false;

View file

@ -147,11 +147,17 @@ class EmailsDataAddressCollector
foreach ($ieAccounts as $inboundEmail) {
$this->validateInboundEmail($inboundEmail);
if (in_array($inboundEmail->id, $showFolders, false)) {
if (in_array($inboundEmail->id, $showFolders)) {
$storedOptions = sugar_unserialize(base64_decode($inboundEmail->stored_options));
$isGroupEmailAccount = $inboundEmail->isGroupEmailAccount();
$isPersonalEmailAccount = $inboundEmail->isPersonalEmailAccount();
// if group email account, check that user is allowed to use group email account
$inboundEmailStoredOptions = $inboundEmail->getStoredOptions();
if ($isGroupEmailAccount && !isTrue($inboundEmailStoredOptions['allow_outbound_group_usage'] ?? false)) {
continue;
}
$this->getOutboundEmailOrError($storedOptions, $inboundEmail);
$this->retrieveFromDataStruct($storedOptions);

View file

@ -129,6 +129,7 @@ class Folder
if (isset($request['folders_id']) && !empty($request['folders_id'])) {
$foldersId = $request['folders_id'];
$this->retrieve($foldersId);
$_SESSION['CURRENT_IMAP_MAILBOX_ID'] = $request['folders_id'];
} else {
$GLOBALS['log']->warn("Empty or undefined Email Folder ID");
}
@ -136,6 +137,39 @@ class Folder
return $this;
}
/**
* @param array|null $request
* @throws SuiteException
*/
public function loadMailboxFolder(?array $request): void
{
global $current_user;
$inboundEmailID = $current_user->getPreference('defaultIEAccount', 'Emails');
$folderId = '';
if (isset($request['folders_id']) && !empty($request['folders_id'])) {
$folderId = $request['folders_id'];
} elseif (!empty($_SESSION['CURRENT_IMAP_MAILBOX_ID'])) {
$folderId = $_SESSION['CURRENT_IMAP_MAILBOX_ID'];
} elseif (!empty($inboundEmailID)) {
$folderId = $inboundEmailID;
}
if (!$this->isSelectedForDisplay($folderId)) {
$folderId = $this->getFirstDisplayFolder();
}
if (!empty($folderId)) {
$this->retrieve($folderId);
$_SESSION['CURRENT_IMAP_MAILBOX_ID'] = $folderId;
return;
}
$_SESSION['CURRENT_IMAP_MAILBOX_ID'] = '';
$GLOBALS['log']->warn("Empty or undefined Email Folder ID");
}
/**
* @return string
*/
@ -159,4 +193,31 @@ class Folder
{
return $this->mailbox;
}
/**
* Check if folder is to display
* @param $folderId
* @return bool
*/
public function isSelectedForDisplay($folderId): bool
{
return (new SugarFolder())->isToDisplay($folderId);
}
/**
* @return mixed|string
*/
protected function getFirstDisplayFolder(): ?string
{
$folder = new SugarFolder();
$folder = $folder->getFirstDisplayFolders();
if ($folder === null) {
return null;
}
return $folder['id'] ?? '';
}
}

View file

@ -160,38 +160,6 @@ class ListViewDataEmails extends ListViewData
*/
$inboundEmail = BeanFactory::getBean('InboundEmail', $inboundEmailID);
if (!$inboundEmail || !isset($inboundEmail->id) || !$inboundEmail->id) {
// something went wrong when SugarBean trying to retrieve the inbound email account
// maybe there is no IE bean in database or wrong ID stored in user preferences?
// look at the active group emails and load from the first one possibility
$query = "
SELECT inbound_email.id FROM inbound_email
JOIN folders ON
folders.id = inbound_email.id AND
folders.folder_type = 'inbound' AND
folders.deleted = 0
WHERE
inbound_email.status = 'Active' AND
inbound_email.mailbox_type not like 'bounce' AND
inbound_email.is_personal = 0 AND
inbound_email.deleted = 0";
$results = $this->db->query($query);
$rows = array();
while ($row = $this->db->fetchByAssoc($results)) {
$rows[] = $row;
}
if ($rows) {
$inboundEmailID = $rows[0]['id'];
$inboundEmail = BeanFactory::getBean('InboundEmail', $inboundEmailID);
}
}
if (!$inboundEmail) {
throw new SuiteException("Error: InboundEmail not loaded (id:{$inboundEmailID})");
}
@ -742,7 +710,13 @@ class ListViewDataEmails extends ListViewData
try {
$folderObj = new Folder();
$folderObj->retrieveFromRequest($request);
$folderObj->loadMailboxFolder($request ?? []);
if (empty($folderObj->getId())) {
LoggerManager::getLogger()->warn('Unable get Inbound Email for List View. Please check your settings and try again.');
return false;
}
$inboundEmail = $this->getInboundEmail($current_user, $folderObj);
if (!$inboundEmail || $inboundEmail && !$inboundEmail->id) {

View file

@ -202,10 +202,6 @@ class ListViewDataEmailsSearchOnIMap extends ListViewDataEmailsSearchAbstract
$nextOffset = $offset + $limitPerPage;
}
if ($nextOffset >= $total) {
$nextOffset = $total;
}
if ($page > 0) {
$prevOffset = $offset - $limitPerPage;
if ($prevOffset < 0) {
@ -219,22 +215,35 @@ class ListViewDataEmailsSearchOnIMap extends ListViewDataEmailsSearchAbstract
}
if ($total > 0) {
$endOffset = $total / $limitPerPage;
$endOffset = ceil($total / $limitPerPage);
}
if ($nextOffset >= $total) {
$nextOffset = -1;
$endOffset = $offset;
}
$pageData['offsets']['current'] = $offset;
$pageData['offsets']['total'] = $total;
$pageData['offsets']['next'] = $nextOffset;
$pageData['offsets']['prev'] = $prevOffset;
$pageData['offsets']['end'] = ceil($endOffset);
$pageData['offsets']['end'] = $endOffset;
$queries = array('baseUrl', 'endPage', 'nextPage', 'orderBy');
$queries = array('baseUrl', 'orderBy');
if ((int)$pageData['offsets']['current'] >= $limitPerPage) {
$queries[] = 'prevPage';
$queries[] = 'startPage';
}
if ($nextOffset !== -1) {
$queries[] = 'nextPage';
}
if ($endOffset !== -1) {
$queries[] = 'endPage';
}
foreach ($queries as $query) {
if ($total < $limitPerPage || $nextOffset >= $total) {
if (isset($pageData['queries'][$query])) {
@ -281,13 +290,16 @@ class ListViewDataEmailsSearchOnIMap extends ListViewDataEmailsSearchAbstract
if (!isset($pageData['ordering'])) {
$pageData['ordering'] = array(
'orderBy' => 'date_entered',
'sortOrder'=> 'ASC'
'orderBy' => 'date_sent_received',
'sortOrder'=> 'DESC'
);
}
// TODO: TASK: UNDEFINED - HANDLE in second filter after IMap
$endOffset = floor(($total - 1) / $limit) * $limit;
if ($endOffset !== -1) {
// TODO: TASK: UNDEFINED - HANDLE in second filter after IMap
$endOffset = floor(($total - 1) / $limit) * $limit;
}
if (!isset($pageData['ordering']) || !isset($pageData['ordering']['sortOrder'])) {
LoggerManager::getLogger()->warn('ListViewDataEmailsSearchOnIMap::search: sort order is not set. Using null by default.');

View file

@ -3440,15 +3440,6 @@
active: true
}));
tabContent.parentNode.removeChild(tabContent);
tabContent = Dom.get("tab_accounts");
var accountTab = new YAHOO.widget.Tab({
label: app_strings.LBL_EMAIL_SETTINGS_ACCOUNTS,
scroll: true,
content: tabContent.innerHTML,
id: "accountSettings"
});
tp.addTab(accountTab);
tabContent.parentNode.removeChild(tabContent);
tp.appendTo(dlg.body);
}

View file

@ -126,6 +126,7 @@ $listViewDefs['Emails'] = array(
'width' => '32',
'label' => 'LBL_LIST_FROM_ADDR',
'default' => true,
'sortable' => false,
),
'INDICATOR' => array(
'width' => '32',
@ -140,7 +141,8 @@ $listViewDefs['Emails'] = array(
'label' => 'LBL_LIST_SUBJECT',
'default' => true,
'link' => false,
'customCode' => ''
'customCode' => '',
'sortable' => false,
),
'HAS_ATTACHMENT' => array(
'width' => '32',
@ -154,27 +156,32 @@ $listViewDefs['Emails'] = array(
'label' => 'LBL_ASSIGNED_TO_NAME',
'module' => 'Employees',
'id' => 'ASSIGNED_USER_ID',
'default' => false
'default' => false,
'sortable' => false,
),
'DATE_ENTERED' => array(
'width' => '32',
'label' => 'LBL_DATE_ENTERED',
'default' => true,
'sortable' => false,
),
'DATE_SENT_RECEIVED' => array(
'width' => '32',
'label' => 'LBL_LIST_DATE_SENT_RECEIVED',
'default' => true,
'sortable' => false,
'force_show_sort_direction' => true
),
'TO_ADDRS_NAMES' => array(
'width' => '32',
'label' => 'LBL_LIST_TO_ADDR',
'default' => false,
'sortable' => false,
),
'CATEGORY_ID' => array(
'width' => '10%',
'label' => 'LBL_LIST_CATEGORY',
'default' => true,
'sortable' => false,
),
'CATEGORY_ID' =>
array(
'width' => '10%',
'label' => 'LBL_LIST_CATEGORY',
'default' => true,
),
);

View file

@ -57,6 +57,13 @@ class EmailsViewList extends ViewList
*/
public function preDisplay()
{
$_REQUEST['orderBy'] = 'date_sent_received';
$_REQUEST['sortOrder'] = 'DESC';
$this->params['orderBy'] = 'date_sent_received';
$this->params['sortOrder'] = 'DESC';
$this->params['overrideOrder'] = true;
$this->lv = new ListViewSmartyEmails();
$this->lv->displayEmptyDataMessages = false;
}
}

View file

@ -0,0 +1,304 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
* OAuth connection
*/
class ExternalOAuthConnection extends Basic
{
public $module_dir = 'ExternalOAuthConnection';
public $object_name = 'ExternalOAuthConnection';
public $table_name = 'external_oauth_connections';
public $disable_row_level_security = true;
public $client_id;
public $client_secret;
public $token_type;
public $expires_in;
public $access_token;
public $refresh_token;
public $type;
/**
* @inheritDoc
*/
public function retrieve($id = -1, $encode = true, $deleted = true)
{
$result = parent::retrieve($id, $encode, $deleted);
if (!empty($result) && !$this->checkPersonalAccountAccess()) {
$this->logPersonalAccountAccessDenied('retrieve');
return null;
}
return $result;
}
/**
* @inheritDoc
*/
public function save($check_notify = false)
{
if (!$this->checkPersonalAccountAccess()) {
$this->logPersonalAccountAccessDenied('save');
throw new RuntimeException('Access Denied');
}
$this->keepWriteOnlyFieldValues();
return parent::save($check_notify);
}
/**
* Check if user has access to personal account
* @return bool
*/
public function checkPersonalAccountAccess(): bool
{
global $current_user;
if (is_admin($current_user)) {
return true;
}
if (empty($this->type)) {
return true;
}
if ($this->type !== 'personal') {
return true;
}
if (empty($this->created_by)) {
return true;
}
if ($this->created_by === $current_user->id) {
return true;
}
return false;
}
/**
* Log personal account access denied
* @param string $action
* @return void
*/
public function logPersonalAccountAccessDenied(string $action): void
{
global $log, $current_user;
$log->fatal("ExternalOAuthConnection | Access denied. Non-admin user trying to access personal account. Action: '" . $action . "' | Current user id: '" . $current_user->id . "' | record: '" . $this->id . "'");
}
/**
* @inheritDoc
*/
public function bean_implements($interface)
{
if ($interface === 'ACL') {
return true;
}
return false;
}
/**
* @inheritDoc
*/
public function ACLAccess($view, $is_owner = 'not_set', $in_group = 'not_set')
{
global $current_user;
$isNotAllowAction = $this->isNotAllowedAction($view);
if ($isNotAllowAction === true) {
return false;
}
if (!$this->checkPersonalAccountAccess()) {
$this->logPersonalAccountAccessDenied("ACLAccess-$view");
return false;
}
$isPersonal = $this->type === 'personal';
$isAdmin = is_admin($current_user);
if ($isPersonal === true && $this->checkPersonalAccountAccess()) {
return true;
}
$isAdminOnlyAction = $this->isAdminOnlyAction($view);
if (!$isPersonal && !$isAdmin && $isAdminOnlyAction === true) {
return false;
}
$hasActionAclsDefined = has_group_action_acls_defined('ExternalOAuthConnection', 'view');
$isSecurityGroupBasedAction = $this->isSecurityGroupBasedAction($view);
if (!$isPersonal && !$isAdmin && !$hasActionAclsDefined && $isSecurityGroupBasedAction === true) {
return false;
}
return parent::ACLAccess($view, $is_owner, $in_group);
}
/**
* @inheritDoc
*/
public function create_new_list_query(
$order_by,
$where,
$filter = array(),
$params = array(),
$show_deleted = 0,
$join_type = '',
$return_array = false,
$parentbean = null,
$singleSelect = false,
$ifListForExport = false
) {
global $current_user, $db;
$ret_array = parent::create_new_list_query(
$order_by,
$where,
$filter,
$params,
$show_deleted,
$join_type,
true,
$parentbean,
$singleSelect,
$ifListForExport
);
if (is_array($ret_array) && !empty($ret_array['where'])) {
$tableName = $db->quote($this->table_name);
$currentUserId = $db->quote($current_user->id);
$showGroupRecords = "($tableName.type IS NULL) OR ($tableName.type != 'personal' ) OR ";
$hasActionAclsDefined = has_group_action_acls_defined('ExternalOAuthConnection', 'list');
if($hasActionAclsDefined === false && !is_admin($current_user)) {
$showGroupRecords = '';
}
$ret_array['where'] = $ret_array['where'] . " AND ( $showGroupRecords ($tableName.type = 'personal' AND $tableName.created_by = '$currentUserId') )";
}
if ($return_array) {
return $ret_array;
}
return $ret_array['select'] . $ret_array['from'] . $ret_array['where'] . $ret_array['order_by'];
}
/**
* Do not clear write only fields
* @return void
*/
protected function keepWriteOnlyFieldValues(): void
{
if (empty($this->fetched_row)) {
return;
}
foreach ($this->field_defs as $field => $field_def) {
if (empty($field_def['display']) || $field_def['display'] !== 'writeonly') {
continue;
}
if (empty($this->fetched_row[$field])) {
continue;
}
if (!empty($this->$field)) {
continue;
}
$this->$field = $this->fetched_row[$field];
}
}
/**
* Check if its admin only action
* @param string $view
* @return bool
*/
protected function isAdminOnlyAction(string $view): bool
{
$adminOnlyAction = ['edit', 'delete', 'editview', 'save'];
return in_array(strtolower($view), $adminOnlyAction);
}
/**
* Check if its a security based action
* @param string $view
* @return bool
*/
protected function isSecurityGroupBasedAction(string $view): bool
{
$securityBasedActions = ['detail', 'detailview', 'view'];
return in_array(strtolower($view), $securityBasedActions);
}
/**
* Get not allowed action
* @param string $view
* @return bool
*/
protected function isNotAllowedAction(string $view): bool
{
$notAllowed = ['export', 'import', 'massupdate', 'duplicate'];
return in_array(strtolower($view), $notAllowed);
}
}

View file

@ -0,0 +1,54 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
global $mod_strings;
$module_menu = array();
$module_menu[]= array("index.php?module=ExternalOAuthConnection&action=EditView&type=personal", $mod_strings['LNK_LIST_CREATE_NEW_PERSONAL'],"Create");
if (is_admin($GLOBALS['current_user'])) {
$module_menu[]= array("index.php?module=ExternalOAuthConnection&action=EditView&type=group", $mod_strings['LNK_LIST_CREATE_NEW_GROUP'],"Create");
}
$module_menu[]= array("index.php?module=InboundEmail&action=index", $mod_strings['LNK_LIST_INBOUND_EMAILS'],"List");
$module_menu[]= array("index.php?module=OutboundEmailAccounts&action=index", $mod_strings['LNK_LIST_OUTBOUND_EMAILS'],"List");
$module_menu[]= array("index.php?module=ExternalOAuthConnection&action=index", $mod_strings['LNK_LIST'],"List");
$module_menu[]= array("index.php?module=ExternalOAuthProvider&action=index", $mod_strings['LNK_LIST_EXTERNAL_OAUTH_PROVIDERS'],"List");

View file

@ -0,0 +1,61 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
class ExternalOAuthConnectionController extends SugarController
{
public function action_EditView() {
$this->view = 'edit';
if (!empty($this->bean) && !empty($_REQUEST['type'])) {
$this->bean->type = $_REQUEST['type'];
}
if (empty($_REQUEST['record']) && !empty($_REQUEST['type']) && $_REQUEST['type'] === 'personal') {
$this->hasAccess = true;
return;
}
if (!empty($this->bean) && $_REQUEST['type'] === 'personal' && $this->bean->checkPersonalAccountAccess()) {
$this->hasAccess = true;
}
}
}

View file

@ -0,0 +1,64 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once 'include/entryPoint.php';
global $sugar_config, $log;
require_once __DIR__ . '/../services/OAuthAuthorizationService.php';
$oAuth = new OAuthAuthorizationService();
$providerId = $_GET['provider'] ?? '';
if (!$oAuth->hasProvider($providerId)) {
$log->fatal("The specified OAuth2 provider '$providerId' is not supported or not properly configured");
$oAuth->cleanSession();
exit('The specified OAuth2 providers is not supported or not properly configured');
}
$_SESSION['provider'] = $providerId;
$clientId = $_GET['clientId'] ?? '';
$clientSecret = $_GET['clientSecret'] ?? '';
$oAuth->authorizationRedirect($providerId, $clientId, $clientSecret);
exit;

View file

@ -0,0 +1,86 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once 'include/entryPoint.php';
global $sugar_config, $log;
require_once __DIR__ . '/../services/OAuthAuthorizationService.php';
$oAuth = new OAuthAuthorizationService();
$providerId = $_GET['provider'] ?? '';
if (empty($providerId) && !empty($_SESSION['provider'])) {
$providerId = $_SESSION['provider'];
}
if (!$oAuth->hasProvider($providerId)) {
$oAuth->cleanSession();
$log->fatal("The specified OAuth2 provider '$providerId' is not supported or not properly configured");
exit('The specified OAuth2 providers is not supported or not properly configured');
}
if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
$oAuth->cleanSession();
exit('Invalid state');
}
$code = $_GET['code'] ?? '';
$request = json_encode($_GET, JSON_THROW_ON_ERROR) ?? '';
$oAuth->log('debug', 'setExternalOAuthToken::request', $request);
$token = $oAuth->getAccessToken($providerId, $code);
if ($token === null) {
exit('Not able to get access token. Check logs for more details');
}
$mappedToken = $oAuth->mapToken($providerId, $token);
$ss = new Sugar_Smarty();
$ss->assign('token', $mappedToken);
$tpl = __DIR__ . '/../tpl/setToken.tpl';
echo $ss->fetch($tpl);
exit;

View file

@ -0,0 +1,60 @@
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
function doOAuthAuthentication() {
var provider = externalOAuthConnectionFields.getValue('external_oauth_provider_id');
var clientId = externalOAuthConnectionFields.getValue('client_id');
var clientSecret = externalOAuthConnectionFields.getValue('client_secret');
var params = {
provider: provider,
};
if (clientId) {
params.client_id = clientId;
}
if (clientSecret) {
params.client_secret = clientSecret;
}
var query = $.param(params);
window.open('index.php?entryPoint=redirectToExternalOAuth&' + query, '_blank', 'toolbar=yes,scrollbars=yes');
}

View file

@ -0,0 +1,188 @@
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
var externalOAuthConnectionFields = function () {
var getDefaultFieldGetter = function () {
return function (field$) {
return (field$ && field$.val()) || '';
};
};
var getDefaultFieldSetter = function () {
return function (field$, value) {
if (!field$) {
return;
}
field$.val(value);
field$.change();
};
};
return {
fields: {
'record': {
type: 'varchar',
getField$: function (field) {
return $('input[name=' + field + ']') || null;
}
},
'name': {
type: 'varchar'
},
'client_id': {
type: 'varchar'
},
'client_secret': {
type: 'varchar'
},
'token_type': {
type: 'varchar'
},
'expires_in': {
type: 'varchar'
},
'access_token': {
type: 'varchar'
},
'refresh_token': {
type: 'varchar'
},
},
getters: {
default: getDefaultFieldGetter(),
varchar: getDefaultFieldGetter(),
checkbox: function (field$) {
return (field$ && field$.prop('checked')) || false;
}
},
setters: {
default: getDefaultFieldSetter(),
varchar: getDefaultFieldSetter(),
checkbox: function (field$, value) {
if (!field$) {
return;
}
field$.prop('checked', !!value);
}
},
setValue: function (field, value) {
var field$ = this.getField$(field);
if (!field$) {
return null;
}
var setter = this.getValueSetter(field);
if (!setter) {
return null;
}
return setter(field$, value);
},
getValue: function (field) {
var field$ = this.getField$(field);
if (!field$) {
return null;
}
var getter = this.getValueGetter(field);
if (!getter) {
return null;
}
return getter(field$);
},
hide: function (field) {
var field$ = this.getFieldCell$(field);
if (!field$ || !field$.length) {
return;
}
field$.hide();
},
show: function (field) {
var field$ = this.getFieldCell$(field);
if (!field$ || !field$.length) {
return;
}
field$.show();
},
getField$: function (field) {
var handler = (this.fields[field] && this.fields[field].getField$) || null;
if (handler) {
return handler(field);
}
return $('#' + field) || null;
},
getFieldCell$: function (field) {
return $('[data-field="' + field + '"]') || null;
},
getFieldType: function (field) {
return (this.fields[field] && this.fields[field].type) || 'varchar';
},
getValueGetter: function (field) {
var type = this.getFieldType(field);
return this.getters[type] || this.getters['default'];
},
getValueSetter: function (field) {
var type = this.getFieldType(field);
return this.setters[type] || this.setters['default'];
}
};
}();

View file

@ -0,0 +1,100 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = [
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',
'LBL_ID' => 'ID',
'LBL_DATE_ENTERED' => 'Date Created',
'LBL_DATE_MODIFIED' => 'Date Modified',
'LBL_MODIFIED' => 'Modified By',
'LBL_MODIFIED_NAME' => 'Modified By Name',
'LBL_CREATED' => 'Created By',
'LBL_DESCRIPTION' => 'Description',
'LBL_DELETED' => 'Deleted',
'LBL_NAME' => 'Name',
'LBL_CREATED_USER' => 'Created by User',
'LBL_MODIFIED_USER' => 'Modified by User',
'LBL_LIST_NAME' => 'Name',
'LBL_EDIT_BUTTON' => 'Edit',
'LBL_REMOVE' => 'Remove',
'LBL_LIST_FORM_TITLE' => 'External OAuth Connection List',
'LBL_MODULE_NAME' => 'External OAuth Connections',
'LBL_MODULE_TITLE' => 'External OAuth Connections',
'LBL_HOMEPAGE_TITLE' => 'My External OAuth Connections',
'LNK_NEW_RECORD' => 'Create External OAuth Connection',
'LNK_LIST' => 'External OAuth Connections',
'LBL_SEARCH_FORM_TITLE' => 'Search External OAuth Connections',
'LBL_HISTORY_SUBPANEL_TITLE' => 'View History',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
'LBL_NEW_FORM_TITLE' => 'New External OAuth Connection',
'LBL_LIST_DELETE' => 'Delete',
'LBL_TYPE' => 'Type',
'LBL_CLIENT_ID' => 'Client Id',
'LBL_CLIENT_SECRET' => 'Client Secret',
'LBL_TOKEN_TYPE' => 'Token type',
'LBL_EXPIRES_IN' => 'Expires In',
'LBL_ACCESS_TOKEN' => 'Access Token',
'LBL_REFRESH_TOKEN' => 'Refresh Token',
'LBL_PROVIDER' => 'Provider',
'LBL_AUTHENTICATE' => 'Authenticate',
'LBL_EXTERNAL_OAUTH_PROVIDER' => 'Provider',
'LBL_EXTERNAL_OAUTH_PROVIDER_NAME' => 'Provider',
'LBL_EXTERNAL_OAUTH_PROVIDER_ID' => 'Provider Id',
'LNK_LIST_CREATE_NEW_PERSONAL' => 'New Personal OAuth Connection',
'LNK_LIST_CREATE_NEW_GROUP' => 'New Group OAuth Connection',
'LNK_LIST_INBOUND_EMAILS' => 'Inbound Email Accounts',
'LNK_LIST_OUTBOUND_EMAILS' => 'Outbound Email Accounts',
'LNK_LIST_EXTERNAL_OAUTH_PROVIDERS' => 'External OAuth Providers',
'LBL_OWNER' => 'Owner',
];

View file

@ -0,0 +1,48 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$module_name = 'ExternalOAuthConnection';
$searchFields[$module_name] = [
'type' => ['query_type' => 'default'],
'name' => ['query_type' => 'default'],
];

View file

@ -0,0 +1,98 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$module_name = 'ExternalOAuthConnection';
$viewdefs[$module_name]['DetailView'] = [
'templateMeta' => [
'form' => [
'buttons' => [
'EDIT',
'DELETE',
]
],
'maxColumns' => '2',
'widths' => [
['label' => '10', 'field' => '30'],
['label' => '10', 'field' => '30']
],
'tabDefs' => [
'DEFAULT' => [
'newTab' => false,
'panelDefault' => 'expanded',
],
],
],
'panels' => [
'default' => [
[
'type',
''
],
[
'name',
'external_oauth_provider_name'
],
[
'token_type',
'expires_in'
],
[
[
'name' => 'date_entered',
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
'label' => 'LBL_DATE_ENTERED',
],
[
'name' => 'date_modified',
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
'label' => 'LBL_DATE_MODIFIED',
],
],
[
[
'name' => 'created_by_name',
'customCode' => '{$fields.created_by_name.value}',
'label' => 'LBL_OWNER',
],
''
]
],
]
];

View file

@ -0,0 +1,103 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$viewdefs['ExternalOAuthConnection'] = [
'EditView' => [
'templateMeta' => [
'form' => [
'hidden' => [
],
'buttons' => [
'SAVE',
'CANCEL',
[
'customCode' => '
<input title="{$MOD.LBL_AUTHENTICATE}"
type="button"
class="button"
id="connect-button"
onClick="doOAuthAuthentication()"
name="button" value="{$MOD.LBL_AUTHENTICATE}" />
',
]
]
],
'maxColumns' => '2',
'widths' => [
['label' => '10', 'field' => '30'],
['label' => '10', 'field' => '30']
],
'tabDefs' => [
'DEFAULT' => [
'newTab' => false,
'panelDefault' => 'expanded',
],
],
'javascript' => '
<script type="text/javascript">
{suite_combinescripts
files="modules/ExternalOAuthConnection/js/fields.js,
modules/ExternalOAuthConnection/js/authenticate.js
"}
</script>
'
],
'panels' => [
'default' => [
[
'type',
''
],
[
'name',
'external_oauth_provider_name'
],
[
'token_type',
'expires_in'
],
[
'access_token',
'refresh_token'
],
],
],
]
];

View file

@ -0,0 +1,64 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$module_name = 'ExternalOAuthConnection';
$listViewDefs[$module_name] = [
'NAME' => [
'default' => true,
'link' => true,
'label' => 'LBL_NAME',
],
'TYPE' => [
'default' => true,
'label' => 'LBL_TYPE',
],
'EXTERNAL_OAUTH_PROVIDER_NAME' => [
'default' => true,
'label' => 'LBL_EXTERNAL_OAUTH_PROVIDER_NAME',
],
'CREATED_BY_NAME' => [
'default' => true,
'label' => 'LBL_OWNER',
],
];

View file

@ -0,0 +1,49 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$module_name = 'ExternalOAuthConnection';
$metafiles[$module_name] = [
'detailviewdefs' => 'modules/' . $module_name . '/metadata/detailviewdefs.php',
'editviewdefs' => 'modules/' . $module_name . '/metadata/editviewdefs.php',
'listviewdefs' => 'modules/' . $module_name . '/metadata/listviewdefs.php',
'searchdefs' => 'modules/' . $module_name . '/metadata/searchdefs.php',
'popupdefs' => 'modules/' . $module_name . '/metadata/popupdefs.php',
'searchfields' => 'modules/' . $module_name . '/metadata/SearchFields.php',
];

View file

@ -0,0 +1,57 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$module_name = 'ExternalOAuthConnection';
$searchdefs[$module_name] = [
'templateMeta' => [
'maxColumns' => '3',
'maxColumnsBasic' => '4',
'widths' => ['label' => '10', 'field' => '30'],
],
'layout' => [
'basic_search' => [
'name',
],
'advanced_search' => [
'name',
'type',
],
],
];

View file

@ -0,0 +1,65 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$layout_defs['ExternalOAuthConnection'] = [
'subpanel_setup' => [
'securitygroups' => [
'top_buttons' => [
[
'widget_class' => 'SubPanelTopSelectButton',
'popup_module' => 'SecurityGroups',
'mode' => 'MultiSelect'
],
],
'order' => 900,
'sort_by' => 'name',
'sort_order' => 'asc',
'module' => 'SecurityGroups',
'refresh_page' => 1,
'subpanel_name' => 'default',
'get_subpanel_data' => 'SecurityGroups',
'add_subpanel_data' => 'securitygroup_id',
'title_key' => 'LBL_SECURITYGROUPS_SUBPANEL_TITLE',
],
],
];

View file

@ -0,0 +1,373 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\GenericProvider;
use League\OAuth2\Client\Token\AccessTokenInterface;
require_once __DIR__ . '/ExternalOAuthProviderConnectorInterface.php';
abstract class ExternalOAuthProviderConnector implements ExternalOAuthProviderConnectorInterface
{
/**
* @var string
*/
public $providerId;
/**
* @param string $providerId
*/
public function __construct(string $providerId)
{
$this->providerId = $providerId;
}
/**
* @inheritDoc
*/
public function getProviderID(): string
{
return $this->providerId;
}
/**
* Get Provider
* @param string $requestClientId
* @param string $requestClientSecret
* @return AbstractProvider|null
*/
public function getProvider(string $requestClientId, string $requestClientSecret): ?AbstractProvider
{
$config = $this->getProviderConfig();
if (empty($config)) {
return null;
}
$paramsToSet = [
'clientId' => $this->getClientID($requestClientId, $config),
'clientSecret' => $this->getClientSecret($requestClientSecret, $config),
'redirectUri' => $this->getRedirectUri($config),
];
$params = [];
foreach ($paramsToSet as $key => $value) {
if (!empty($value)) {
$params[$key] = $value;
}
}
$params = array_merge($params, $this->getExtraProviderParams($config));
return new GenericProvider($params);
}
/**
* @inheritDoc
*/
public function getAuthorizeURL(string $requestClientId, string $requestClientSecret): string
{
$provider = $this->getProvider($requestClientId, $requestClientSecret);
$config = $this->getProviderConfig();
if ($provider === null || empty($config)) {
return '';
}
$authUrl = $provider->getAuthorizationUrl($this->getAuthorizeURLOptions($config));
$_SESSION['oauth2state'] = $provider->getState();
return $authUrl;
}
/**
* @inheritDoc
* @throws IdentityProviderException
*/
public function getAccessToken(string $code): ?AccessTokenInterface
{
$config = $this->getProviderConfig();
$provider = $this->getProvider('', '');
if ($provider === null || empty($config)) {
return null;
}
$options = [
'code' => $code,
];
$options = array_merge_recursive($options, $this->getAccessTokenRequestOptions($config));
return $provider->getAccessToken(
$this->getAccessTokenRequestGrant($config),
$options
);
}
/**
* @inheritDoc
*/
public function refreshAccessToken(string $refreshToken): ?AccessTokenInterface
{
$config = $this->getProviderConfig();
$provider = $this->getProvider('', '');
if ($provider === null || empty($config)) {
return null;
}
$options = [
'refresh_token' => $refreshToken,
];
$options = array_merge_recursive($options, $this->getRefreshTokenRequestOptions($config));
return $provider->getAccessToken(
$this->getRefreshTokenRequestGrant($config),
$options
);
}
/**
* Get provider config
* @return array
*/
public function getProviderConfig(): array
{
$providerId = $this->getProviderID();
if (empty($providerId)) {
return [];
}
/** @var ExternalOAuthProvider $providerBean */
$providerBean = BeanFactory::getBean('ExternalOAuthProvider', $providerId);
if (empty($providerBean)) {
return [];
}
return $providerBean->getConfigArray();
}
/**
* Get applicable client id
* @param string $requestClientId
* @param array $providerConfig
* @return string
*/
public function getClientID(string $requestClientId, array $providerConfig): string
{
$clientId = $requestClientId ?? '';
if (!empty($_SESSION['external_oauth_client_id'])) {
$clientId = $_SESSION['external_oauth_client_id'];
} elseif (empty($clientId) && !empty($providerConfig['client_id'])) {
$clientId = $providerConfig['client_id'];
}
return $clientId;
}
/**
* Get applicable client secret
* @param string $requestClientSecret
* @param array $providerConfig
* @return string
*/
public function getClientSecret(string $requestClientSecret, array $providerConfig): string
{
$clientSecret = $requestClientSecret ?? '';
if (!empty($_SESSION['external_oauth_client_secret'])) {
$clientSecret = $_SESSION['external_oauth_client_secret'];
} elseif (empty($clientSecret) && !empty($providerConfig['client_secret'])) {
$clientSecret = $providerConfig['client_secret'];
}
return $clientSecret;
}
/**
* Get applicable redirect uri
* @param array $providerConfig
* @return string
*/
public function getRedirectUri(array $providerConfig): string
{
return $providerConfig['redirect_uri'] ?? '';
}
/**
* Get extra provider params
* @param array $providerConfig
* @return array
*/
public function getExtraProviderParams(array $providerConfig): array
{
return $providerConfig['extra_provider_params'] ?? [];
}
/**
* Get options for building the authorize url
* @param array $providerConfig
* @return array
*/
public function getAuthorizeURLOptions(array $providerConfig): array
{
return $providerConfig['authorize_url_options'] ?? [];
}
/**
* Get options for the get token call
* @param array $providerConfig
* @return array
*/
public function getAccessTokenRequestOptions(array $providerConfig): array
{
return $providerConfig['get_token_request_options'] ?? [];
}
/**
* Get grant for access token request
* @param array $providerConfig
* @return string
*/
public function getAccessTokenRequestGrant(array $providerConfig): string
{
return $providerConfig['get_token_request_grant'] ?? 'authorization_code';
}
/**
* Get options for the refresh token call
* @param array $providerConfig
* @return array
*/
public function getRefreshTokenRequestOptions(array $providerConfig): array
{
return $providerConfig['refresh_token_request_options'] ?? [];
}
/**
* Get grant for refresh token request
* @param array $providerConfig
* @return string
*/
public function getRefreshTokenRequestGrant(array $providerConfig): string
{
return $providerConfig['refresh_token_request_grant'] ?? 'refresh_token';
}
/**
* Get token mapping configuration
* @return array|mixed
*/
protected function getTokenMapping()
{
$config = $this->getProviderConfig();
$tokenMapping = [];
if (!empty($config)) {
$tokenMapping = $config['token_mapping'] ?? [];
}
return $tokenMapping;
}
/**
* Get value from nested array using the given path
* @param array $data
* @param string $path
* @return array|mixed|null
*/
public function getArrayValue(array $data, string $path)
{
if (empty($path)) {
return null;
}
$indexes = explode('.', $path);
if (empty($indexes)) {
return null;
}
$result = $data;
foreach ($indexes as $index) {
$result = $result[$index] ?? [];
}
return $result;
}
/**
* Map token according to token mapping configuration
* @param AccessTokenInterface $token
* @param $tokenMapping
* @return array
*/
protected function mapTokenDynamically(AccessTokenInterface $token, $tokenMapping): array
{
$tokenData = [
'access_token' => $token->getToken(),
'expires_in' => $token->getExpires(),
'refresh_token' => $token->getRefreshToken(),
'values' => $token->getValues(),
];
$mapped = [];
foreach ($tokenMapping as $tokenEntryKey => $tokenEntryValuePath) {
$mapped[$tokenEntryKey] = $this->getArrayValue($tokenData, $tokenEntryValuePath) ?? '';
}
return $mapped;
}
}

View file

@ -0,0 +1,145 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
use League\OAuth2\Client\Token\AccessTokenInterface;
interface ExternalOAuthProviderConnectorInterface
{
/**
* Get the provider id
* @return string
*/
public function getProviderID(): string;
/**
* Get the provider type
* @return string
*/
public function getProviderType(): string;
/**
* @param string $requestClientId
* @param string $requestClientSecret
* @return string
*/
public function getAuthorizeURL(string $requestClientId, string $requestClientSecret): string;
/**
* Get access token
* @param string $code
* @return AccessTokenInterface | null
*/
public function getAccessToken(string $code): ?AccessTokenInterface;
/**
* Refresh access token
* @param string $refreshToken
* @return AccessTokenInterface | null
*/
public function refreshAccessToken(string $refreshToken): ?AccessTokenInterface;
/**
* Map access token info to internal format
* @param AccessTokenInterface|null $token
* @return array
*/
public function mapAccessToken(?AccessTokenInterface $token): array;
/**
* Get provider config
* @return array
*/
public function getProviderConfig(): array;
/**
* Get applicable client id
* @param string $requestClientId
* @param array $providerConfig
* @return string
*/
public function getClientID(string $requestClientId, array $providerConfig): string;
/**
* Get applicable client secret
* @param string $requestClientSecret
* @param array $providerConfig
* @return string
*/
public function getClientSecret(string $requestClientSecret, array $providerConfig): string;
/**
* Get applicable redirect uri
* @param array $providerConfig
* @return string
*/
public function getRedirectUri(array $providerConfig): string;
/**
* Get extra provider params
* @param array $providerConfig
* @return array
*/
public function getExtraProviderParams(array $providerConfig): array;
/**
* Get options for building the authorize url
* @param array $providerConfig
* @return array
*/
public function getAuthorizeURLOptions(array $providerConfig): array;
/**
* Get options for the get token call
* @param array $providerConfig
* @return array
*/
public function getAccessTokenRequestOptions(array $providerConfig): array;
/**
* Get grant for access token request
* @param array $providerConfig
* @return string
*/
public function getAccessTokenRequestGrant(array $providerConfig): string;
}

View file

@ -0,0 +1,82 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
use League\OAuth2\Client\Token\AccessTokenInterface;
require_once __DIR__ . '/../ExternalOAuthProviderConnector.php';
class GenericOAuthProviderConnector extends ExternalOAuthProviderConnector
{
/**
* @inheritDoc
*/
public function getProviderType(): string
{
return 'Microsoft';
}
/**
* @inheritDoc
*/
public function mapAccessToken(?AccessTokenInterface $token): array
{
if ($token === null) {
return [];
}
$tokenMapping = $this->getTokenMapping();
if (!empty($tokenMapping)) {
return $this->mapTokenDynamically($token, $tokenMapping);
}
return [
'access_token' => $token->getToken(),
'expires_in' => $token->getExpires(),
'refresh_token' => $token->getRefreshToken()
];
}
}

View file

@ -0,0 +1,108 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
use League\OAuth2\Client\Token\AccessTokenInterface;
require_once __DIR__ . '/../ExternalOAuthProviderConnector.php';
class MicrosoftOAuthProviderConnector extends ExternalOAuthProviderConnector
{
/**
* @inheritDoc
*/
public function getProviderType(): string
{
return 'Microsoft';
}
/**
* @inheritDoc
*/
public function getExtraProviderParams(array $providerConfig): array
{
$defaults = [
'urlResourceOwnerDetails' => '',
];
$extraProviderParams = parent::getExtraProviderParams($providerConfig);
if (empty($extraProviderParams)) {
$extraProviderParams = [];
}
return array_merge($defaults, $extraProviderParams);
}
/**
* @inheritDoc
*/
public function mapAccessToken(?AccessTokenInterface $token): array
{
if ($token === null) {
return [];
}
$defaults = [
'access_token' => 'access_token',
'expires_in' => 'expires_in',
'refresh_token' => 'refresh_token',
'token_type' => 'values.token_type'
];
$tokenMapping = $this->getTokenMapping();
if (empty($tokenMapping) || !is_array($tokenMapping)) {
$tokenMapping = [];
}
foreach ($defaults as $key => $default) {
if (empty($tokenMapping[$key])){
$tokenMapping[$key] = $default;
}
}
return $this->mapTokenDynamically($token, $tokenMapping);
}
}

View file

@ -0,0 +1,378 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Token\AccessTokenInterface;
require_once __DIR__ . '/../provider/ExternalOAuthProviderConnectorInterface.php';
require_once __DIR__ . '/../provider/Generic/GenericOAuthProviderConnector.php';
require_once __DIR__ . '/../provider/Microsoft/MicrosoftOAuthProviderConnector.php';
class OAuthAuthorizationService
{
/**
* Check if provider exists
* @param string $providerId
* @return bool
*/
public function hasProvider(string $providerId): bool
{
$providerConfig = $this->getProviderConfig($providerId);
if (empty($providerConfig)) {
return false;
}
$provider = $this->getProvider($providerId);
return $provider !== null;
}
/**
* Get provider
* @param string $providerId
* @return ExternalOAuthProviderConnectorInterface|null
*/
public function getProvider(string $providerId): ?ExternalOAuthProviderConnectorInterface
{
$provider = null;
$providerConfig = $this->getProviderConfig($providerId);
if (empty($providerConfig) || empty($providerConfig['type'])) {
return null;
}
$providerType = $providerConfig['type'];
$external_oauth_providers_connectors = $this->getExternalOauthProvidersConnectors();
if (!empty($external_oauth_providers_connectors[$providerType]['class']) && class_exists($external_oauth_providers_connectors[$providerType]['class'])) {
$providerClass = $external_oauth_providers_connectors[$providerType]['class'];
$provider = new $providerClass($providerId);
}
return $provider;
}
/**
* Redirect to authorization endpoint
* @param string $providerId
* @param string $requestClientId
* @param string $requestClientSecret
* @return void
*/
public function authorizationRedirect(
string $providerId,
string $requestClientId,
string $requestClientSecret
): void {
$provider = $this->getProvider($providerId);
if ($provider === null) {
$this->log('fatal', 'OAuthAuthorizationService::authorizationRedirect::provider', 'provider not found');
return;
}
$authUrl = $provider->getAuthorizeURL($requestClientId, $requestClientSecret);
$this->log('debug', 'authorizationRedirect::authUrl', $authUrl);
header('Location: ' . $authUrl);
}
/**
* Get access token
* @param string $providerId
* @param string $code
* @return AccessTokenInterface|null
*/
public function getAccessToken(string $providerId, string $code): ?AccessTokenInterface
{
$provider = $this->getProvider($providerId);
if ($provider === null) {
$this->log('fatal', 'OAuthAuthorizationService::getAccessToken::provider', 'provider not found');
return null;
}
try {
$token = $provider->getAccessToken($code);
} catch (IdentityProviderException $e) {
$this->logResponse($e);
$this->cleanSession();
return null;
}
$this->cleanSession();
return $token;
}
/**
* Refresh the current token for connection
* @param ExternalOAuthConnection $connection
* @return void
*/
public function refreshConnectionToken(ExternalOAuthConnection $connection): array {
$providerId = $connection->external_oauth_provider_id ?? '';
if (!$this->hasProvider($providerId)) {
$this->log('fatal', 'OAuthAuthorizationService::refreshConnectionToken::provider', "The specified OAuth2 provider '$providerId' is not supported or not properly configured");
return [
'success' => false,
'reLogin' => false,
'message' => "The specified OAuth2 provider '$providerId' is not supported or not properly configured"
];
}
$provider = $this->getProvider($providerId);
if ($provider === null) {
$this->log('fatal', 'OAuthAuthorizationService::refreshConnectionToken::provider', 'provider not found');
return [
'success' => false,
'reLogin' => false,
'message' => "The specified OAuth2 provider '$providerId' was not found"
];
}
$refreshToken = $connection->refresh_token ?? '';
if ($refreshToken === '') {
$this->log('fatal', 'OAuthAuthorizationService::refreshConnectionToken::refreshToken', 'Refersh token not set');
return [
'success' => false,
'reLogin' => true,
'message' => "Refresh token not set. Need to re-login"
];
}
$token = $provider->refreshAccessToken($refreshToken);
if ($token === null) {
$this->log('fatal', 'OAuthAuthorizationService::refreshToken::token', 'Not able to get access token. Check logs for more details');
return [
'success' => false,
'reLogin' => true,
'message' => "Was not able to refresh the token. Your session may have expired. Please try to re-login."
];
}
$mappedToken = $this->mapToken($providerId, $token);
$connection->access_token = $mappedToken['access_token'];
$connection->expires_in = $mappedToken['expires_in'];
$connection->refresh_token = $mappedToken['refresh_token'];
$connection->token_type = $mappedToken['token_type'];
$connection->save();
$this->log('debug', 'OAuthAuthorizationService::refreshConnectionToken::token', 'successfully refreshed token');
// reset as the connection tokens have now been encripted
$connection->access_token = $mappedToken['access_token'];
$connection->expires_in = $mappedToken['expires_in'];
$connection->refresh_token = $mappedToken['refresh_token'];
$connection->token_type = $mappedToken['token_type'];
return [
'success' => true,
'reLogin' => false,
'message' => "successfully refreshed token"
];
}
/**
* Check if token for connection has expired
* @param ExternalOAuthConnection $connection
* @return void
*/
public function hasConnectionTokenExpired(ExternalOAuthConnection $connection): array {
$expireTimeStamp = $connection->expires_in ?? '';
if (empty($expireTimeStamp)) {
$this->log('fatal', 'OAuthAuthorizationService::hasConnectionTokenExpired', 'expires_in not set');
return [
'expired' => true,
'refreshToken' => false,
'message' => "Expiry date not set"
];
}
if (!empty($expireTimeStamp)) {
$expireTimeStamp = (int) $expireTimeStamp;
}
if(time() > $expireTimeStamp) {
$this->log('fatal', 'OAuthAuthorizationService::hasConnectionTokenExpired', 'Access token has expired');
return [
'expired' => true,
'refreshToken' => true,
'message' => "Token expired"
];
}
return [
'expired' => false,
'refreshToken' => false,
'message' => "Token valid"
];
}
/**
* Map token to bean fields array
* @param string $providerId
* @param AccessTokenInterface|null $token
* @return array|null
*/
public function mapToken(string $providerId, ?AccessTokenInterface $token): array
{
$provider = $this->getProvider($providerId);
if ($provider === null || $token === null) {
return [];
}
return $provider->mapAccessToken($token);
}
/**
* Get provider config
* @param string $providerId
* @return array|null
*/
public function getProviderConfig(string $providerId): ?array
{
if (empty($providerId)) {
return null;
}
/** @var ExternalOAuthProvider $providerBean */
$providerBean = BeanFactory::getBean('ExternalOAuthProvider', $providerId);
if (empty($providerBean)) {
return null;
}
return $providerBean->getConfigArray();
}
/**
* Log message
* @param string $level
* @param string $context
* @param string $message
* @return void
*/
public function log(string $level, string $context, string $message): void
{
global $log;
$log->$level($context . ' | ' . $message);
}
/**
* Log get access token response
* @param IdentityProviderException $e
* @return void
*/
protected function logResponse(IdentityProviderException $e): void
{
$this->log('fatal', 'OAuthAuthorizationService::getAccessToken', 'exception while trying to get access token');
$this->log('fatal', 'OAuthAuthorizationService::getAccessToken', 'exception message: ' . $e->getMessage());
$responseBody = $e->getResponseBody();
if (is_array($e->getResponseBody())) {
try {
$responseBody = json_encode($e->getResponseBody(), JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
$responseBody = print_r($e->getResponseBody(), true);
}
}
$this->log('fatal', 'OAuthAuthorizationService::getAccessToken', 'exception response body: ' . $responseBody);
$this->log('fatal', 'OAuthAuthorizationService::getAccessToken', 'exception trace: ' . $e->getTraceAsString());
}
/**
* Clean user session variables
* @return void
*/
public function cleanSession(): void
{
$_SESSION['external_oauth_client_id'] = '';
$_SESSION['external_oauth_client_secret'] = '';
$_SESSION['provider'] = '';
$_SESSION['oauth2state'] = '';
}
/**
* Get External OAuth Provider Connectors
* @return string[][]
*/
public function getExternalOauthProvidersConnectors(): array
{
$external_oauth_providers = [
'Microsoft' => [
'class' => 'MicrosoftOAuthProviderConnector'
],
'Generic' => [
'class' => 'GenericOAuthProviderConnector'
],
];
if (file_exists('custom/application/Ext/ExternalOAuthProviders/externaloauthproviders.ext.php')) {
include('custom/application/Ext/ExternalOAuthProviders/externaloauthproviders.ext.php');
}
return $external_oauth_providers;
}
}

View file

@ -0,0 +1,51 @@
{*
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
*}
<body>
<script>
{if !empty($token)}
{foreach from=$token key=k item=v}
window.opener.externalOAuthConnectionFields.setValue('{$k}', '{$v}');
{/foreach}
{/if}
window.close();
</script>
</body>

View file

@ -0,0 +1,253 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$dictionary['ExternalOAuthConnection'] = [
'table' => 'external_oauth_connections',
'comment' => 'External OAuth Connection',
'audited' => false,
'inline_edit' => false,
'massupdate' => false,
'exportable' => false,
'importable' => false,
'fields' => [
'id' => [
'name' => 'id',
'vname' => 'LBL_ID',
'type' => 'id',
'required' => true,
'comment' => 'Unique identifier',
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
],
'name' => array(
'name' => 'name',
'vname' => 'LBL_NAME',
'type' => 'name',
'link' => true,
'dbType' => 'varchar',
'len' => 255,
'required' => true,
'duplicate_merge' => 'disabled',
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
),
'type' => [
'name' => 'type',
'vname' => 'LBL_TYPE',
'type' => 'enum',
'options' => 'dom_external_oauth_connection_types',
'display' => 'readonly',
'inline_edit' => false,
'reportable' => false,
'massupdate' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
],
'client_id' => [
'name' => 'client_id',
'vname' => 'LBL_CLIENT_ID',
'type' => 'varchar',
'len' => 32,
'required' => false,
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
],
'client_secret' => [
'name' => 'client_secret',
'vname' => 'LBL_CLIENT_SECRET',
'type' => 'varchar',
'display' => 'writeonly',
'len' => 32,
'required' => false,
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
'sensitive' => true,
'api-visible' => false,
'db_encrypted' => true,
],
'token_type' => [
'name' => 'token_type',
'vname' => 'LBL_TOKEN_TYPE',
'type' => 'varchar',
'len' => 32,
'required' => false,
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
],
'expires_in' => [
'name' => 'expires_in',
'vname' => 'LBL_EXPIRES_IN',
'type' => 'varchar',
'display' => 'writeonly',
'len' => 32,
'required' => false,
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
],
'access_token' => [
'name' => 'access_token',
'vname' => 'LBL_ACCESS_TOKEN',
'type' => 'text',
'display' => 'writeonly',
'required' => false,
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
'sensitive' => true,
'api-visible' => false,
'db_encrypted' => true,
],
'refresh_token' => [
'name' => 'refresh_token',
'vname' => 'LBL_REFRESH_TOKEN',
'type' => 'text',
'display' => 'writeonly',
'required' => false,
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
'sensitive' => true,
'api-visible' => false,
'db_encrypted' => true,
],
'external_oauth_provider' => [
'name' => 'external_oauth_provider',
'type' => 'link',
'relationship' => 'external_oauth_connections_external_oauth_providers',
'link_type' => 'one',
'source' => 'non-db',
'vname' => 'LBL_EXTERNAL_OAUTH_PROVIDER',
'duplicate_merge' => 'disabled',
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
],
'external_oauth_provider_id' => [
'name' => 'external_oauth_provider_id',
'rname' => 'id',
'id_name' => 'external_oauth_provider_id',
'vname' => 'LBL_EXTERNAL_OAUTH_PROVIDER_ID',
'type' => 'relate',
'table' => 'external_oauth_providers',
'isnull' => 'true',
'module' => 'ExternalOAuthProvider',
'dbType' => 'id',
'duplicate_merge' => 'disabled',
'hideacl' => true,
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
],
'external_oauth_provider_name' => [
'name' => 'external_oauth_provider_name',
'rname' => 'name',
'id_name' => 'external_oauth_provider_id',
'vname' => 'LBL_EXTERNAL_OAUTH_PROVIDER_NAME',
'join_name' => 'external_oauth_providers',
'type' => 'relate',
'link' => 'external_oauth_provider',
'table' => 'external_oauth_providers',
'isnull' => 'true',
'module' => 'ExternalOAuthProvider',
'dbType' => 'varchar',
'len' => '255',
'source' => 'non-db',
'reportable' => false,
'massupdate' => false,
'inline_edit' => false,
'importable' => false,
'exportable' => false,
'unified_search' => false,
],
],
'relationships' => [
'external_oauth_connections_external_oauth_providers' => [
'lhs_module' => 'ExternalOAuthProvider',
'lhs_table' => 'external_oauth_providers',
'lhs_key' => 'id',
'rhs_module' => 'ExternalOAuthConnection',
'rhs_table' => 'external_oauth_connections',
'rhs_key' => 'external_oauth_provider_id',
'relationship_type' => 'one-to-many'
],
]
];
VardefManager::createVardef('ExternalOAuthConnection', 'ExternalOAuthConnection', ['basic', 'security_groups']);

View file

@ -1,14 +1,11 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
@ -41,9 +38,20 @@ if (!defined('sugarEntry') || !sugarEntry) {
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
global $mod_strings;
echo getClassicModuleTitle('InboundEmail', array($mod_strings['LBL_MODULE_TITLE']), true);
class ExternalOAuthConnectionViewList extends ViewList
{
//echo getClassicModuleTitle($mod_strings['LBL_MODULE_TITLE'], array($mod_strings['LBL_MODULE_TITLE'],$mod_strings['LBL_HOME']), true);
require_once('modules/InboundEmail/ListView.php');
/**
* @inheritdoc
*/
public function listViewPrepare()
{
parent::listViewPrepare();
$this->params['export'] = false;
$this->lv->displayEmptyDataMessages = false;
}
}

View file

@ -0,0 +1,508 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
* OAuth provider
*/
class ExternalOAuthProvider extends Basic
{
public $module_dir = 'ExternalOAuthProvider';
public $object_name = 'ExternalOAuthProvider';
public $table_name = 'external_oauth_providers';
public $disable_row_level_security = true;
public $id;
public $name;
public $type;
public $connector;
public $redirect_uri;
public $client_id;
public $client_secret;
public $scope;
public $url_authorize;
public $authorize_url_options;
public $url_access_token;
public $extra_provider_params;
public $get_token_request_grant;
public $get_token_request_options;
public $refresh_token_request_grant;
public $refresh_token_request_options;
public $access_token_mapping;
public $expires_in_mapping;
public $refresh_token_mapping;
public $token_type_mapping;
/**
* @inheritDoc
*/
public function retrieve($id = -1, $encode = true, $deleted = true)
{
$result = parent::retrieve($id, $encode, $deleted);
if (!empty($result) && !$this->checkPersonalAccountAccess()) {
$this->logPersonalAccountAccessDenied('retrieve');
return null;
}
return $result;
}
/**
* @inheritDoc
*/
public function save($check_notify = false)
{
if (!$this->checkPersonalAccountAccess()) {
$this->logPersonalAccountAccessDenied('save');
throw new RuntimeException('Access Denied');
}
$this->keepWriteOnlyFieldValues();
return parent::save($check_notify);
}
/**
* Check if user has access to personal account
* @return bool
*/
public function checkPersonalAccountAccess(): bool
{
global $current_user;
if (is_admin($current_user)) {
return true;
}
if (empty($this->type)) {
return true;
}
if ($this->type !== 'personal') {
return true;
}
if (empty($this->created_by)) {
return true;
}
if ($this->created_by === $current_user->id) {
return true;
}
return false;
}
/**
* Log personal account access denied
* @param string $action
* @return void
*/
public function logPersonalAccountAccessDenied(string $action): void
{
global $log, $current_user;
$log->fatal("ExternalOAuthProvider | Access denied. Non-admin user trying to access personal account. Action: '" . $action . "' | Current user id: '" . $current_user->id . "' | record: '" . $this->id . "'");
}
/**
* @inheritDoc
*/
public function bean_implements($interface)
{
if ($interface === 'ACL') {
return true;
}
return false;
}
/**
* @inheritDoc
*/
public function ACLAccess($view, $is_owner = 'not_set', $in_group = 'not_set')
{
global $current_user;
$isNotAllowAction = $this->isNotAllowedAction($view);
if ($isNotAllowAction === true) {
return false;
}
if (!$this->checkPersonalAccountAccess()) {
$this->logPersonalAccountAccessDenied("ACLAccess-$view");
return false;
}
$isPersonal = $this->type === 'personal';
$isAdmin = is_admin($current_user);
if ($isPersonal === true && $this->checkPersonalAccountAccess()) {
return true;
}
$isAdminOnlyAction = $this->isAdminOnlyAction($view);
if (!$isPersonal && !$isAdmin && $isAdminOnlyAction === true) {
return false;
}
return parent::ACLAccess($view, $is_owner, $in_group);
}
/**
* @inheritDoc
*/
public function create_new_list_query(
$order_by,
$where,
$filter = array(),
$params = array(),
$show_deleted = 0,
$join_type = '',
$return_array = false,
$parentbean = null,
$singleSelect = false,
$ifListForExport = false
) {
global $current_user, $db;
$ret_array = parent::create_new_list_query(
$order_by,
$where,
$filter,
$params,
$show_deleted,
$join_type,
true,
$parentbean,
$singleSelect,
$ifListForExport
);
if(is_admin($current_user)) {
if ($return_array) {
return $ret_array;
}
return $ret_array['select'] . $ret_array['from'] . $ret_array['where'] . $ret_array['order_by'];
}
if (is_array($ret_array) && !empty($ret_array['where'])) {
$tableName = $db->quote($this->table_name);
$currentUserId = $db->quote($current_user->id);
$showGroupRecords = "($tableName.type IS NULL) OR ($tableName.type != 'personal' ) OR ";
$ret_array['where'] = $ret_array['where'] . " AND ( $showGroupRecords ($tableName.type = 'personal' AND $tableName.created_by = '$currentUserId') )";
}
if ($return_array) {
return $ret_array;
}
return $ret_array['select'] . $ret_array['from'] . $ret_array['where'] . $ret_array['order_by'];
}
/**
* Do not clear write only fields
* @return void
*/
protected function keepWriteOnlyFieldValues(): void
{
if (empty($this->fetched_row)) {
return;
}
foreach ($this->field_defs as $field => $field_def) {
if (empty($field_def['display']) || $field_def['display'] !== 'writeonly') {
continue;
}
if (empty($this->fetched_row[$field])) {
continue;
}
if (!empty($this->$field)) {
continue;
}
$this->$field = $this->fetched_row[$field];
}
}
/**
* Check if its admin only action
* @param string $view
* @return bool
*/
protected function isAdminOnlyAction(string $view): bool
{
$adminOnlyAction = ['edit', 'delete', 'editview', 'save'];
return in_array(strtolower($view), $adminOnlyAction);
}
/**
* Check if its a security based action
* @param string $view
* @return bool
*/
protected function isSecurityGroupBasedAction(string $view): bool
{
$securityBasedActions = ['detail', 'detailview', 'view'];
return in_array(strtolower($view), $securityBasedActions);
}
/**
* Get not allowed action
* @param string $view
* @return bool
*/
protected function isNotAllowedAction(string $view): bool
{
$notAllowed = ['export', 'import', 'massupdate', 'duplicate'];
return in_array(strtolower($view), $notAllowed);
}
/**
* Build redirect uri based on site_url
* @return string
*/
public function getRedirectURI()
{
global $sugar_config;
$siteUrl = $sugar_config['site_url'] ?? '';
$siteUrl = str_ireplace('index.php', '', $siteUrl);
$siteUrl = rtrim($siteUrl, " \t\n\r\0\x0B\/");
return $siteUrl . '/index.php?entryPoint=setExternalOAuthToken';
}
/**
* Get provider configuration array
* @return array
*/
public function getConfigArray(): array
{
return [
'type' => $this->connector ?? '',
'client_id' => $this->client_id ?? '',
'client_secret' => $this->client_secret ?? '',
'redirect_uri' => $this->getRedirectURI() ?? '',
'authorize_url_options' => array_merge(
[
'scope' => $this->getScope(),
],
$this->getAuthorizeUrlOptions()
),
'extra_provider_params' => array_merge(
[
'scopes' => $this->getScope(),
'urlAuthorize' => $this->url_authorize ?? '',
'urlAccessToken' => $this->url_access_token ?? '',
],
$this->getExtraProviderParams()
),
'get_token_request_grant' => $this->getTokenRequestGrant(), // optional
'get_token_request_options' => $this->getTokenRequestOptions(), // optional
'refresh_token_request_grant' => $this->getRefreshTokenRequestGrant(), // optional
'refresh_token_request_options' => $this->getRefreshTokenRequestOptions(), // optional
'token_mapping' => [ // optional
'access_token' => $this->getAccessTokenMapping(),
'expires_in' => $this->getExpiresInMapping(),
'refresh_token' => $this->getRefreshTokenMapping(),
'token_type' => $this->getTokenTypeMapping()
]
];
}
/**
* @param $field
* @return array
*/
protected function deserializeMapField(string $field): array
{
if (empty($this->$field)) {
return [];
}
try {
$params = json_decode(html_entity_decode($this->$field), true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
return [];
}
return $params ?? [];
}
/**
* Get token request options
* @return string
*/
public function getScope(): string
{
$scopes = $this->deserializeMapField('scope');
if (empty($scopes)) {
return '';
}
return implode(' ', $scopes);
}
/**
* Get Decoded Extra provider Params
* @return array|mixed
*/
public function getExtraProviderParams(): array
{
return $this->deserializeMapField('extra_provider_params');
}
/**
* Get token request options
* @return array|mixed
*/
public function getTokenRequestOptions(): array
{
return $this->deserializeMapField('get_token_request_options');
}
/**
* Get token refresh request options
* @return array|mixed
*/
public function getRefreshTokenRequestOptions(): array
{
return $this->deserializeMapField('refresh_token_request_options');
}
/**
* Get authorize url options
* @return array|mixed
*/
public function getAuthorizeUrlOptions(): array
{
return $this->deserializeMapField('authorize_url_options');
}
/**
* @return string
*/
public function getRefreshTokenRequestGrant(): string
{
if (empty($this->refresh_token_request_grant)){
return 'refresh_token';
}
return $this->refresh_token_request_grant;
}
/**
* @return string
*/
public function getTokenRequestGrant(): string
{
if (empty($this->get_token_request_grant)){
return 'authorization_code';
}
return $this->get_token_request_grant;
}
/**
* @return string
*/
public function getAccessTokenMapping(): string
{
if (empty($this->access_token_mapping)){
return 'access_token';
}
return $this->access_token_mapping;
}
/**
* @return string
*/
public function getRefreshTokenMapping(): string
{
if (empty($this->refresh_token_mapping)){
return 'refresh_token';
}
return $this->refresh_token_mapping;
}
/**
* @return string
*/
public function getExpiresInMapping(): string
{
if (empty($this->expires_in_mapping)){
return 'expires_in';
}
return $this->expires_in_mapping;
}
/**
* @return string
*/
public function getTokenTypeMapping(): string
{
if (empty($this->token_type_mapping)){
return '';
}
return $this->token_type_mapping;
}
}

View file

@ -0,0 +1,54 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
global $mod_strings;
$module_menu = array();
$module_menu[]= array("index.php?module=ExternalOAuthProvider&action=EditView&type=personal", $mod_strings['LNK_LIST_CREATE_NEW_PERSONAL'],"Create");
if (is_admin($GLOBALS['current_user'])) {
$module_menu[]= array("index.php?module=ExternalOAuthProvider&action=EditView&type=group", $mod_strings['LNK_LIST_CREATE_NEW_GROUP'],"Create");
}
$module_menu[]= array("index.php?module=InboundEmail&action=index", $mod_strings['LNK_LIST_INBOUND_EMAILS'],"List");
$module_menu[]= array("index.php?module=OutboundEmailAccounts&action=index", $mod_strings['LNK_LIST_OUTBOUND_EMAILS'],"List");
$module_menu[]= array("index.php?module=ExternalOAuthConnection&action=index", $mod_strings['LNK_LIST_EXTERNAL_OAUTH_CONNECTION'],"List");
$module_menu[]= array("index.php?module=ExternalOAuthProvider&action=index", $mod_strings['LNK_LIST'],"List");

View file

@ -0,0 +1,61 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
class ExternalOAuthProviderController extends SugarController
{
public function action_EditView() {
$this->view = 'edit';
if (!empty($this->bean) && !empty($_REQUEST['type'])) {
$this->bean->type = $_REQUEST['type'];
}
if (empty($_REQUEST['record']) && !empty($_REQUEST['type']) && $_REQUEST['type'] === 'personal') {
$this->hasAccess = true;
return;
}
if (!empty($this->bean) && $this->bean->type === 'personal' && $this->bean->checkPersonalAccountAccess()) {
$this->hasAccess = true;
}
}
}

View file

@ -0,0 +1,109 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2022 SalesAgility Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = [
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',
'LBL_ID' => 'ID',
'LBL_DATE_ENTERED' => 'Date Created',
'LBL_DATE_MODIFIED' => 'Date Modified',
'LBL_MODIFIED' => 'Modified By',
'LBL_MODIFIED_NAME' => 'Modified By Name',
'LBL_CREATED' => 'Created By',
'LBL_DESCRIPTION' => 'Description',
'LBL_DELETED' => 'Deleted',
'LBL_NAME' => 'Name',
'LBL_CREATED_USER' => 'Created by User',
'LBL_MODIFIED_USER' => 'Modified by User',
'LBL_LIST_NAME' => 'Name',
'LBL_EDIT_BUTTON' => 'Edit',
'LBL_REMOVE' => 'Remove',
'LBL_LIST_FORM_TITLE' => 'External OAuth Provider List',
'LBL_MODULE_NAME' => 'External OAuth Providers',
'LBL_MODULE_TITLE' => 'External OAuth Providers',
'LBL_HOMEPAGE_TITLE' => 'My External OAuth Providers',
'LNK_NEW_RECORD' => 'Create External OAuth Provider',
'LNK_LIST' => 'External OAuth Providers',
'LBL_SEARCH_FORM_TITLE' => 'Search External OAuth Providers',
'LBL_HISTORY_SUBPANEL_TITLE' => 'View History',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
'LBL_NEW_FORM_TITLE' => 'New External OAuth Provider',
'LBL_LIST_DELETE' => 'Delete',
'LBL_TYPE' => 'Type',
'LBL_CONNECTOR' => 'Connector',
'LBL_REDIRECT_URI' => 'Redirect URI',
'LBL_CLIENT_ID' => 'Client Id',
'LBL_CLIENT_SECRET' => 'Client Secret',
'LBL_SCOPE' => 'Scope',
'LBL_URL_AUTHORIZE' => 'Authorize Url',
'LBL_AUTHORIZE_URL_OPTIONS' => 'Authorize Url Options',
'LBL_URL_ACCESS_TOKEN' => 'Access Token Url',
'LBL_EXTRA_PROVIDER_PARAMS' => 'Extra Provider Params',
'LBL_GET_TOKEN_REQUEST_GRANT' => 'Get Token Request grant type',
'LBL_GET_TOKEN_REQUEST_OPTIONS' => 'Get Token Request options',
'LBL_REFRESH_TOKEN_REQUEST_GRANT' => 'Refresh Token Request Grant Type',
'LBL_REFRESH_TOKEN_REQUEST_OPTIONS' => 'Refresh Token Request Options',
'LBL_ACCESS_TOKEN_MAPPING' => 'Access Token Mapping',
'LBL_EXPIRES_IN_MAPPING' => 'Expires In Mapping',
'LBL_REFRESH_TOKEN_MAPPING' => 'Refresh Token Mapping',
'LBL_TOKEN_TYPE_MAPPING' => 'Token Type Mapping',
'LBL_EXTRA' => 'Extra configurations',
'LBL_MAPPING' => 'Mapping configurations',
'LBL_OTHER' => 'Other',
'LNK_LIST_CREATE_NEW_PERSONAL' => 'New Personal OAuth Provider',
'LNK_LIST_CREATE_NEW_GROUP' => 'New Group OAuth Provider',
'LNK_LIST_INBOUND_EMAILS' => 'Inbound Email Accounts',
'LNK_LIST_OUTBOUND_EMAILS' => 'Outbound Email Accounts',
'LNK_LIST_EXTERNAL_OAUTH_CONNECTION' => 'External OAuth Connections',
'LBL_OWNER' => 'Owner',
];

Some files were not shown because too many files have changed in this diff Show more