} if ($_REQUEST["attach2"]) { check_ticket('webmail'); $a2 = $mail->getFile('temp/mail_attachs/' . $_REQUEST["attach2file"]); $mail->addAttachment($a2, $_REQUEST["attach2"], $_REQUEST["attach2type"]); @unlink('temp/mail_attachs/' . $_REQUEST["attach2file"]); } if ($_REQUEST["attach3"]) { check_ticket('webmail'); $a3 = $mail->getFile('temp/mail_attachs/' . $_REQUEST["attach3file"]); $mail->addAttachment($a3, $_REQUEST["attach3"], $_REQUEST["attach3type"]); @unlink('temp/mail_attachs/' . $_REQUEST["attach3file"]); } $mail->setSMTPParams($current["smtp"], $current["smtpPort"], '', $current["useAuth"], $current["username"], $current["pass"]); if (isset($_REQUEST["useHTML"]) && $_REQUEST["useHTML"] == 'on') { $mail->setHTML($_REQUEST["body"], strip_tags($_REQUEST["body"])); } else { $mail->setText($_REQUEST["body"]); } $to_array_1 = split('[, ;]', $_REQUEST["to"]); $to_array = array(); foreach ($to_array_1 as $to_1) { if (!empty($to_1)) { $to_array[] = $to_1; } } $to_array = $contactlib->parse_nicknames($to_array); // Get email addresses not in the address book $not_contacts = $contactlib->are_contacts($to_array, $user); if (count($not_contacts) > 0) { $smarty->assign('notcon', 'y');
} if ($_REQUEST['fattId']) { $filegallib = TikiLib::lib('filegal'); $filedata = $filegallib->get_file_info($_REQUEST['fattId']); $a4 = file_get_contents($prefs['fgal_use_dir'] . $filedata['path']); $mail->addAttachment($a4, $filedata['filename'], $filedata['filetype']); } if ($_REQUEST['fattId']) { $filegallib = TikiLib::lib('filegal'); $filedata = $filegallib->get_file_info($_REQUEST['fattId']); $a4 = file_get_contents($prefs['fgal_use_dir'] . $filedata['path']); $mail->addAttachment($a4, $filedata['filename'], $filedata['filetype']); } // $mail->setSMTPParams($current['smtp'], $current['smtpPort'], '', $current['useAuth'], $current['username'], $current['pass']); // commented out as a temporary fix - might need to do more later if (isset($_REQUEST['useHTML']) && $_REQUEST['useHTML'] == 'on') { $mail->setHTML($_REQUEST['body'], strip_tags($_REQUEST['body'])); } else { $mail->setText($_REQUEST['body']); } $to_array_1 = preg_split('/[, ;]/', $_REQUEST['to']); $to_array = array(); foreach ($to_array_1 as $to_1) { if (!empty($to_1)) { $to_array[] = $to_1; } } $to_array = $contactlib->parse_nicknames($to_array); // Get email addresses not in the address book $not_contacts = $contactlib->are_contacts($to_array, $user); if (count($not_contacts) > 0) { $smarty->assign('notcon', 'y');
// Delete token from url $notificationPage = preg_replace('/[\\?&]TOKEN=' . $detailtoken['token'] . '/', '', $notificationPage); // If file Gallery $smarty->assign('filegallery', 'n'); if (preg_match("/\\btiki-download_file.php\\b/i", $notificationPage)) { $filegallib = TikiLib::lib('filegal'); $smarty->assign('filegallery', 'y'); $aParams = (array) json_decode($detailtoken['parameters']); $smarty->assign('fileId', $aParams['fileId']); $aFileInfos = $filegallib->get_file_info($aParams['fileId']); $smarty->assign('filegalleryId', $aFileInfos['galleryId']); $smarty->assign('filename', $aFileInfos['name']); } $smarty->assign('email_token', $detailtoken['email']); $txt = $smarty->fetch('mail/user_watch_token.tpl'); $mail->setHTML($txt); $mailsent = $mail->send(array($not['email'])); } } } if (empty($notificationPage)) { $notificationPage = preg_replace('/[\\?&]TOKEN=' . $token . '/', '', $_SERVER['REQUEST_URI']); } // Log each token access $logslib->add_log('token', $detailtoken['email'] . ' ' . tra('has accessed the following shared content:') . ' ' . $notificationPage); } else { // Error Token expired $token_error = tra('Your access to this page has expired'); } } $allperms = $userlib->get_enabled_permissions();
// Check permissions $chkUser = $aux["sender"]["user"]; if ($acc["anonymous"] == 'n' && !$userlib->user_has_permission($chkUser, 'tiki_p_admin')) { if (!$wikilib->user_has_perm_on_object($chkUser, $page, 'wiki page', 'tiki_p_view')) { $errorMsg = $chkUser . " cannot view the page: " . $page . "<br />"; $logslib->add_log('mailin', mailin_preplog($errorMsg), $logUser); $content .= $errorMsg; $processEmail = false; } } if ($processEmail) { $mail->setSubject($page); $info = $tikilib->get_page_info($page); $data = $tikilib->parse_data($info["data"]); $mail->addAttachment($info['data'], 'source.txt', 'plain/txt'); $mail->setHTML($data, strip_tags($data)); } } else { $l = $prefs['language']; $mail_data = $smarty->fetchLang($l, "mail/mailin_reply_subject.tpl"); $mail->setSubject($mail_data . $page); } if ($processEmail) { $res = $mail->send(array($email_from), 'mail'); $content .= "Response sent<br />"; $hasError = false; } } elseif ($acc['type'] == 'wiki-put' || $acc['type'] == 'wiki' && $method == "PUT") { ////////////// // wiki-put, wiki PUT: Send a wiki page. User emails page to System //////////////////////////////////////////////////////////////////////////////////