Squashed 'public/legacy/' changes from b065977c61..5750e66a06

5750e66a06 SuiteCRM 7.12.6 Release
d80ca53e48 Update jquery UI to v1.13.1
cacf7aa247 Upgrade jstree to v3.3.12
2c95a4c083 Update Wysiwyg field to work with the new version of TinyMCE
9c487fa43c Update email/template views to work with new versions of TinyMCE
7bcbf2a737 Upgrade TinyMCE to version 5.10
63b89fbd4f Fix #9494 - Force displaying line breaks to textarea fields
63dc9adf21 Fix #9530 - Fatal error on rendering page after upload
59d0b42cf0 Fix Module Builder Acceptance Tests
29f18cf248 Fix AOR_Report unit tests
ccbb40ca4a Fix scrm-core#87 - Prevent disabling the default lang
4c83fe64a3 Fix #9437 - Use application setCookie across the app
b293490c65 Fix #9437 - Change cookie_path handling
4e8924e549 Fix #3157 - Add default option to enable session_gc
120e948307 Fix #9438 - Adding Action keyword to fieldname exception
e037232900 Fix #8599 - Auto-close message boxes in ModuleBuilder
277d40b61a Fix #9435 - Dropdown doesn't return empty selected value

git-subtree-dir: public/legacy
git-subtree-split: 5750e66a060310494cc12b074062ffd36658bc1e
This commit is contained in:
Clemente Raposo 2022-05-17 18:37:50 +01:00
parent 5fa70e2794
commit 804972c3f6
140 changed files with 1361 additions and 29649 deletions

View file

@ -125,7 +125,11 @@ function showConditionCurrentModuleFields(ln, value){
function showModuleField(ln, operator_value, type_value, field_value){
if (typeof operator_value === 'undefined') { operator_value = ''; }
if (typeof type_value === 'undefined') { type_value = ''; }
if (typeof field_value === 'undefined') { field_value = ''; }
var is_value_set = true;
if (typeof field_value === 'undefined') {
field_value = '';
is_value_set = false;
}
var rel_field = document.getElementById('aow_conditions_module_path'+ln).value;
var aow_field = document.getElementById('aow_conditions_field'+ln).value;
@ -169,7 +173,7 @@ function showModuleField(ln, operator_value, type_value, field_value){
YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=AOW_WorkFlow&action=getModuleOperatorField&view="+action_sugar_grp1+"&aow_module="+flow_module+"&aow_fieldname="+aow_field+"&aow_newfieldname="+aow_operator_name+"&aow_value="+operator_value+"&rel_field="+rel_field,callback);
YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=AOW_WorkFlow&action=getFieldTypeOptions&view="+action_sugar_grp1+"&aow_module="+flow_module+"&aow_fieldname="+aow_field+"&aow_newfieldname="+aow_field_type_name+"&aow_value="+type_value+"&rel_field="+rel_field,callback2);
YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=AOW_WorkFlow&action=getModuleFieldType&view="+action_sugar_grp1+"&aow_module="+flow_module+"&aow_fieldname="+aow_field+"&aow_newfieldname="+aow_field_name+"&aow_value="+field_value+"&aow_type="+type_value+"&rel_field="+rel_field,callback3);
YAHOO.util.Connect.asyncRequest ("GET", "index.php?module=AOW_WorkFlow&action=getModuleFieldType&view="+action_sugar_grp1+"&aow_module="+flow_module+"&aow_fieldname="+aow_field+"&aow_newfieldname="+aow_field_name+"&aow_value="+field_value+"&is_value_set="+is_value_set+"&aow_type="+type_value+"&rel_field="+rel_field,callback3);
} else {
document.getElementById('aow_conditions_operatorInput'+ln).innerHTML = ''
@ -366,4 +370,4 @@ function date_field_change(field){
showElem(field + '[2]');
showElem(field + '[3]');
}
}
}

View file

@ -523,8 +523,7 @@ function getModuleField(
// fill in enums
if (isset($fieldlist[$name]['options']) && is_string($fieldlist[$name]['options']) && isset($app_list_strings[$fieldlist[$name]['options']])) {
$fieldlist[$name]['options'] = $app_list_strings[$fieldlist[$name]['options']];
}
// Bug 32626: fall back on checking the mod_strings if not in the app_list_strings
} // Bug 32626: fall back on checking the mod_strings if not in the app_list_strings
elseif (isset($fieldlist[$name]['options']) && is_string($fieldlist[$name]['options']) && isset($mod_strings[$fieldlist[$name]['options']])) {
$fieldlist[$name]['options'] = $mod_strings[$fieldlist[$name]['options']];
}
@ -533,6 +532,12 @@ function getModuleField(
if (isset($fieldlist[$name]['options']) && is_array($fieldlist[$name]['options']) && !isset($fieldlist[$name]['options'][''])) {
$fieldlist[$name]['options'][''] = '';
}
if ($fieldlist[$name]['type'] == 'enum' || $fieldlist[$name]['type'] == 'multienum' || $fieldlist[$name]['type'] == 'dynamicenum') {
if ($params['value_set'] === true && $value === "") {
$fieldlist[$name]['default'] = $value;
}
}
}
// fill in function return values

View file

@ -328,6 +328,12 @@ class AOW_WorkFlowController extends SugarController
$value = '';
}
if ($_REQUEST['is_value_set'] === 'false'){
$params['value_set'] = false;
} else{
$params['value_set'] = true;
}
switch ($_REQUEST['aow_type']) {
case 'Field':
if (isset($_REQUEST['alt_module']) && $_REQUEST['alt_module'] != '') {
@ -354,7 +360,7 @@ class AOW_WorkFlowController extends SugarController
// no break
case 'Value':
default:
echo getModuleField($rel_module, $fieldname, $aow_field, $view, $value);
echo getModuleField($rel_module, $fieldname, $aow_field, $view, $value, '', '', $params);
break;
}
die;

View file

@ -361,7 +361,7 @@ class Account extends Company implements EmailInterface
{
$xtpl->assign("ACCOUNT_NAME", $account->name);
$xtpl->assign("ACCOUNT_TYPE", $account->account_type);
$xtpl->assign("ACCOUNT_DESCRIPTION", $account->description);
$xtpl->assign("ACCOUNT_DESCRIPTION", nl2br($account->description));
return $xtpl;
}

View file

@ -107,7 +107,7 @@
new YAHOO.util.LocalDataSource(enabled_modules, {
responseSchema: {
resultsList : "modules",
fields : [{key : "module"}, {key : "label"}]
fields : [{key : "module"}, {key : "label"}, {key : "disabled"}]
}
}),
{height: "300px"}
@ -153,4 +153,4 @@
}
})();
{/literal}
</script>
</script>

View file

@ -79,9 +79,13 @@ class ViewLanguages extends SugarView
global $app_list_strings;
global $app_strings;
global $sugar_config;
$disabled = array();
$disabled_list = array();
$enabled = [];
$systemLanguage = $sugar_config['default_language'];
if (isset($sugar_config['disabled_languages'])) {
if (!is_array($sugar_config['disabled_languages'])) {
$disabled_list = array_flip(explode(',', $sugar_config['disabled_languages']));
@ -93,7 +97,15 @@ class ViewLanguages extends SugarView
if (isset($disabled_list[$key])) {
$disabled[] = array("module" => $key, 'label' => $value);
} else {
$enabled[] = array("module" => $key, 'label' => $value);
$enabledLang = array("module" => $key, 'label' => $value);
if ($key === $systemLanguage) {
$enabledLang['disabled'] = true;
array_unshift($enabled, $enabledLang);
continue;
}
$enabled[] = $enabledLang;
}
}

View file

@ -364,7 +364,7 @@ class Bug extends SugarBean
$xtpl->assign("BUG_STATUS", $app_list_strings['bug_status_dom'][$bug->status]);
$xtpl->assign("BUG_RESOLUTION", $app_list_strings['bug_resolution_dom'][$bug->resolution]);
$xtpl->assign("BUG_RELEASE", $bug->release_name);
$xtpl->assign("BUG_DESCRIPTION", $bug->description);
$xtpl->assign("BUG_DESCRIPTION", nl2br($bug->description));
$xtpl->assign("BUG_WORK_LOG", $bug->work_log);
$xtpl->assign("BUG_BUG_NUMBER", $bug->bug_number);
return $xtpl;

View file

@ -587,7 +587,7 @@ class Call extends SugarBean
$xtpl->assign("CALL_HOURS", $call->duration_hours);
$xtpl->assign("CALL_MINUTES", $call->duration_minutes);
$xtpl->assign("CALL_STATUS", ((isset($call->status))?$app_list_strings['call_status_dom'][$call->status] : ""));
$xtpl->assign("CALL_DESCRIPTION", $call->description);
$xtpl->assign("CALL_DESCRIPTION", nl2br($call->description));
return $xtpl;
}

View file

@ -287,7 +287,7 @@ class Campaign extends SugarBean
$xtpl->assign("CAMPAIGN_AMOUNT", $camp->budget);
$xtpl->assign("CAMPAIGN_CLOSEDATE", $camp->end_date);
$xtpl->assign("CAMPAIGN_STATUS", $camp->status);
$xtpl->assign("CAMPAIGN_DESCRIPTION", $camp->content);
$xtpl->assign("CAMPAIGN_DESCRIPTION", nl2br($camp->content));
return $xtpl;
}

View file

@ -1420,7 +1420,7 @@ function determine_back(){
<!-- BEGIN: NoInbound2 -->
<tr>
<td valign="top" scope="row">
{$MOD.LBL_ATTACHMENTS}:
{$MOD.LBL_ATTACHMENTS}:
</td>
<td colspan="2" nowrap id="attachments_container">
{$ATTACHMENTS}
@ -1434,12 +1434,16 @@ function determine_back(){
<form id="upload_form" name="upload_form" method="POST" action="index.php?entryPoint=emailTemplateData&func=uploadAttachments" enctype="multipart/form-data"> <!-- action='AttachDocuments.php' -->
<input type="submit" style="display:none;">
<div id="upload_div">
<input type="file" id="my_file" name="file_1" size="40" />
<input type="button" name="add_doc" id="add_doc" onclick="selectDoc();" value='{$MOD.LBL_SUITE_DOCUMENT}' class="button" />
<label class="button">
<input type="file" id="my_file" name="file_1" size="40" style="display: none" />
{$MOD.LBL_UPLOAD_FILE}
</label>
<input type="hidden" id="documentName" name="uploaddoc" onchange="docUpload(); form_reset_doc();" size="1" />
<input type="hidden" id="documentId" name="seldoc" tabindex="0" />
<input type="hidden" id="docRevId" name="seldoc" tabindex="0" />
<input type="hidden" id="documentType" name="seldoc" tabindex="0" />
<input type="button" name="add_doc" id="add_doc" onclick="selectDoc();" value='{$MOD.LBL_SUITE_DOCUMENT}' class="button" />
<input type="hidden" name="attach_to_template_id" id="attach_to_template_id" value="{$TEMPLATE_ID}">
<input type="hidden" name="campaign_id" value="{$CAMPAIGN_ID}">

View file

@ -415,6 +415,7 @@ $mod_strings = array(
'LBL_ATTACHMENTS' => 'Attachments',
'ERR_MISSING_REQUIRED_FIELDS' => 'Missing required field',
'LBL_SUITE_DOCUMENT' => 'Document',
'LBL_UPLOAD_FILE' => 'Upload File',
'LBL_EMAIL_ATTACHMENT' => 'Email Attachment',
'LBL_PROCESS_BOUNCED_EMAILS' => 'Process Bounced Emails',
'LBL_PROCESS_CAMPAIGN_EMAILS' => 'Process Campaign Emails',

View file

@ -337,7 +337,7 @@ class aCase extends Basic
(isset($case->priority) ? $app_list_strings['case_priority_dom'][$case->priority] : '')
);
$xtpl->assign('CASE_STATUS', (isset($case->status) ? $app_list_strings['case_status_dom'][$case->status] : ''));
$xtpl->assign('CASE_DESCRIPTION', $case->description);
$xtpl->assign('CASE_DESCRIPTION', nl2br($case->description));
return $xtpl;
}

View file

@ -135,6 +135,11 @@ class Configurator
$logFileExt = $this->prependDot($logFileExt);
if (!$this->hasValidExtension('logger_file_ext', $logFileExt)) {
$_POST['logger_file_ext'] = 'log';
$logFileExt = $this->prependDot('log');
LoggerManager::getLogger()->security("Setting logger_file_ext to '.log'.");
}
$fullName = $logFileName . $logFileExt;
$_POST['logger_file_name'] = $logFileName;
@ -149,12 +154,6 @@ class Configurator
$valid = false;
}
if (!$this->hasValidExtension('logger_file_ext', $logFileExt)) {
$_POST['logger_file_ext'] = '';
LoggerManager::getLogger()->security("Setting logger_file_ext to ''.");
$valid = false;
}
if (!$valid) {
return;
}
@ -203,7 +202,7 @@ class Configurator
* @param string $value
* @return bool
*/
public function hasValidExtension($fieldName, $value)
public function hasValidExtension(string $fieldName, string $value): bool
{
if ($value === '.' || empty($value)) {
@ -212,7 +211,11 @@ class Configurator
return false;
}
$badExt = array_map('strtolower', $this->config['upload_badext']);
$defaults = get_sugar_config_defaults() ?? [];
$badExtDefaults = $defaults['upload_badext'] ?? [];
$badExtensions = array_merge($badExtDefaults, $this->config['upload_badext'] ?? []) ?? [];
$badExt = array_map('strtolower', $badExtensions);
$parts = explode('.', $value);

View file

@ -566,7 +566,7 @@ class Contact extends Person implements EmailInterface
global $locale;
$xtpl->assign("CONTACT_NAME", trim($locale->getLocaleFormattedName($contact->first_name, $contact->last_name)));
$xtpl->assign("CONTACT_DESCRIPTION", $contact->description);
$xtpl->assign("CONTACT_DESCRIPTION", nl2br($contact->description));
return $xtpl;
}

View file

@ -266,9 +266,12 @@ class Document extends File
$img_name = SugarThemeRegistry::current()->getImageURL(strtolower($row['file_ext']) . "_image_inline.gif");
$img_name_bare = strtolower($row['file_ext']) . "_image_inline";
if (in_array($row['file_ext'], $sugar_config['allowed_preview'])) {
$allowedPreview = $sugar_config['allowed_preview'] ?? [];
if (in_array($row['file_ext'], $allowedPreview, true)) {
$this->show_preview = true;
}
}
}

View file

@ -112,24 +112,22 @@
</td>
</tr>
<tr>
<td width="15%" scope="row">{APP.LBL_ASSIGNED_TO}&nbsp;</td>
<td>
<input class="sqsEnabled" tabindex="0" autocomplete="off" id='assigned_user_name' name='assigned_user_name' type="text" value="{ASSIGNED_USER_NAME}">
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{ASSIGNED_USER_ID}" />
<span class="id-ff multiple">
<button title="{APP.LBL_SELECT_BUTTON_TITLE}" type="button" tabindex='0' class="button firstChild" value='{APP.LBL_SELECT_BUTTON_LABEL}' name="btn_author" id="btn_author"
onclick='open_popup("Users", 600, 400, "", true, false, {encoded_assigned_users_popup_request_data});'>{assign_user_select}</button><button type="button" name="btn_clr" id="btn_clr" tabindex="0" title="{APP.LBL_CLEAR_BUTTON_TITLE}" class="button lastChild"
onclick="this.form.assigned_user_name.value = ''; this.form.assigned_user_id.value = '';" value="{APP.LBL_CLEAR_BUTTON_LABEL}" >{assign_user_clear}</button>
</span>
</td>
</tr>
<tr>
<td width="15%" scope="row">
{MOD.LBL_DESCRIPTION}
</td>
<td colspan="3" >
<textarea name='description' tabindex='0' cols="90" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" id="description">{DESCRIPTION}</textarea>
<td colspan="1" >
<textarea name='description' tabindex='0' cols="90" rows="4" style="overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" id="description">{DESCRIPTION}</textarea>
</td>
<td width="15%" scope="row">{APP.LBL_ASSIGNED_TO}&nbsp;</td>
<td>
<input class="sqsEnabled" tabindex="0" autocomplete="off" id='assigned_user_name' name='assigned_user_name' type="text" value="{ASSIGNED_USER_NAME}">
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{ASSIGNED_USER_ID}" />
<span class="id-ff multiple">
<button title="{APP.LBL_SELECT_BUTTON_TITLE}" type="button" tabindex='0' class="button firstChild" value='{APP.LBL_SELECT_BUTTON_LABEL}' name="btn_author" id="btn_author"
onclick='open_popup("Users", 600, 400, "", true, false, {encoded_assigned_users_popup_request_data});'>{assign_user_select}</button><button type="button" name="btn_clr" id="btn_clr" tabindex="0" title="{APP.LBL_CLEAR_BUTTON_TITLE}" class="button lastChild"
onclick="this.form.assigned_user_name.value = ''; this.form.assigned_user_id.value = '';" value="{APP.LBL_CLEAR_BUTTON_LABEL}" >{assign_user_clear}</button>
</span>
</td>
</tr>
<tr>
@ -153,10 +151,8 @@
</span>
<input type="text" size="30" tabindex="0" name="variable_text" />
<!-- BEGIN: variable_button -->
<div class="button-group">
<input id="insert_variable_to_body_btn" type='button' tabindex="0" onclick='{INSERT_VARIABLE_ONCLICK}' class='button' value='{MOD.LBL_INSERT}' style="display: none;">
<input id="insert_variable_to_subject_btn" type='button' tabindex="0" onclick='insert_variable(document.EditView.variable_text.value, "subjectfield", true)' class='button' value='{MOD.LBL_INSERT}'>
</div>
<input id="insert_variable_to_body_btn" type='button' tabindex="0" onclick='{INSERT_VARIABLE_ONCLICK}' class='button' value='{MOD.LBL_INSERT}' style="display: none;">
<input id="insert_variable_to_subject_btn" type='button' tabindex="0" onclick='insert_variable(document.EditView.variable_text.value, "subjectfield", true)' class='button' value='{MOD.LBL_INSERT}'>
<!-- END: variable_button -->
</td>
</tr>
@ -180,7 +176,7 @@
{MOD.LBL_SUBJECT}
</td>
<td colspan='4' >
<textarea onclick="onClickTemplateSubject(this);" onblur="remember_place(this);" name='subject' tabindex='0' cols="90" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" id="subjectfield">{SUBJECT}</textarea>
<input onclick="onClickTemplateSubject(this);" onblur="remember_place(this);" name='subject' tabindex='0' style="width: 80%; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" id="subjectfield" value="{SUBJECT}">
</td>
</tr>
<tr>
@ -210,20 +206,15 @@
<!-- BEGIN: textarea -->
<td colspan="4" >
{BODY_EDITOR}
<div id='body_text_div'>
<textarea id='body_text' tabindex='0' name='body_html' cols="100" rows="40" style="display: none;">{BODY_HTML}</textarea>
{BODY_EDITOR}
<textarea id='body_text' tabindex='0' name='body_html' cols="100" rows="25" style="display: none;">{BODY_HTML}</textarea>
</div>
<br>
<div id='toggle_textarea_option'>
<input id='toggle_textarea_elem' onclick="toggle_textarea_edit(this);" type="button" name="toggle_html" value="{MOD.LBL_EDIT_ALT_TEXT}"/>
</div>
<br>
<div id="text_div" style="display: none">
<textarea id='body_text_plain' tabindex='0' name='body' cols="100" rows="40" >{BODY}</textarea>
<textarea id='body_text_plain' tabindex='0' name='body' cols="100" rows="25" style="width:100%" >{BODY}</textarea>
</div>
</td>
<!-- END: textarea -->
@ -246,12 +237,15 @@
<!-- BEGIN: NoInbound3 -->
<form id="upload_form" name="upload_form" method="POST" action='AttachDocuments.php' enctype="multipart/form-data">
<div id="upload_div">
<input type="file" id="my_file" name="file_1" size="40" />
<input type="button" name="add_doc" id="add_doc" onclick="selectDoc();" value='{MOD.LBL_SUITE_DOCUMENT}' class="button" />
<label class="button">
<input type="file" id="my_file" name="file_1" size="40" style="display: none" />
{MOD.LBL_UPLOAD_FILE}
</label>
<input type="hidden" id="documentName" name="uploaddoc" onchange="docUpload(); form_reset_doc();" size="1" />
<input type="hidden" id="documentId" name="seldoc" tabindex="0" />
<input type="hidden" id="docRevId" name="seldoc" tabindex="0" />
<input type="hidden" id="documentType" name="seldoc" tabindex="0" />
<input type="button" name="add_doc" id="add_doc" onclick="selectDoc();" value='{MOD.LBL_SUITE_DOCUMENT}' class="button" />
</div>
<div id="attachments_div">
</div>

View file

@ -160,10 +160,9 @@ EOQ;
} else {
$focus->text_only = 0;
}
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$this->checkAccess($focus);
if (!isset($_REQUEST['published'])) {
$focus->published = 'off';
}
@ -410,4 +409,32 @@ EOQ;
return $focus;
}
}
/**
* @param SugarBean $focus
* @return void
*/
protected function checkAccess(SugarBean $focus): void
{
global $current_user;
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$type = !empty($focus->type) ? $focus->type : '';
if (!empty($focus->id)) {
$template = BeanFactory::getBean('EmailTemplates', $focus->id);
if (!empty($template) && !empty($template->type)) {
$type = $template->type;
}
}
if ($type === 'system' && !is_admin($current_user)) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
}
}

View file

@ -71,6 +71,7 @@ $mod_strings = array(
'LBL_SHOW_ALT_TEXT' => 'Show Plain Text',
'LBL_SUBJECT' => 'Subject:',
'LBL_SUITE_DOCUMENT' => 'Document',
'LBL_UPLOAD_FILE' => 'Upload File',
'LBL_TEXT_BODY' => 'Text Body',
'LBL_USERS' => 'Users',

View file

@ -1125,11 +1125,14 @@
if ($(self).find('#is_only_plain_text').length === 1) {
$(self).find('#is_only_plain_text').click(function () {
var tinemceToolbar = $(tinymce.EditorManager.activeEditor.getContainer()).find('.mce-toolbar');
let tinymceContainer = $(tinymce.EditorManager.activeEditor.getContainer());
let description = $(self).find('#description');
if ($('#is_only_plain_text').prop('checked')) {
tinemceToolbar.hide();
tinymceContainer.hide();
description.show();
} else {
tinemceToolbar.show();
description.hide();
tinymceContainer.show();
}
});
}
@ -1383,19 +1386,16 @@
$.fn.EmailsComposeView.defaults = {
"tinyMceOptions": {
skin_url: "themes/default/css",
skin: "",
plugins: "fullscreen textcolor",
menubar: false,
toolbar: ['fontselect | fontsizeselect | bold italic underline forecolor backcolor | styleselect'],
toolbar: ['fontselect | fontsizeselect | bold italic underline | forecolor backcolor | styleselect | outdent indent'],
formats: {
bold: {inline: 'b'},
italic: {inline: 'i'},
underline: {inline: 'u'}
},
convert_urls:true,
relative_urls:false,
remove_script_host:false,
convert_urls: true,
relative_urls: false,
remove_script_host: false,
}
};
}(jQuery));

View file

@ -206,6 +206,7 @@ function multiFiles( list_target){
var currCount =this.id++;
element.name = 'email_attachment' + currCount;
element.id = 'email_attachment' + currCount;
element.style.display = 'none';
// Add reference to this object
element.multi_selector = this;
@ -284,20 +285,20 @@ function multiFiles( list_target){
new_row_attach_file.disabled ='true';
var imgElement = document.createElement("img");
imgElement.setAttribute("src", "index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=Accounts.gif");
imgElement.setAttribute("src", "index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=Notes.svg");
imgElement.setAttribute("align","absmiddle");
imgElement.setAttribute("alt",lbl_email_attachments_file);
imgElement.setAttribute("border","0");
imgElement.setAttribute("height","16");
imgElement.setAttribute("width","16");
imgElement.setAttribute("height","24");
imgElement.setAttribute("width","24");
var new_row_button_embed = document.createElement("img");
new_row_button_embed.setAttribute("src", "index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=attachment.gif");
new_row_button_embed.setAttribute("src", "index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=attachment-indicator.svg");
new_row_button_embed.setAttribute("align","absmiddle");
new_row_button_embed.setAttribute("alt",lbl_email_attachments_embeded);
new_row_button_embed.setAttribute("border","0");
new_row_button_embed.setAttribute("height","16");
new_row_button_embed.setAttribute("width","16");
new_row_button_embed.setAttribute("height","24");
new_row_button_embed.setAttribute("width","24");
// References
new_row.element = element;
@ -358,23 +359,15 @@ function multiFiles( list_target){
if (SUGAR.util.validateFileExt(fileName, allowedTypes)) {
cid = 'cid:' + fileName;
embedImage = '<img src="' + imglocation + encodeURI(fileName) + '">';
insert_variable(embedImage);
insert_variable(embedImage, "email_template_editor");
this.parentNode.childNodes[2].checked = 'true';
this.parentNode.childNodes[4].checked = 'true';
} else {
alert(select_image);
}
};
// Set row value
/*
var oas = new ActiveXObject("Scripting.FileSystemObject");
var d = document.a.b.value;
var e = oas.getFile(d);
var f = e.size;
alert(f + " bytes");
alert(element);
*/
//new_row_file_name.value =element.value;
new_row_file_name_tab = element.value.split("\\");
//alert(new_row_file_name_tab);
@ -384,12 +377,12 @@ function multiFiles( list_target){
//new_row.innerHTML = element.value;
//add all the elements
//new_row.appendChild(new_row_attach_file);
new_row.appendChild(imgElement);
new_row.appendChild(new_row_button_embed);
new_row.appendChild(new_row_chk_box);
new_row.appendChild(imgElement);
new_row.appendChild( new_row_file_name);
// Add button
new_row.appendChild( new_row_button_remove);
new_row.appendChild(new_row_button_embed);
new_row.appendChild(new_row_chk_box);
// Add it to the list
this.list_target.appendChild( new_row );
//document.getElementById(list_target).appendChild(new_row);
@ -477,7 +470,7 @@ function docUpload() {
//eai.setAttribute('onclick', 'deleteFile('+uploadIndex+');');
eai.setAttribute('value', lbl_remove);
eai.onclick=function(){
var filename = this.parentNode.childNodes[4].value;
var filename = this.parentNode.childNodes[2].value;
if(filename){
$(tinyMCE.editors).each(function(i, tiny){
//var tiny = tinyMCE.getInstanceById('body_text');
@ -495,21 +488,21 @@ function docUpload() {
var new_row_button_embed = document.createElement("img");
new_row_button_embed.setAttribute("src", "index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=attachment.gif");
new_row_button_embed.setAttribute("src", "index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=attachment-indicator.svg");
new_row_button_embed.setAttribute("align","absmiddle");
new_row_button_embed.setAttribute("alt",lbl_email_attachments_embeded);
new_row_button_embed.setAttribute("border","0");
new_row_button_embed.setAttribute("height","16");
new_row_button_embed.setAttribute("width","16");
new_row_button_embed.setAttribute("height","24");
new_row_button_embed.setAttribute("width","24");
new_row_button_embed.onclick= function(){
//retrieve the documentid
this.parentNode.childNodes[2].checked='true';
var documentRevisionId = this.parentNode.childNodes[4].value;
var mime_type = this.parentNode.childNodes[5].value;
this.parentNode.childNodes[7].checked='true';
var documentRevisionId = this.parentNode.childNodes[2].value;
var mime_type = this.parentNode.childNodes[3].value;
if(mime_type == "image/gif" || mime_type == "image/bmp" || mime_type == "image/png" || mime_type == "image/x-png" || mime_type == "image/jpg" || mime_type == "image/jpeg")
{
embedImage='<img src="index.php?entryPoint=download&type=Documents&id='+documentRevisionId+'">';
insert_variable(embedImage);
insert_variable(embedImage, "email_template_editor");
}
else{
new_row_chk_box.checked =false;
@ -518,23 +511,24 @@ function docUpload() {
};
var SugarDoc = document.createElement("img");
SugarDoc.setAttribute("src", "index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=sugar_document.png");
SugarDoc.setAttribute("src", "index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=Documents.svg");
SugarDoc.setAttribute("align","absmiddle");
SugarDoc.setAttribute("alt",lbl_email_attachments_document);
SugarDoc.setAttribute("border","0");
SugarDoc.setAttribute("height","16");
SugarDoc.setAttribute("width","16");
SugarDoc.setAttribute("height","24");
SugarDoc.setAttribute("width","24");
//elm.appendChild(eah);
elm.appendChild(SugarDoc);
elm.appendChild(new_row_button_embed);
elm.appendChild(new_row_chk_box);
elm.appendChild(SugarDoc);
elm.appendChild(eah);
elm.appendChild(attId);
elm.appendChild(attType);
elm.appendChild(ea);
elm.appendChild(eai);
elm.appendChild(new_row_button_embed);
elm.appendChild(new_row_chk_box);
elm.style.display = 'block';
var rN= document.getElementById('attachments_div');

View file

@ -129,6 +129,8 @@ $dictionary['Email'] = array(
'vname' => 'description',
'source' => 'non-db',
'inline_edit' => false,
'rows' => 6,
'cols' => 80,
),
'date_sent_received' => array(

View file

@ -396,7 +396,7 @@ class Lead extends Person implements EmailInterface
$xtpl->assign("LEAD_NAME", $locale->getLocaleFormattedName($lead->first_name, $lead->last_name, $lead->salutation));
$xtpl->assign("LEAD_SOURCE", (isset($lead->lead_source) ? $app_list_strings['lead_source_dom'][$lead->lead_source] : ""));
$xtpl->assign("LEAD_STATUS", (isset($lead->status)? $app_list_strings['lead_status_dom'][$lead->status]:""));
$xtpl->assign("LEAD_DESCRIPTION", $lead->description);
$xtpl->assign("LEAD_DESCRIPTION", nl2br($lead->description));
return $xtpl;
}

View file

@ -685,7 +685,7 @@ class Meeting extends SugarBean
$xtpl->assign("MEETING_ENDDATE", $timedate->asUser($enddate, $notifyUser)." ".TimeDate::userTimezoneSuffix($enddate, $notifyUser));
$xtpl->assign("MEETING_HOURS", $meeting->duration_hours);
$xtpl->assign("MEETING_MINUTES", $meeting->duration_minutes);
$xtpl->assign("MEETING_DESCRIPTION", $meeting->description);
$xtpl->assign("MEETING_DESCRIPTION", nl2br($meeting->description));
$xtpl->assign("MEETING_LOCATION", $meeting->location);
if (!empty($meeting->join_url)) {
$xtpl->assign('MEETING_URL', $meeting->join_url);

View file

@ -660,6 +660,9 @@ if (typeof('console') == 'undefined') {
width: 500,
close: true
});
window.setTimeout(function() {
YAHOO.SUGAR.MessageBox.hide();
}, 1000);
ModuleBuilder.updateContent(o);
}
@ -733,6 +736,9 @@ if (typeof('console') == 'undefined') {
width: 500,
close: true
});
window.setTimeout(function() {
YAHOO.SUGAR.MessageBox.hide();
}, 1000);
successCall(o);
}
}
@ -1226,4 +1232,4 @@ if (typeof('console') == 'undefined') {
ModuleBuilder.selected = {};
ModuleBuilder.callLock = false;
}
})();
})();

View file

@ -133,7 +133,7 @@ class ViewModulefield extends SugarView
'DATE','VARCHAR','VARCHAR2','NVARCHAR2','CHAR','NCHAR','NUMBER','PLS_INTEGER','BINARY_INTEGER','LONG','TIMESTAMP',
'INTERVAL','RAW','ROWID','UROWID','MLSLABEL','CLOB','NCLOB','BLOB','BFILE','XMLTYPE',
//SugarCRM reserved
'ID', 'ID_C', 'PARENT_NAME', 'PARENT_ID',
'ID', 'ID_C', 'PARENT_NAME', 'PARENT_ID', 'ACTION',
);

View file

@ -405,7 +405,7 @@ class Opportunity extends SugarBean
$xtpl->assign("OPPORTUNITY_AMOUNT", $oppty->amount);
$xtpl->assign("OPPORTUNITY_CLOSEDATE", $oppty->date_closed);
$xtpl->assign("OPPORTUNITY_STAGE", (isset($oppty->sales_stage)?$app_list_strings['sales_stage_dom'][$oppty->sales_stage]:""));
$xtpl->assign("OPPORTUNITY_DESCRIPTION", $oppty->description);
$xtpl->assign("OPPORTUNITY_DESCRIPTION", nl2br($oppty->description));
return $xtpl;
}

View file

@ -26,13 +26,15 @@ class SecurityGroup extends SecurityGroup_sugar
*/
public static function getGroupWhere($table_name, $module, $user_id)
{
$db = DBManagerFactory::getInstance();
$quotedUserId = $db->quote($user_id);
//need a different query if doing a securitygroups check
if ($module == 'SecurityGroups') {
return " $table_name.id in (
select secg.id from securitygroups secg
inner join securitygroups_users secu on secg.id = secu.securitygroup_id and secu.deleted = 0
and secu.user_id = '$user_id'
and secu.user_id = '$quotedUserId'
where secg.deleted = 0
)";
} else {
@ -41,7 +43,7 @@ class SecurityGroup extends SecurityGroup_sugar
INNER JOIN securitygroups_users secu
ON secg.id = secu.securitygroup_id
AND secu.deleted = 0
AND secu.user_id = '$user_id'
AND secu.user_id = '$quotedUserId'
INNER JOIN securitygroups_records secr
ON secg.id = secr.securitygroup_id
AND secr.deleted = 0
@ -60,10 +62,13 @@ class SecurityGroup extends SecurityGroup_sugar
*/
public static function getGroupUsersWhere($user_id)
{
$db = DBManagerFactory::getInstance();
$quotedUserId = $db->quote($user_id);
return " users.id in (
select sec.user_id from securitygroups_users sec
inner join securitygroups_users secu on sec.securitygroup_id = secu.securitygroup_id and secu.deleted = 0
and secu.user_id = '$user_id'
and secu.user_id = '$quotedUserId'
where sec.deleted = 0
)";
}
@ -83,18 +88,20 @@ class SecurityGroup extends SecurityGroup_sugar
*/
public static function getGroupJoin($table_name, $module, $user_id)
{
$db = DBManagerFactory::getInstance();
$quotedUserId = $db->quote($user_id);
//need a different query if doing a securitygroups check
if ($module == 'SecurityGroups') {
return " LEFT JOIN (select distinct secg.id from securitygroups secg
inner join securitygroups_users secu on secg.id = secu.securitygroup_id and secu.deleted = 0
and secu.user_id = '" . $user_id . "'
and secu.user_id = '" . $quotedUserId . "'
where secg.deleted = 0
) securitygroup_join on securitygroup_join.id = " . $table_name . '.id ';
} else {
return " LEFT JOIN (select distinct secr.record_id as id from securitygroups secg
inner join securitygroups_users secu on secg.id = secu.securitygroup_id and secu.deleted = 0
and secu.user_id = '" . $user_id . "'
and secu.user_id = '" . $quotedUserId . "'
inner join securitygroups_records secr on secg.id = secr.securitygroup_id and secr.deleted = 0
and secr.module = '" . $module . "'
where secg.deleted = 0
@ -111,10 +118,13 @@ class SecurityGroup extends SecurityGroup_sugar
*/
public static function getGroupUsersJoin($user_id)
{
$db = DBManagerFactory::getInstance();
$quotedUserId = $db->quote($user_id);
return " LEFT JOIN (
select distinct sec.user_id as id from securitygroups_users sec
inner join securitygroups_users secu on sec.securitygroup_id = secu.securitygroup_id and secu.deleted = 0
and secu.user_id = '$user_id'
and secu.user_id = '$quotedUserId'
where sec.deleted = 0
) securitygroup_join on securitygroup_join.id = users.id ";
}
@ -134,13 +144,14 @@ class SecurityGroup extends SecurityGroup_sugar
global $current_user;
global $sugar_config;
$db = DBManagerFactory::getInstance();
$quotedId = $db->quote($id);
$query = 'select count(securitygroups.id) as results from securitygroups '
. 'inner join securitygroups_users on securitygroups.id = securitygroups_users.securitygroup_id'
. ' and securitygroups_users.deleted = 0 '
. " and securitygroups_users.user_id = '$current_user->id' "
. 'inner join securitygroups_records on securitygroups.id = securitygroups_records.securitygroup_id'
. ' and securitygroups_records.deleted = 0 '
. " and securitygroups_records.record_id = '$id' "
. " and securitygroups_records.record_id = '$quotedId' "
. " and securitygroups_records.module = '$module' ";
if (!empty($action)
&& isset($sugar_config['securitysuite_strict_rights'])
@ -269,12 +280,13 @@ class SecurityGroup extends SecurityGroup_sugar
} elseif ($focus->db->dbType == 'mssql') {
$query .= ' lower(newid()) ';
}
$currentUserId = isset($current_user->id) ? $current_user->id : null;
$query .= ",u.securitygroup_id,'$focus->id','$focus->module_dir',"
$currentUserId = isset($current_user->id) ? $focus->db->quote($current_user->id) : null;
$recordId = $focus->db->quote($focus->id);
$query .= ",u.securitygroup_id,'$recordId','$focus->module_dir',"
. $focus->db->convert('', 'today') . ',0 '
. 'from securitygroups_users u '
. 'inner join securitygroups g on u.securitygroup_id = g.id and g.deleted = 0 and (g.noninheritable is null or g.noninheritable <> 1) '
. "left join securitygroups_records d on d.securitygroup_id = u.securitygroup_id and d.record_id = '$focus->id' and d.module = '$focus->module_dir' and d.deleted = 0 "
. "left join securitygroups_records d on d.securitygroup_id = u.securitygroup_id and d.record_id = '$recordId' and d.module = '$focus->module_dir' and d.deleted = 0 "
. "where d.id is null and u.user_id = '$currentUserId' and u.deleted = 0 and (u.noninheritable is null or u.noninheritable <> 1)";
$GLOBALS['log']->debug("SecuritySuite: Inherit from Creator: $query");
$focus->db->query($query, true);
@ -290,7 +302,7 @@ class SecurityGroup extends SecurityGroup_sugar
global $sugar_config;
if (isset($sugar_config['securitysuite_inherit_assigned']) && $sugar_config['securitysuite_inherit_assigned'] == true) {
if (!empty($focus->assigned_user_id)) {
$assigned_user_id = $focus->assigned_user_id;
$assigned_user_id = $focus->db->quote($focus->assigned_user_id);
//inherit only for those that support Security Groups
$security_modules = self::getSecurityModules();
//if(in_array($focus->module_dir,$security_modules)) {
@ -302,11 +314,12 @@ class SecurityGroup extends SecurityGroup_sugar
} elseif ($focus->db->dbType == 'mssql') {
$query .= ' lower(newid()) ';
}
$query .= ",u.securitygroup_id,'$focus->id','$focus->module_dir',"
$recordId = $focus->db->quote($focus->id);
$query .= ",u.securitygroup_id,'$recordId','$focus->module_dir',"
. $focus->db->convert('', 'today') . ',0 '
. 'from securitygroups_users u '
. 'inner join securitygroups g on u.securitygroup_id = g.id and g.deleted = 0 and (g.noninheritable is null or g.noninheritable <> 1) '
. "left join securitygroups_records d on d.securitygroup_id = u.securitygroup_id and d.record_id = '$focus->id' and d.module = '$focus->module_dir' and d.deleted = 0 "
. "left join securitygroups_records d on d.securitygroup_id = u.securitygroup_id and d.record_id = '$recordId' and d.module = '$focus->module_dir' and d.deleted = 0 "
. "where d.id is null and u.user_id = '$assigned_user_id' and u.deleted = 0 and (u.noninheritable is null or u.noninheritable <> 1)";
$GLOBALS['log']->debug("SecuritySuite: Inherit from Assigned: $query");
$focus->db->query($query, true);
@ -477,14 +490,17 @@ class SecurityGroup extends SecurityGroup_sugar
$GLOBALS['log']->debug("SecuritySuite: Inherit One Pre-Check Qualifier: $query");
$result = $db->query($query);
$row = $db->fetchByAssoc($result);
$recordId = $db->quote($record_id);
$userId = $db->quote($user_id);
$moduleName = $db->quote($module);
if (isset($row) && $row['results'] == 1) {
$query = 'insert into securitygroups_records(id,securitygroup_id,record_id,module,date_modified,deleted) '
. "select distinct '" . create_guid() . "',u.securitygroup_id,'$record_id','$module',"
. "select distinct '" . create_guid() . "',u.securitygroup_id,'$recordId','$moduleName',"
. $db->convert('', 'today') . ',0 '
. 'from securitygroups_users u '
. 'inner join securitygroups g on u.securitygroup_id = g.id and g.deleted = 0 and (g.noninheritable is null or g.noninheritable <> 1) '
. "left join securitygroups_records d on d.securitygroup_id = u.securitygroup_id and d.record_id = '$record_id' and d.module = '$module' and d.deleted = 0 "
. "where d.id is null and u.user_id = '$user_id' and u.deleted = 0 and (u.noninheritable is null or u.noninheritable <> 1)";
. "left join securitygroups_records d on d.securitygroup_id = u.securitygroup_id and d.record_id = '$recordId' and d.module = '$moduleName' and d.deleted = 0 "
. "where d.id is null and u.user_id = '$userId' and u.deleted = 0 and (u.noninheritable is null or u.noninheritable <> 1)";
$GLOBALS['log']->debug("SecuritySuite: Inherit One: $query");
$db->query($query, true);
@ -565,7 +581,7 @@ class SecurityGroup extends SecurityGroup_sugar
$module,
ENT_QUOTES
) . "'," . $db->convert('', 'today') . ',0 )';
$GLOBALS['log']->debug("SecuritySuite: Save Default Group: $query");
$db->query($query);
}
@ -691,10 +707,11 @@ class SecurityGroup extends SecurityGroup_sugar
public static function getUserSecurityGroups($user_id)
{
$db = DBManagerFactory::getInstance();
$userId = $db->quote($user_id);
$query = 'select securitygroups.id, securitygroups.name from securitygroups_users '
. 'inner join securitygroups on securitygroups_users.securitygroup_id = securitygroups.id '
. ' and securitygroups.deleted = 0 '
. "where securitygroups_users.user_id='$user_id' and securitygroups_users.deleted = 0 "
. "where securitygroups_users.user_id='$userId' and securitygroups_users.deleted = 0 "
. 'order by securitygroups.name asc ';
$result = $db->query($query, true, 'Error finding the full membership list for a user: ');
@ -764,10 +781,11 @@ class SecurityGroup extends SecurityGroup_sugar
if ($db->dbType == 'mssql') {
$query .= ' top 1 ';
}
$userId = $db->quote($current_user->id);
$query .= "securitygroups.id from securitygroups_users
inner join securitygroups on securitygroups_users.securitygroup_id = securitygroups.id
and securitygroups.deleted = 0
where securitygroups_users.user_id='" . $current_user->id . "' and securitygroups_users.deleted = 0
where securitygroups_users.user_id='" . $userId . "' and securitygroups_users.deleted = 0
order by securitygroups_users.primary_group desc ";
if ($db->dbType == 'mysql') {
$query .= ' limit 0,1 ';

View file

@ -346,7 +346,7 @@ class Task extends SugarBean
}
$xtpl->assign("TASK_STATUS", (isset($task->status)?$app_list_strings['task_status_dom'][$task->status]:""));
$xtpl->assign("TASK_DESCRIPTION", $task->description);
$xtpl->assign("TASK_DESCRIPTION", nl2br($task->description));
return $xtpl;
}

View file

@ -389,7 +389,7 @@ class UserPreference extends SugarBean
unset($_SESSION[$user->user_name."_PREFERENCES"][$category]);
} else {
if (!empty($_COOKIE['sugar_user_theme']) && !headers_sent()) {
setcookie('sugar_user_theme', '', time() - 3600, null, null, isSSL(), true); // expire the sugar_user_theme cookie
SugarApplication::setCookie('sugar_user_theme', '', time() - 3600, null, null, isSSL(), true); // expire the sugar_user_theme cookie
}
unset($_SESSION[$user->user_name."_PREFERENCES"]);
if ($user->id == $GLOBALS['current_user']->id) {

View file

@ -69,12 +69,20 @@ if (getRecaptchaChallengeField() !== false) {
//// - send the filled form to authenticate.php after changing the password in the database
$redirect = true;
$errors = '';
if (isset($_REQUEST['guid'])) {
if (!empty($_REQUEST['guid']) && !empty($_REQUEST['key'])) {
// Change 'deleted = 0' clause to 'COALESCE(deleted, 0) = 0' because by default the values were NULL
$Q = "SELECT * FROM users_password_link WHERE id = '" . $db->quote($_REQUEST['guid']) . "' AND COALESCE(deleted, 0) = '0'";
$result = DBManagerFactory::getInstance()->limitQuery($Q, 0, 1, false);
$row = DBManagerFactory::getInstance()->fetchByAssoc($result);
if (!empty($row)) {
$keyHash = !empty($row['keyhash']) ? $row['keyhash'] : null;
$isValid = false;
if ($keyHash !== null) {
$isValid = User::checkPassword($_REQUEST['key'], $keyHash);
}
if (!empty($row) && $isValid === true) {
$pwd_settings = $GLOBALS['sugar_config']['passwordsetting'];
$expired = false;
@ -179,5 +187,9 @@ $sugar_smarty->assign('SUBMIT_BUTTON', '<input title="' . $mod_strings['LBL_LOGI
if (!empty($_REQUEST['guid'])) {
$sugar_smarty->assign("GUID", $_REQUEST['guid']);
}
if (!empty($_REQUEST['key'])) {
$sugar_smarty->assign("KEY", $_REQUEST['key']);
}
$sugar_smarty->display('modules/Users/Changenewpassword.tpl');
$view->displayFooter();

View file

@ -51,12 +51,12 @@ var ERR_REENTER_PASSWORDS = '{/literal}{$MOD.ERR_REENTER_PASSWORDS}{literal}';
<script type='text/javascript' src='{/literal}{sugar_getjspath file="modules/Users/PasswordRequirementBox.js"}{literal}'></script>
<style type="text/css">
<!--
.body
{
.body
{
font-size: 12px;
}
.buttonLogin
.buttonLogin
{
border: 1px solid #444444;
font-size: 11px;
@ -64,34 +64,34 @@ var ERR_REENTER_PASSWORDS = '{/literal}{$MOD.ERR_REENTER_PASSWORDS}{literal}';
background-color: #666666;
font-weight: bold;
}
table.tabForm td
table.tabForm td
{
border: none;
}
p
p
{
MARGIN-TOP: 0px;
MARGIN-BOTTOM: 10px;
}
form
form
{
margin: 0px;
}
#recaptcha_image
#recaptcha_image
{
height: 47.5px !important;
width: 250px !important;
}
#recaptcha_image img
#recaptcha_image img
{
height: 47.5px;
width: 250px;
}
}
-->
</style>
{/literal}
@ -119,6 +119,7 @@ form
<input type='hidden' name='action' value="{$ACTION}" />
<input type='hidden' name='module' value="{$MODULE}" />
<input type="hidden" name="guid" value="{$GUID}" />
<input type="hidden" name="key" value="{$KEY}" />
<input type="hidden" name="return_module" value="Home" />
<input type="hidden" name="login" value="1" />
<input type="hidden" name="is_admin" value="{$IS_ADMIN}" />
@ -164,7 +165,7 @@ form
<td>&nbsp;</td>
<td style="padding-top: 1em;" class='login-btn'>
{$SUBMIT_BUTTON}
</td>
</td>
</tr>
</table>
</td>
@ -173,4 +174,4 @@ form
</td>
</tr>
</table>
</form>
</form>

View file

@ -130,11 +130,14 @@ if (isset($_POST['Users0emailAddress0'])) {
if ($isLink) {
global $timedate;
$guid = create_guid();
$url = $GLOBALS['sugar_config']['site_url'] . "/index.php?entryPoint=Changenewpassword&guid=$guid";
$key = create_guid();
$hashedKey = User::getPasswordHash($key);
$url = $GLOBALS['sugar_config']['site_url'] . "/index.php?entryPoint=Changenewpassword&guid=$guid&key=$key";
$time_now = TimeDate::getInstance()->nowDb();
$userID = $usr->retrieve_user_id($username);
$q = "INSERT INTO users_password_link (id, username, date_generated, user_id) VALUES('" .
$q = "INSERT INTO users_password_link (id, keyhash, username, date_generated, user_id) VALUES('" .
$guid . "','" .
$hashedKey . "','" .
$username . "','" .
$time_now . "','" .
$userID . "') ";

View file

@ -58,7 +58,7 @@ foreach ($_SESSION as $key => $val) {
$_SESSION[$key] = ''; // cannot just overwrite session data, causes segfaults in some versions of PHP
}
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/', null, isSSL(), true);
SugarApplication::setCookie(session_name(), '', time()-42000, '/', null, isSSL(), true);
}
//Update the tracker_sessions table

View file

@ -191,7 +191,7 @@ class UsersViewDetail extends ViewDetail
global $current_user;
if ($this->bean->id == $current_user->id) {
$_COOKIE[$current_user->id . '_activePage'] = '0';
setcookie($current_user->id . '_activePage', '0', 3000, null, null, isSSL(), true);
SugarApplication::setCookie($current_user->id . '_activePage', '0', 3000, null, null, isSSL(), true);
}
}