Project

General

Profile

Bug #2307 ยป 2307.patch

krileon, 09 February 2011 15:48

View differences:

components/com_comprofiler/plugin/user/plug_pms_mypmspro/pms.mypmspro.php
die("SQL error" . $_CB_database->stderr(true));
}
}
$udde_msgid = $_CB_database->insertid();
// E-Mail notification code
$this->_pmsUddeNotify($udde_fromid, $udde_toid, $udde_msg, $udde_sysm);
$this->_pmsUddeNotify($udde_msgid, $udde_fromid, $udde_toid, $udde_msg, $udde_sysm);
}
function _sendPMSuddeimMSG($udde_toid,$udde_fromid,$to,$from,$sub,$msg) {
......
}
}
$udde_msgid = $_CB_database->insertid();
// E-Mail notification code
$udde_sysm="";
$this->_pmsUddeNotify($udde_fromid, $udde_toid, $udde_msg, $udde_sysm);
$this->_pmsUddeNotify($udde_msgid, $udde_fromid, $udde_toid, $udde_msg, $udde_sysm);
}
......
* Udde PMS notification by email depending on user's settings
*
* @access private
* @param int $savemsgid
* @param int $savefromid
* @param int $savetoid
* @param string $savemessage
* @param boolean $udde_sysm
*/
function _pmsUddeNotify ($savefromid, $savetoid, $savemessage, $udde_sysm) {
function _pmsUddeNotify ($savemsgid, $savefromid, $savetoid, $savemessage, $udde_sysm) {
global $_CB_database, $_CB_framework;
$params = $this->params;
......
$_CB_database->setQuery($sql);
$ison=$_CB_database->loadResult();
if (($ison==1) || ($ison==2 && !$currentlyonline) || ($ison==10 && !$itisareply) || ($ison==20 && !$currentlyonline && !$itisareply)) {
$this->_pmsUddeDispatchEMN($savefromid, $savetoid, $savemessage, 0, $udde_sysm);
$this->_pmsUddeDispatchEMN($savemsgid, $savefromid, $savetoid, $savemessage, 0, $udde_sysm);
// 0 stands for normal (not forgetmenot)
}
} elseif ($config_allowemailnotify==2) {
......
$_CB_database->setQuery($sql);
$ison=$_CB_database->loadResult();
if (($ison==1) || ($ison==2 && !$currentlyonline) || ($ison==10 && !$itisareply) || ($ison==20 && !$currentlyonline && !$itisareply)) {
$this->_pmsUddeDispatchEMN($savefromid, $savetoid, $savemessage, 0, $udde_sysm);
$this->_pmsUddeDispatchEMN($savemsgid, $savefromid, $savetoid, $savemessage, 0, $udde_sysm);
// 0 stands for normal (not forgetmenot)
}
}
......
* Udde PMS notification by email
*
* @access private
* @param int $var_msgid
* @param int $var_fromid
* @param int $var_toid
* @param string $var_message
* @param int $emn_option
* @param boolean $udde_sysm
*/
function _pmsUddeDispatchEMN($var_fromid, $var_toid, $var_message, $emn_option, $udde_sysm) {
function _pmsUddeDispatchEMN($var_msgid, $var_fromid, $var_toid, $var_message, $emn_option, $udde_sysm) {
global $_CB_database, $_CB_framework;
// --
......
if (!$var_tomail) {
return;
}
$msglink = "index.php?option=com_uddeim&task=show&messageid=".$var_msgid;
if ($emn_option==1) {
$var_body = _UDDEIM_EMN_FORGETMENOT;
$var_body = str_replace("%livesite%", $_CB_framework->getCfg( 'live_site' ), $var_body);
$var_body = str_replace("%you%", $var_toname, $var_body);
$var_body = str_replace("%site%", $_CB_framework->getCfg( 'sitename' ), $var_body);
$var_body = str_replace("%msglink%", $msglink, $var_body);
} else {
if (isset($config_emailwithmessage) && $config_emailwithmessage) {
$var_body = _UDDEIM_EMN_BODY_WITHMESSAGE;
$var_body = str_replace("%livesite%", $_CB_framework->getCfg( 'live_site' ), $var_body);
$var_body = str_replace("%you%", $var_toname, $var_body);
$var_body = str_replace("%site%", $_CB_framework->getCfg( 'sitename' ), $var_body);
$var_body = str_replace("%site%", $_CB_framework->getCfg( 'sitename' ), $var_body);
$var_body = str_replace("%msglink%", $msglink, $var_body);
$var_body = str_replace("%user%", $var_fromname, $var_body);
$var_body = str_replace("%pmessage%", $var_message, $var_body);
$var_body = str_replace("%pmessage%", $var_message, $var_body);
} else {
$var_body=_UDDEIM_EMN_BODY_NOMESSAGE;
$var_body = _UDDEIM_EMN_BODY_NOMESSAGE;
$var_body = str_replace("%livesite%", $_CB_framework->getCfg( 'live_site' ), $var_body);
$var_body = str_replace("%you%", $var_toname, $var_body);
$var_body = str_replace("%site%", $_CB_framework->getCfg( 'sitename' ), $var_body);
$var_body = str_replace("%user%", $var_fromname, $var_body);
$var_body = str_replace("%site%", $_CB_framework->getCfg( 'sitename' ), $var_body);
$var_body = str_replace("%msglink%", $msglink, $var_body);
$var_body = str_replace("%user%", $var_fromname, $var_body);
}
}
$subject=_UDDEIM_EMN_SUBJECT;
$subject=str_replace("%site%", $_CB_framework->getCfg( 'sitename' ), $subject);
$subject = _UDDEIM_EMN_SUBJECT;
$subject = str_replace("%livesite%", $_CB_framework->getCfg( 'live_site' ), $subject);
$subject = str_replace("%site%", $_CB_framework->getCfg( 'sitename' ), $subject);
$subject = str_replace("%you%", $var_toname, $subject);
$subject = str_replace("%user%", $var_fromname, $subject);
/*
$header = "MIME-Version: 1.0\n";
    (1-1/1)