Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue in Emails::createEmailRecord
#3
Hello Joe:

This isn´t all the code. The code are in a funciones.php file, that contains two require_once: This:

require_once 'modules/Emails/Emails.php';
require_once 'modules/Emails/mail.php';

In modules/Emails/Emails.php exists the function:

public static function createEmailRecord($element, $attachmentids = array()) {
global $adb, $log;
$user = Users::getActiveAdminUser();
$elementType = 'Emails';
$webserviceObject = VtigerWebserviceObject::fromName($adb, $elementType);
$handlerPath = $webserviceObject->getHandlerPath();
$handlerClass = $webserviceObject->getHandlerClass();
require_once $handlerPath;
$handler = new $handlerClass($webserviceObject, $user, $adb, $log);
$date = new DateTimeField(null);
if (empty($element['date_start'])) {
$element['date_start'] = $date->getDisplayDate($user);
}
if (empty($element['time_start'])) {
$element['time_start'] = date('H:iConfused');
}
$element['activitytype'] = 'Emails';
if (empty($element['assigned_user_id'])) {
$element['assigned_user_id'] = vtws_getEntityId('Users').'x'.$user->id;
}
if (empty($element['email_flag'])) {
$element['email_flag'] = 'SENT';
}
$result = $handler->create($elementType, $element);
if (!empty($result['id']) && !empty($attachmentids)) {
list($void, $id) = explode('x', $result['id']);
$aids = explode(',', trim($attachmentids, ','));
$query = 'SELECT vtiger_attachments.path, vtiger_attachments.name, vtiger_attachments.attachmentsid
FROM vtiger_attachments
INNER JOIN vtiger_seattachmentsrel ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid
INNER JOIN vtiger_crmentity ON vtiger_attachments.attachmentsid=vtiger_crmentity.crmid
WHERE deleted=0 AND vtiger_seattachmentsrel.crmid = ?';
$insrel = 'INSERT INTO vtiger_seattachmentsrel(crmid, attachmentsid) VALUES(?,?)';
foreach ($aids as $docid) {
$docrs = $adb->pquery($query, array($docid));
if ($docrs && $adb->num_rows($docrs)==1) {
$adb->pquery($insrel, array($id, $adb->query_result($docrs, 0, 'attachmentsid')));
}
}
return $result['id'];
}
return '';
}
}

And if I comment the line, the email is sent , and dont appear the message.

Sorry! Attempt to access restricted file.
We are looking for this file path: user_privileges/user_privileges_1.php
We are looking here:
Real file path:
Root dir path: /homepages/35/d489224962/htdocs/corebosPruebas/crm/

Only appears when the system try to register it.

Thanks
Reply


Messages In This Thread
RE: Issue in Emails::createEmailRecord - gmarcog - 10-09-2020, 08:39 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)