BUG 8173 password is encrypted of email settings
This commit is contained in:
@@ -4140,6 +4140,11 @@ class Cases {
|
||||
$aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
|
||||
if ($aConfiguration['CFG_VALUE'] != '') {
|
||||
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
|
||||
$passwd = $aConfiguration['MESS_PASSWORD'];
|
||||
if(strpos( $passwd, 'hush:' ) !== false){
|
||||
list($hush, $pass) = explode(":", $passwd);
|
||||
$aConfiguration['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
|
||||
}
|
||||
} else {
|
||||
$aConfiguration = array();
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ class spoolRun {
|
||||
} else { //if the from name was not set
|
||||
$this->fileData['from_name'] = 'Processmaker';
|
||||
}
|
||||
|
||||
|
||||
if( ! isset($matches[3]) ) {
|
||||
throw new Exception('Invalid email address in FROM parameter (' . $this->fileData['from'] . ')', $this->ExceptionCode['WARNING']);
|
||||
}
|
||||
@@ -327,6 +327,11 @@ class spoolRun {
|
||||
$oPHPMailer->Host = $this->config['MESS_SERVER'];
|
||||
$oPHPMailer->Port = $this->config['MESS_PORT'];
|
||||
$oPHPMailer->Username = $this->config['MESS_ACCOUNT'];
|
||||
$passwd = $this->config['MESS_PASSWORD'];
|
||||
if(strpos( $passwd, 'hush:' ) !== false){
|
||||
list($hush, $pass) = explode(":", $passwd);
|
||||
$this->config['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
|
||||
}
|
||||
$oPHPMailer->Password = $this->config['MESS_PASSWORD'];
|
||||
$oPHPMailer->From = $this->fileData['from_email'];
|
||||
$oPHPMailer->FromName = utf8_decode($this->fileData['from_name']);
|
||||
@@ -375,6 +380,11 @@ class spoolRun {
|
||||
$oPHPMailer->Host = $this->config['MESS_SERVER'];
|
||||
$oPHPMailer->Port = $this->config['MESS_PORT'];
|
||||
$oPHPMailer->Username = $this->config['MESS_ACCOUNT'];
|
||||
$passwd = $this->config['MESS_PASSWORD'];
|
||||
if(strpos( $passwd, 'hush:' ) !== false){
|
||||
list($hush, $pass) = explode(":", $passwd);
|
||||
$this->config['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
|
||||
}
|
||||
$oPHPMailer->Password = $this->config['MESS_PASSWORD'];
|
||||
$oPHPMailer->From = $this->fileData['from_email'];
|
||||
$oPHPMailer->FromName = utf8_decode($this->fileData['from_name']);
|
||||
@@ -454,6 +464,12 @@ class spoolRun {
|
||||
$send->setServer($this->config['MESS_SERVER']);
|
||||
$send->setPort($this->config['MESS_PORT']);
|
||||
$send->setUsername($this->config['MESS_ACCOUNT']);
|
||||
|
||||
$passwd = $this->config['MESS_PASSWORD'];
|
||||
if(strpos( $passwd, 'hush:' ) !== false){
|
||||
list($hush, $pass) = explode(":", $passwd);
|
||||
$this->config['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
|
||||
}
|
||||
$send->setPassword($this->config['MESS_PASSWORD']);
|
||||
$send->setReturnPath($this->fileData['from_email']);
|
||||
$send->setHeaders($header);
|
||||
@@ -482,7 +498,11 @@ class spoolRun {
|
||||
$oConfiguration = new Configuration();
|
||||
$aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
|
||||
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
|
||||
|
||||
$passwd = $aConfiguration['MESS_PASSWORD'];
|
||||
if(strpos( $passwd, 'hush:' ) !== false){
|
||||
list($hush, $pass) = explode(":", $passwd);
|
||||
$aConfiguration['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
|
||||
}
|
||||
if( $aConfiguration['MESS_ENABLED'] == '1' ) {
|
||||
$this->setConfig(array (
|
||||
'MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],
|
||||
|
||||
@@ -599,7 +599,12 @@ class wsBase
|
||||
public function sendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $aAttachment = null ) {
|
||||
try {
|
||||
$aSetup = getEmailConfiguration();
|
||||
|
||||
$passwd =$aSetup['MESS_PASSWORD'];
|
||||
if(strpos( $passwd, 'hush:' ) !== false)
|
||||
{
|
||||
list($hush, $pass) = explode(":", $passwd);
|
||||
$aSetup['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
|
||||
}
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool->setConfig(array(
|
||||
'MESS_ENGINE' => $aSetup['MESS_ENGINE'],
|
||||
@@ -676,12 +681,12 @@ class wsBase
|
||||
'app_msg_status' => 'pending'
|
||||
);
|
||||
$oSpool->create( $messageArray );
|
||||
$oSpool->sendMail();
|
||||
|
||||
$oSpool->sendMail();
|
||||
if ( $oSpool->status == 'sent' )
|
||||
$result = new wsResponse (0, "message sent : $sTo" );
|
||||
else
|
||||
$result = new wsResponse (29, $oSpool->status . ' ' . $oSpool->error . print_r ($aSetup ,1 ) );
|
||||
|
||||
return $result;
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
|
||||
@@ -724,6 +724,11 @@ class Xpdl extends processes
|
||||
$oConfiguration = new Configuration();
|
||||
$emailArray = $oConfiguration->load('Emails','','','','');
|
||||
$arrayFrom = unserialize($emailArray['CFG_VALUE']);
|
||||
$passwd = $arrayFrom['MESS_PASSWORD'];
|
||||
if(strpos( $passwd, 'hush:' ) !== false){
|
||||
list($hush, $pass) = explode(":", $passwd);
|
||||
$arrayFrom['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
|
||||
}
|
||||
$from = $arrayFrom['MESS_ACCOUNT'];
|
||||
if($to == 'ext'){
|
||||
$oUser = new Users();
|
||||
|
||||
@@ -142,6 +142,11 @@ class AppNotes extends BaseAppNotes {
|
||||
$aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
|
||||
if ($aConfiguration['CFG_VALUE'] != '') {
|
||||
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
|
||||
$passwd = $aConfiguration['MESS_PASSWORD'];
|
||||
if(strpos( $passwd, 'hush:' ) !== false){
|
||||
list($hush, $pass) = explode(":", $passwd);
|
||||
$aConfiguration['MESS_PASSWORD'] = G::decrypt($pass,'EMAILENCRYPT');
|
||||
}
|
||||
} else {
|
||||
$aConfiguration = array();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,11 @@ switch ($request) {
|
||||
|
||||
$port = ($_POST['port'] == 'default')? 25: $_POST['port'];
|
||||
$user = $_POST['account'];
|
||||
$passwd = $_POST['passwd'];
|
||||
$passwd = $_POST['passwd'];
|
||||
if(strpos( $passwd, 'hush:' ) !== false){
|
||||
list($hush, $pass) = explode(":", $passwd);
|
||||
$passwd = G::decrypt($pass,'EMAILENCRYPT');
|
||||
}
|
||||
$step = $_POST['step'];
|
||||
$auth_required = $_POST['auth_required'];
|
||||
$send_test_mail = $_POST['send_test_mail'];
|
||||
@@ -159,7 +163,7 @@ switch ($request) {
|
||||
$smtp->Hello($hello);
|
||||
}
|
||||
|
||||
if( $smtp->Authenticate($user, $passwd) ) {
|
||||
if( $smtp->Authenticate($user, $passwd ) ) {
|
||||
print(SUCCESSFUL.','.$smtp->status);
|
||||
} else {
|
||||
print(FAILED.','.$smtp->error['error']);
|
||||
|
||||
@@ -31,7 +31,11 @@ $aFields['MESS_SERVER'] = isset($_POST['form']['MESS_ENABLED']) ?tr
|
||||
$aFields['MESS_RAUTH'] = isset($_POST['form']['MESS_ENABLED']) ?isset($_POST['form']['MESS_RAUTH']) ? $_POST['form']['MESS_RAUTH'] : '': '';
|
||||
$aFields['MESS_PORT'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PORT']: '';
|
||||
$aFields['MESS_ACCOUNT'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_ACCOUNT']: '';
|
||||
$aFields['MESS_PASSWORD'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PASSWORD']: '';
|
||||
$aFields['MESS_PASSWORD'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_PASSWORD']: '';
|
||||
if(strpos( $aFields['MESS_PASSWORD'], 'hush:' ) === false){
|
||||
$aFields['MESS_PASSWORD'] = G::encrypt($aFields['MESS_PASSWORD'],'EMAILENCRYPT');
|
||||
$aFields['MESS_PASSWORD'] = 'hush:'.$aFields['MESS_PASSWORD'];
|
||||
}
|
||||
$aFields['MESS_BACKGROUND'] = isset($_POST['form']['MESS_ENABLED']) ?isset($_POST['form']['MESS_BACKGROUND']) ? $_POST['form']['MESS_BACKGROUND'] : '': '';
|
||||
$aFields['MESS_EXECUTE_EVERY'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_EXECUTE_EVERY']: '';
|
||||
$aFields['MESS_SEND_MAX'] = isset($_POST['form']['MESS_ENABLED']) ?$_POST['form']['MESS_SEND_MAX']: '';
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
autocomplete : true,
|
||||
hideTrigger : Boolean,
|
||||
alignTo : 'right',
|
||||
selectOnFocus:true,
|
||||
mode : 'remote',
|
||||
triggerAction : 'all',
|
||||
emptyText : _('ID_ENTER_SEARCH_TERM'),
|
||||
|
||||
Reference in New Issue
Block a user